Commit 00393184 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: Several: updated Config jsons; updated DefaultComponents for

Commandline DEMO; resampleFilter uses itkImageDomainFixed
parent fa59aecd
......@@ -39,7 +39,7 @@ template< int Dimensionality, class TPixel, class TInternalComputationValue >
class ItkResampleFilterComponent :
public SuperElastixComponent<
Accepting< itkTransformInterface< TInternalComputationValue, Dimensionality >,
itkImageFixedInterface< Dimensionality, TPixel >, //TODO should be FixedImageDomainInterface, we do not require intensities
itkImageDomainFixedInterface< Dimensionality >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing< itkImageInterface< Dimensionality, TPixel >,
......@@ -59,14 +59,14 @@ public:
typedef TPixel PixelType;
// Get the type definitions from the interfaces
typedef typename itkImageFixedInterface< Dimensionality, TPixel >::ItkImageType FixedImageType;
typedef typename itkImageDomainFixedInterface< Dimensionality>::ItkImageDomainType FixedImageDomainType;
typedef typename itkImageMovingInterface< Dimensionality, TPixel >::ItkImageType MovingImageType;
typedef typename itkImageInterface< Dimensionality, TPixel >::ItkImageType ResultImageType;
typedef itk::ResampleImageFilter< MovingImageType, ResultImageType > ResampleFilterType;
//Accepting Interfaces:
virtual int Set( itkImageFixedInterface< Dimensionality, TPixel > * ) override;
virtual int Set( itkImageDomainFixedInterface< Dimensionality> * ) override;
virtual int Set( itkImageMovingInterface< Dimensionality, TPixel > * ) override;
......
......@@ -39,16 +39,16 @@ ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >:
template< int Dimensionality, class TPixel, class TInternalComputationValue >
int
ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
::Set( itkImageFixedInterface< Dimensionality, TPixel > * component )
::Set( itkImageDomainFixedInterface< Dimensionality > * component )
{
auto fixedImage = component->GetItkImageFixed();
auto fixedImageDomain = component->GetItkImageDomainFixed();
// connect the itk pipeline
//this->m_ResampleFilter->SetSize(fixedImage->GetBufferedRegion().GetSize()); //should be virtual image...
this->m_ResampleFilter->SetSize( fixedImage->GetLargestPossibleRegion().GetSize() ); //should be virtual image...
this->m_ResampleFilter->SetOutputOrigin( fixedImage->GetOrigin() );
this->m_ResampleFilter->SetOutputSpacing( fixedImage->GetSpacing() );
this->m_ResampleFilter->SetOutputDirection( fixedImage->GetDirection() );
this->m_ResampleFilter->SetSize( fixedImageDomain->GetLargestPossibleRegion().GetSize()); //should be virtual image...
this->m_ResampleFilter->SetOutputOrigin( fixedImageDomain->GetOrigin());
this->m_ResampleFilter->SetOutputSpacing( fixedImageDomain->GetSpacing());
this->m_ResampleFilter->SetOutputDirection( fixedImageDomain->GetDirection());
this->m_ResampleFilter->SetDefaultPixelValue( 0 );
return 0;
}
......
......@@ -23,22 +23,38 @@
#include "selxDisplacementFieldItkImageFilterSink.h"
#include "selxItkImageSource.h"
#include "selxElastixComponent.h"
#include "selxMonolithicElastix.h"
#include "selxMonolithicTransformix.h"
#include "selxItkImageSink.h"
#include "selxItkImageRegistrationMethodv4Component.h"
#include "selxItkANTSNeighborhoodCorrelationImageToImageMetricv4.h"
#include "selxItkMeanSquaresImageToImageMetricv4.h"
#include "selxItkGradientDescentOptimizerv4.h"
#include "selxItkGaussianExponentialDiffeomorphicTransform.h"
#include "selxItkTransformDisplacementFilter.h"
#include "selxItkResampleFilter.h"
#include "selxRegistrationController.h"
#include "selxItkImageSourceFixed.h"
#include "selxItkImageSourceMoving.h"
namespace selx
{
using DefaultComponents = selx::TypeList< DisplacementFieldItkImageFilterSinkComponent< 2, float >,
using DefaultComponents = selx::TypeList<
DisplacementFieldItkImageFilterSinkComponent< 2, float >,
ItkImageSinkComponent< 2, float >,
ItkImageSourceFixedComponent< 2, float >,
ItkImageSourceMovingComponent< 2, float >,
ItkSmoothingRecursiveGaussianImageFilterComponent< 2, float >,
ElastixComponent< 2, float >,
MonolithicElastixComponent< 2, float >,
MonolithicTransformixComponent< 2, float >,
ItkImageRegistrationMethodv4Component< 2, float >,
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component< 2, float >,
ItkMeanSquaresImageToImageMetricv4Component< 2, float >,
ElastixComponent< 2, float >,
ItkImageSinkComponent< 2, float >>;
ItkGradientDescentOptimizerv4Component< double >,
ItkGaussianExponentialDiffeomorphicTransformComponent< double, 2 >,
ItkTransformDisplacementFilterComponent< 2, float, double >,
ItkResampleFilterComponent< 2, float, double >,
RegistrationControllerComponent < >,
ItkSmoothingRecursiveGaussianImageFilterComponent< 2, float >
>;
}
{
"Component": {
"Name": "RegistrationMethod",
"NameOfClass": "ElastixComponent",
"NameOfClass": "MonolithicElastixComponent",
"Dimensionality": "2",
"Transform": "BSplineTransform",
"Metric": "AdvancedMeanSquares"
......@@ -21,7 +21,15 @@
"NameOfClass": "ItkImageSinkComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "TransformDisplacementField",
"NameOfClass": "MonolithicTransformixComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "Controller",
"NameOfClass": "RegistrationControllerComponent"
},
"Connection": {
"Out": "FixedImage",
"In": "RegistrationMethod",
......@@ -31,9 +39,35 @@
"Out": "MovingImage",
"In": "RegistrationMethod",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformDisplacementField",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "MovingImage",
"In": "TransformDisplacementField",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "TransformDisplacementField",
"NameOfInterface": "elastixTransformParameterObjectInterface"
},
"Connection": {
"Out": "TransformDisplacementField",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "ResultImage"
"In": "Controller",
"NameOfInterface": "RunRegistrationInterface"
},
"Connection": {
"Out": "TransformDisplacementField",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
}
}
{
"Component": {
"Name": "RegistrationMethod",
"NameOfClass": "ElastixComponent",
"NameOfClass": "MonolithicElastixComponent",
"Dimensionality": "2",
"Transform": "BSplineTransform",
"Metric": "AdvancedNormalizedCorrelation"
......@@ -21,7 +21,15 @@
"NameOfClass": "ItkImageSinkComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "TransformDisplacementField",
"NameOfClass": "MonolithicTransformixComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "Controller",
"NameOfClass": "RegistrationControllerComponent"
},
"Connection": {
"Out": "FixedImage",
"In": "RegistrationMethod",
......@@ -31,9 +39,35 @@
"Out": "MovingImage",
"In": "RegistrationMethod",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformDisplacementField",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "MovingImage",
"In": "TransformDisplacementField",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "TransformDisplacementField",
"NameOfInterface": "elastixTransformParameterObjectInterface"
},
"Connection": {
"Out": "TransformDisplacementField",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "ResultImage"
"In": "Controller",
"NameOfInterface": "RunRegistrationInterface"
},
"Connection": {
"Out": "TransformDisplacementField",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
}
}
......@@ -29,6 +29,31 @@
"NameOfClass": "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component",
"Dimensionality": "2"
},
"Component": {
"Name": "Optimizer",
"NameOfClass": "ItkGradientDescentOptimizerv4Component",
"NumberOfIterations": "100",
"LearningRate": "100"
},
"Component": {
"Name": "Transform",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "ResampleFilter",
"NameOfClass": "ItkResampleFilterComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "TransformDisplacementFilter",
"NameOfClass": "ItkTransformDisplacementFilterComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "Controller",
"NameOfClass": "RegistrationControllerComponent"
},
"Connection": {
"Out": "FixedImage",
"In": "RegistrationMethod",
......@@ -41,11 +66,21 @@
},
"Connection": {
"Out": "RegistrationMethod",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
"In": "ResampleFilter",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "TransformDisplacementFilter",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "ResampleFilter",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
},
"Connection": {
"Out": "TransformDisplacementFilter",
"In": "ResultDisplacementField",
"NameOfInterface": "DisplacementFieldItkImageSourceInterface"
},
......@@ -53,5 +88,50 @@
"Out": "Metric",
"In": "RegistrationMethod",
"NameOfInterface": "itkMetricv4Interface"
},
"Connection": {
"Out": "FixedImage",
"In": "Transform",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "Transform",
"In": "RegistrationMethod",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "Optimizer",
"In": "RegistrationMethod",
"NameOfInterface": "itkOptimizerv4Interface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformDisplacementFilter",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "ResampleFilter",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "MovingImage",
"In": "ResampleFilter",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "Controller",
"NameOfInterface": "RunRegistrationInterface"
},
"Connection": {
"Out": "ResampleFilter",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
},
"Connection": {
"Out": "TransformDisplacementFilter",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
}
}
......@@ -29,6 +29,31 @@
"NameOfClass": "ItkMeanSquaresImageToImageMetricv4Component",
"Dimensionality": "2"
},
"Component": {
"Name": "Optimizer",
"NameOfClass": "ItkGradientDescentOptimizerv4Component",
"NumberOfIterations": "100",
"LearningRate": "0.001"
},
"Component": {
"Name": "Transform",
"NameOfClass": "ItkGaussianExponentialDiffeomorphicTransformComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "ResampleFilter",
"NameOfClass": "ItkResampleFilterComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "TransformDisplacementFilter",
"NameOfClass": "ItkTransformDisplacementFilterComponent",
"Dimensionality": "2"
},
"Component": {
"Name": "Controller",
"NameOfClass": "RegistrationControllerComponent"
},
"Connection": {
"Out": "FixedImage",
"In": "RegistrationMethod",
......@@ -41,11 +66,21 @@
},
"Connection": {
"Out": "RegistrationMethod",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
"In": "ResampleFilter",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "TransformDisplacementFilter",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "ResampleFilter",
"In": "ResultImage",
"NameOfInterface": "itkImageInterface"
},
"Connection": {
"Out": "TransformDisplacementFilter",
"In": "ResultDisplacementField",
"NameOfInterface": "DisplacementFieldItkImageSourceInterface"
},
......@@ -53,5 +88,50 @@
"Out": "Metric",
"In": "RegistrationMethod",
"NameOfInterface": "itkMetricv4Interface"
},
"Connection": {
"Out": "FixedImage",
"In": "Transform",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "Transform",
"In": "RegistrationMethod",
"NameOfInterface": "itkTransformInterface"
},
"Connection": {
"Out": "Optimizer",
"In": "RegistrationMethod",
"NameOfInterface": "itkOptimizerv4Interface"
},
"Connection": {
"Out": "FixedImage",
"In": "TransformDisplacementFilter",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "FixedImage",
"In": "ResampleFilter",
"NameOfInterface": "itkImageDomainFixedInterface"
},
"Connection": {
"Out": "MovingImage",
"In": "ResampleFilter",
"NameOfInterface": "itkImageMovingInterface"
},
"Connection": {
"Out": "RegistrationMethod",
"In": "Controller",
"NameOfInterface": "RunRegistrationInterface"
},
"Connection": {
"Out": "ResampleFilter",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
},
"Connection": {
"Out": "TransformDisplacementFilter",
"In": "Controller",
"NameOfInterface": "ReconnectTransformInterface"
}
}
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