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
00393184
Commit
00393184
authored
Aug 17, 2016
by
Floris Berendsen
Browse files
ENH: Several: updated Config jsons; updated DefaultComponents for
Commandline DEMO; resampleFilter uses itkImageDomainFixed
parent
fa59aecd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Modules/Components/itkImageRegistrationMethodv4/include/selxItkResampleFilter.h
View file @
00393184
...
...
@@ -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
itkImage
Domain
FixedInterface
<
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
itkImage
Domain
FixedInterface
<
Dimensionality
>::
ItkImage
Domain
Type
FixedImage
Domain
Type
;
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
(
itkImage
Domain
FixedInterface
<
Dimensionality
>
*
)
override
;
virtual
int
Set
(
itkImageMovingInterface
<
Dimensionality
,
TPixel
>
*
)
override
;
...
...
Modules/Components/itkImageRegistrationMethodv4/include/selxItkResampleFilter.hxx
View file @
00393184
...
...
@@ -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
(
itkImage
Domain
FixedInterface
<
Dimensionality
>
*
component
)
{
auto
fixedImage
=
component
->
GetItkImageFixed
();
auto
fixedImage
Domain
=
component
->
GetItkImage
Domain
Fixed
();
// 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
(
fixedImage
Domain
->
GetLargestPossibleRegion
().
GetSize
());
//should be virtual image...
this
->
m_ResampleFilter
->
SetOutputOrigin
(
fixedImage
Domain
->
GetOrigin
());
this
->
m_ResampleFilter
->
SetOutputSpacing
(
fixedImage
Domain
->
GetSpacing
());
this
->
m_ResampleFilter
->
SetOutputDirection
(
fixedImage
Domain
->
GetDirection
());
this
->
m_ResampleFilter
->
SetDefaultPixelValue
(
0
);
return
0
;
}
...
...
Modules/Core/ComponentRegistration/include/selxDefaultComponents.h
View file @
00393184
...
...
@@ -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
>
>
;
}
Testing/Unit/Data/Configuration/elastix_Bspline_MSD.json
View file @
00393184
{
"Component"
:
{
"Name"
:
"RegistrationMethod"
,
"NameOfClass"
:
"ElastixComponent"
,
"NameOfClass"
:
"
Monolithic
ElastixComponent"
,
"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"
}
}
Testing/Unit/Data/Configuration/elastix_Bspline_NC.json
View file @
00393184
{
"Component"
:
{
"Name"
:
"RegistrationMethod"
,
"NameOfClass"
:
"ElastixComponent"
,
"NameOfClass"
:
"
Monolithic
ElastixComponent"
,
"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"
}
}
Testing/Unit/Data/Configuration/itkv4_SVF_ANTsCC.json
View file @
00393184
...
...
@@ -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"
:
"Res
ultImage
"
,
"NameOfInterface"
:
"itk
Image
Interface"
"In"
:
"Res
ampleFilter
"
,
"NameOfInterface"
:
"itk
Transform
Interface"
},
"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"
}
}
Testing/Unit/Data/Configuration/itkv4_SVF_MSD.json
View file @
00393184
...
...
@@ -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"
:
"Res
ultImage
"
,
"NameOfInterface"
:
"itk
Image
Interface"
"In"
:
"Res
ampleFilter
"
,
"NameOfInterface"
:
"itk
Transform
Interface"
},
"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"
}
}
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