Commit 3eac370a authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: minor messaging, updated Demo jsons

parent 6b40b677
......@@ -122,7 +122,6 @@ main( int ac, char * av[] )
if( vm.count( "in" ) )
{
std::cout << "Number of input data: " << inputPairs.size() << "\n";
int index = 0;
for( const auto & inputPair : inputPairs )
{
......@@ -131,8 +130,7 @@ main( int ac, char * av[] )
const std::string & name = nameAndPath[ 0 ];
const std::string & path = nameAndPath[ 1 ];
std::cout << " " << index << " " << name << " : " << path << "\n";
++index;
// since we do not know which reader type we should instantiate for input "name",
// we ask SuperElastix for a reader that matches the type of the source component "name"
......@@ -141,12 +139,14 @@ main( int ac, char * av[] )
reader->SetFileName( path );
superElastixFilter->SetInput( name, reader->GetOutput() );
fileReaders.push_back( reader );
std::cout << "Input data " << index << " " << name << " : " << path << "\n";
++index;
}
}
if( vm.count( "out" ) )
{
std::cout << "Number of output data: " << outputPairs.size() << "\n";
int index = 0;
for( const auto & outputPair : outputPairs )
{
......@@ -155,9 +155,6 @@ main( int ac, char * av[] )
const std::string & name = nameAndPath[ 0 ];
const std::string & path = nameAndPath[ 1 ];
std::cout << " " << index << " " << name << " : " << path << "\n";
++index;
// since we do not know which writer type we should instantiate for output "name",
// we ask SuperElastix for a writer that matches the type of the sink component "name"
selx::AnyFileWriter::Pointer writer = superElastixFilter->GetOutputFileWriter( name );
......@@ -167,6 +164,10 @@ main( int ac, char * av[] )
//writer->SetInput(superElastixFilter->GetOutput<Image2DType>(name));
writer->SetInput( superElastixFilter->GetOutput( name ) );
fileWriters.push_back( writer );
std::cout << "Output data " << index << " " << name << " : " << path << "\n";
++index;
}
}
......
......@@ -43,6 +43,7 @@ namespace selx
{
class Overlord
{
// TODO: consider renaming Overlord to NetworkBuilder (?). Its output should be a (light weight) ComponentContainer with 1 Execute button. All other data such as graphs and selectors can be deleted.
public:
typedef Blueprint::ComponentNameType ComponentNameType;
......
......@@ -58,13 +58,15 @@ Overlord::Configure()
std::cout << "===== Performing Handshakes between unique and non-unique Components =====" << std::endl;
this->PropagateConnectionsWithUniqueComponents();
nonUniqueComponentNames = this->GetNonUniqueComponentNames();
std::cout << nonUniqueComponentNames.size() << " out of " << m_Blueprint->GetComponentNames().size()
<< " Components could not be uniquely selected" << std::endl << std::endl;
this->m_isConfigured = true;
}
auto nonUniqueComponentNames = this->GetNonUniqueComponentNames();
std::cout << nonUniqueComponentNames.size() << " out of " << m_Blueprint->GetComponentNames().size()
<< " Components could not be uniquely selected" << std::endl << std::endl;
if( nonUniqueComponentNames.size() > 0 )
{
std::cout << std::endl << "These Nodes need more criteria: " << std::endl;
......@@ -75,13 +77,15 @@ Overlord::Configure()
}
return false;
}
/*
std::cout << "===== Selected Components =====" << std::endl;
for (auto const & componentName : m_Blueprint->GetComponentNames())
{
std::cout << componentName << ":" << std::endl;
this->m_ComponentSelectorContainer[componentName]->PrintComponents();
}
*/
return true;
}
......
......@@ -137,14 +137,11 @@ SuperElastixFilter< ComponentTypeList >
allUniqueComponents = this->m_Overlord->Configure();
}
bool isSuccess( false );
if( allUniqueComponents && !this->m_IsConnected )
{
isSuccess = this->m_Overlord->ConnectComponents();
this->m_IsConnected = true;
this->m_IsConnected = this->m_Overlord->ConnectComponents();
std::cout << "Connecting Components: " << (this->m_IsConnected ? "succeeded" : "failed") << std::endl << std::endl;
}
std::cout << "Connecting Components: " << ( isSuccess ? "succeeded" : "failed" ) << std::endl;
if( ( m_OutputConnectionModified == true ) || ( this->m_BlueprintConnectionModified == true ) )
{
......@@ -173,6 +170,7 @@ void
SuperElastixFilter< ComponentTypeList >
::GenerateData( void )
{
std::cout << "Executing Network:" << std::endl;
// This calls controller components that take over the control flow if the itk pipeline is broken.
this->m_Overlord->Execute();
......
......@@ -2,32 +2,37 @@
"Component": {
"Name": "RegistrationMethod",
"NameOfClass": "ItkImageRegistrationMethodv4Component",
"Dimensionality": "2"
"NumberOfLevels": "3" ,
"ShrinkFactorsPerLevel": [ "4", "2", "1" ],
"SmoothingSigmasPerLevel": [ "4", "2", "1" ]
},
"Component": {
"Name": "FixedImage",
"NameOfClass": "ItkImageSourceFixedComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "MovingImage",
"NameOfClass": "ItkImageSourceMovingComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "ResultImage",
"NameOfClass": "ItkImageSinkComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "ResultDisplacementField",
"NameOfClass": "DisplacementFieldItkImageFilterSinkComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "Metric",
"NameOfClass": "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component",
"Dimensionality": "2"
"NameOfClass": "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component"
},
"Component": {
"Name": "Optimizer",
......@@ -38,17 +43,20 @@
"Component": {
"Name": "Transform",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformComponent",
"Dimensionality": "2"
"InternalComputationValueType": "double"
},
"Component": {
"Name": "TransformResolutionAdaptor",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent",
"ShrinkFactorsPerLevel": [ "4", "2", "1" ]
},
"Component": {
"Name": "ResampleFilter",
"NameOfClass": "ItkResampleFilterComponent",
"Dimensionality": "2"
"NameOfClass": "ItkResampleFilterComponent"
},
"Component": {
"Name": "TransformDisplacementFilter",
"NameOfClass": "ItkTransformDisplacementFilterComponent",
"Dimensionality": "2"
"NameOfClass": "ItkTransformDisplacementFilterComponent"
},
"Component": {
"Name": "Controller",
......@@ -98,6 +106,15 @@
"Out": "Transform",
"In": "RegistrationMethod",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformResolutionAdaptor",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "TransformResolutionAdaptor",
"In": "RegistrationMethod"
},
"Connection": {
"Out": "Optimizer",
......
......@@ -2,32 +2,37 @@
"Component": {
"Name": "RegistrationMethod",
"NameOfClass": "ItkImageRegistrationMethodv4Component",
"Dimensionality": "2"
"NumberOfLevels": "3" ,
"ShrinkFactorsPerLevel": [ "4", "2", "1" ],
"SmoothingSigmasPerLevel": [ "4", "2", "1" ]
},
"Component": {
"Name": "FixedImage",
"NameOfClass": "ItkImageSourceFixedComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "MovingImage",
"NameOfClass": "ItkImageSourceMovingComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "ResultImage",
"NameOfClass": "ItkImageSinkComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "ResultDisplacementField",
"NameOfClass": "DisplacementFieldItkImageFilterSinkComponent",
"Dimensionality": "2"
"Dimensionality": "2",
"PixelType": "float"
},
"Component": {
"Name": "Metric",
"NameOfClass": "ItkMeanSquaresImageToImageMetricv4Component",
"Dimensionality": "2"
"NameOfClass": "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component"
},
"Component": {
"Name": "Optimizer",
......@@ -38,17 +43,20 @@
"Component": {
"Name": "Transform",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformComponent",
"Dimensionality": "2"
"InternalComputationValueType": "double"
},
"Component": {
"Name": "TransformResolutionAdaptor",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent",
"ShrinkFactorsPerLevel": [ "4", "2", "1" ]
},
"Component": {
"Name": "ResampleFilter",
"NameOfClass": "ItkResampleFilterComponent",
"Dimensionality": "2"
"NameOfClass": "ItkResampleFilterComponent"
},
"Component": {
"Name": "TransformDisplacementFilter",
"NameOfClass": "ItkTransformDisplacementFilterComponent",
"Dimensionality": "2"
"NameOfClass": "ItkTransformDisplacementFilterComponent"
},
"Component": {
"Name": "Controller",
......@@ -98,6 +106,15 @@
"Out": "Transform",
"In": "RegistrationMethod",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformResolutionAdaptor",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "TransformResolutionAdaptor",
"In": "RegistrationMethod"
},
"Connection": {
"Out": "Optimizer",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment