Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: enable compiling with ITK >= 4.6 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Applications/DemonsRegistration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#include <itkTransformFileReader.h>
#if (ITK_VERSION_MAJOR < 4)
#include <itkTransformToDeformationFieldSource.h>
#else
#elif (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6)
#include <itkTransformToDisplacementFieldSource.h>
#else
#include <itkTransformToDisplacementFieldFilter.h>
#endif
#include <itkVectorCentralDifferenceImageFunction.h>
#include <itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction.h>
Expand Down Expand Up @@ -746,8 +748,10 @@ void DemonsRegistrationFunction( arguments args )
// Set up the TransformToDeformationFieldFilter
#if (ITK_VERSION_MAJOR < 4)
typedef itk::TransformToDeformationFieldSource<DeformationFieldType> FieldGeneratorType;
#else
#elif (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6)
typedef itk::TransformToDisplacementFieldSource<DeformationFieldType> FieldGeneratorType;
#else
typedef itk::TransformToDisplacementFieldFilter<DeformationFieldType> FieldGeneratorType;
#endif
typedef typename FieldGeneratorType::TransformType TransformType;

Expand All @@ -764,10 +768,17 @@ void DemonsRegistrationFunction( arguments args )
fieldGenerator->SetTransform( trsf );
// fieldGenerator->SetOutputRegion(
// fixedImageReader->GetOutput()->GetRequestedRegion());
#if ( (ITK_VERSION_MAJOR > 4) || ((ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR >= 6)) )
fieldGenerator->SetSize(
fixedImageReader->GetOutput()->GetRequestedRegion().GetSize() );
fieldGenerator->SetOutputStartIndex(
fixedImageReader->GetOutput()->GetRequestedRegion().GetIndex() );
#else
fieldGenerator->SetOutputSize(
fixedImageReader->GetOutput()->GetRequestedRegion().GetSize() );
fixedImageReader->GetOutput()->GetRequestedRegion().GetSize() );
fieldGenerator->SetOutputIndex(
fixedImageReader->GetOutput()->GetRequestedRegion().GetIndex() );
#endif
fieldGenerator->SetOutputSpacing(
fixedImageReader->GetOutput()->GetSpacing() );
fieldGenerator->SetOutputOrigin(
Expand Down