Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
SuperElastix
Commits
0c6fb659
Commit
0c6fb659
authored
Apr 21, 2016
by
Floris Berendsen
Browse files
BUG: Tests failed due to incorrect counting of connections
parent
1b61f18c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/Core/ComponentInterface/src/Overlord.cxx
View file @
0c6fb659
...
...
@@ -104,7 +104,7 @@ namespace selx
// If a node has 0 possible components, the configuration is aborted (with an exception)
// If all nodes have exactly 1 possible component, no more criteria are needed.
//
// Design consideration: should the exception be thrown by this->m_ComponentSelectorContainer[
*c
omponent
It]
?
// Design consideration: should the exception be thrown by this->m_ComponentSelectorContainer[
name]->UpdatePossibleC
omponent
s()
?
// The (failing) criteria can be printed as well.
if
(
numberOfComponents
>
1
)
{
...
...
@@ -118,6 +118,22 @@ namespace selx
void
Overlord
::
ApplyNodeConfiguration
()
{
// At the overlord we store all components selectors in a mapping based
// on the keys we find in the graph. This is a flexible solution, but is
// fragile as well since correspondence is implicit.
// We might consider copying the blueprint graph to a component selector
// graph, such that all graph operations correspond
//
// This could be in line with the idea of maintaining 2 graphs:
// 1 descriptive (= const blueprint) and 1 internal holding to realized
// components.
// Manipulating the internal graph (combining component nodes into a
// hybrid node, duplicating sub graphs, etc) is possible then.
//
// Additional redesign consideration: the final graph should hold the
// realized components at each node and not the ComponentSelectors that,
// in turn, hold 1 (or more) component.
Blueprint
::
ComponentNamesType
componentNames
=
this
->
m_Blueprint
->
GetComponentNames
();
for
(
auto
const
&
name
:
componentNames
)
{
...
...
@@ -131,34 +147,6 @@ namespace selx
}
void
Overlord
::
ApplyConnectionConfiguration
()
{
//typedef Blueprint::OutputIteratorType OutputIteratorType;
//typedef Blueprint::OutputIteratorPairType OutputIteratorPairType;
//TODO: these loops have to be redesigned for a number of reasons:
// - They rely on the assumption that the index of the vector equals the componentIndex in blueprint
// - Tedious, integer indexing.
//
// We might consider copying the blueprint graph to a component selector
// graph, such that all graph operations correspond
//
// This could be in line with the idea of maintaining 2 graphs: 1 descriptive (= const blueprint) and
// 1 internal holding to realized components.
// Manipulating the internal graph (combining component nodes into a hybrid node, duplicating sub graphs, etc)
// is possible then.
//
// Additional redesign consideration: the final graph should hold the realized components at each node and not the
// ComponentSelectors that, in turn, hold 1 (or more) component.
//
//
// Or loop over connections:
//Blueprint::ConnectionIteratorPairType connectionItPair = this->m_Blueprint->GetConnectionIterator();
//Blueprint::ConnectionIteratorPairType::first_type connectionIt;
//Blueprint::ConnectionIteratorPairType::second_type connectionItEnd = connectionItPair.second;
//int count = 0;
//for (connectionIt = connectionItPair.first; connectionIt != connectionItEnd; ++connectionIt)
//{
//}
Blueprint
::
ComponentNamesType
componentNames
=
this
->
m_Blueprint
->
GetComponentNames
();
for
(
auto
const
&
name
:
componentNames
)
{
...
...
@@ -203,7 +191,7 @@ namespace selx
// connect only via interfaces provided by user configuration
for
(
auto
const
&
interfaceName
:
connectionProperties
[
"NameOfInterface"
])
{
numberOfConnections
+=
targetComponent
->
AcceptConnectionFrom
(
interfaceName
.
c_str
(),
sourceComponent
);
numberOfConnections
+=
(
targetComponent
->
AcceptConnectionFrom
(
interfaceName
.
c_str
(),
sourceComponent
)
==
ComponentBase
::
interfaceStatus
::
success
?
1
:
0
)
;
}
}
else
...
...
Testing/Unit/selxOverlordTest.cxx
View file @
0c6fb659
...
...
@@ -46,7 +46,7 @@ public:
metric2TransformConnectionParameters
[
"NameOfInterface"
]
=
{
"TransformedImageInterface"
};
//TODO: check direction
blueprint
->
AddConnection
(
"
Metric"
,
"
Transform"
,
metric2TransformConnectionParameters
);
blueprint
->
AddConnection
(
"Transform
"
,
"Metric
"
,
metric2TransformConnectionParameters
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment