Skip to content

Commit

Permalink
ENH: Replace elastix ImageSpatialObject2 by ITK ImageSpatialObject
Browse files Browse the repository at this point in the history
Replaced elastix specific `ImageSpatialObject2` and `ImageMaskSpatialObject2` by ITK's `ImageSpatialObject` and `ImageMaskSpatialObject`, respectively.

Let azure CI build with the ITK5 version of May 9, 2019 (from ITK git master branch).

Added Mask->Update() calls to `MultiResolutionRegistration::UpdateMasks`, to ensure that the bounding boxes are computed.

Removed elementary GoogleTest for `ImageMaskSpatialObject2`.

Removed failing 3DCT_lung.MI.bspline.SGD.004 test for ITK4 (it passes on ITK5)

Part of the elastix upgrade to ITKv5.
  • Loading branch information
N-Dekker committed Jun 13, 2019
1 parent 2218395 commit 7c2523a
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 1,130 deletions.
4 changes: 0 additions & 4 deletions Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ set( CommonFiles
itkGenericMultiResolutionPyramidImageFilter.hxx
itkImageFileCastWriter.h
itkImageFileCastWriter.hxx
itkImageMaskSpatialObject2.h
itkImageMaskSpatialObject2.hxx
itkImageSpatialObject2.h
itkImageSpatialObject2.hxx
itkMeshFileReaderBase.h
itkMeshFileReaderBase.hxx
itkMultiOrderBSplineDecompositionImageFilter.h
Expand Down
6 changes: 3 additions & 3 deletions Common/CostFunctions/itkAdvancedImageToImageMetric.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "itkAdvancedTransform.h"
#include "vnl/vnl_sparse_matrix.h"

#include "itkImageMaskSpatialObject2.h"
#include "itkImageMaskSpatialObject.h"

// Needed for checking for B-spline for faster implementation
#include "itkAdvancedBSplineDeformableTransform.h"
Expand Down Expand Up @@ -131,8 +131,8 @@ class AdvancedImageToImageMetric :
typedef typename DerivativeType::ValueType DerivativeValueType;
typedef typename Superclass::ParametersType ParametersType;

typedef ImageMaskSpatialObject2< itkGetStaticConstMacro( FixedImageDimension ) > FixedImageMaskSpatialObject2Type;
typedef ImageMaskSpatialObject2< itkGetStaticConstMacro( MovingImageDimension ) > MovingImageMaskSpatialObject2Type;
typedef ImageMaskSpatialObject< itkGetStaticConstMacro( FixedImageDimension ) > FixedImageMaskSpatialObject2Type;
typedef ImageMaskSpatialObject< itkGetStaticConstMacro( MovingImageDimension ) > MovingImageMaskSpatialObject2Type;

/** Some useful extra typedefs. */
typedef typename FixedImageType::PixelType FixedImagePixelType;
Expand Down
1 change: 0 additions & 1 deletion Common/GTesting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_executable(CommonGTest
itkComputeImageExtremaFilterGTest.cxx
itkImageMaskSpatialObject2GTest.cxx
)
target_link_libraries(CommonGTest
GTest::GTest GTest::Main
Expand Down
46 changes: 0 additions & 46 deletions Common/GTesting/itkImageMaskSpatialObject2GTest.cxx

This file was deleted.

4 changes: 4 additions & 0 deletions Common/ImageSamplers/itkImageSamplerBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ ImageSamplerBase< TInputImage >

typedef typename MaskType::BoundingBoxType BoundingBoxType;
typedef typename BoundingBoxType::PointsContainer PointsContainerType;
#if ITK_VERSION_MAJOR < 5
typename BoundingBoxType::Pointer bb = this->m_Mask->GetBoundingBox();
#else
typename BoundingBoxType::ConstPointer bb = this->m_Mask->GetMyBoundingBoxInWorldSpace();
#endif
typename BoundingBoxType::Pointer bbIndex = BoundingBoxType::New();
const PointsContainerType * cornersWorld = bb->GetPoints();
typename PointsContainerType::Pointer cornersIndex = PointsContainerType::New();
Expand Down
4 changes: 2 additions & 2 deletions Common/itkComputeImageExtremaFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "itkStatisticsImageFilter.h"
#include "itkSpatialObject.h"
#include "itkImageMaskSpatialObject2.h"
#include "itkImageMaskSpatialObject.h"

namespace itk
{
Expand Down Expand Up @@ -86,7 +86,7 @@ class ComputeImageExtremaFilter :
itkSetConstObjectMacro( ImageMask, ImageMaskType );
itkGetConstObjectMacro( ImageMask, ImageMaskType );

typedef ImageMaskSpatialObject2< itkGetStaticConstMacro(ImageDimension) > ImageSpatialMaskType;
typedef ImageMaskSpatialObject< itkGetStaticConstMacro(ImageDimension) > ImageSpatialMaskType;
typedef typename ImageSpatialMaskType::Pointer ImageSpatialMaskPointer;
typedef typename ImageSpatialMaskType::ConstPointer ImageSpatialMaskConstPointer;
itkSetConstObjectMacro( ImageSpatialMask, ImageSpatialMaskType );
Expand Down
131 changes: 0 additions & 131 deletions Common/itkImageMaskSpatialObject2.h

This file was deleted.

Loading

0 comments on commit 7c2523a

Please sign in to comment.