Skip to content

Commit

Permalink
BUG: use ITK_NULLPTR instead of identityTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
romangrothausmann committed Feb 5, 2019
1 parent 9c0b04c commit d62cbd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Modules/Core/Common/test/itkImageTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "itkImage.h"
#include "itkFixedArray.h"
#include "itkImageAlgorithm.h"
#include "itkIdentityTransform.h"
#include "itkTransform.h"

int itkImageTest(int, char* [] )
{
Expand Down Expand Up @@ -123,11 +123,10 @@ int itkImageTest(int, char* [] )
regionRef.SetSize(sizeRef);
imageRef->SetRegions(regionRef);

typedef itk::IdentityTransform< double, Image::ImageDimension > IdentityTransformType;
IdentityTransformType* it = IdentityTransformType::New();
typedef itk::Transform< double, Image::ImageDimension, Image::ImageDimension > TransformType;

Image::RegionType boxRegion = itk::ImageAlgorithm::EnlargeRegionOverBox(image->GetLargestPossibleRegion(),
it,
static_cast< TransformType *>(ITK_NULLPTR),
image.GetPointer(),
imageRef.GetPointer());
Image::IndexType correctIndex; correctIndex.Fill(0);
Expand Down
7 changes: 3 additions & 4 deletions Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "itkProgressReporter.h"
#include "itkContinuousIndex.h"
#include "itkMath.h"
#include "itkIdentityTransform.h"
#include "itkTransform.h"

namespace itk
{
Expand Down Expand Up @@ -412,11 +412,10 @@ WarpImageFilter< TInputImage, TOutputImage, TDisplacementField >
else
{
using DisplacementRegionType = typename TDisplacementField::RegionType;
using IdentityTransformType = itk::IdentityTransform< SpacePrecisionType, OutputImageType::ImageDimension >;
IdentityTransformType* it = IdentityTransformType::New();
using TransformType = itk::Transform< SpacePrecisionType, OutputImageType::ImageDimension, OutputImageType::ImageDimension >;

DisplacementRegionType fieldRequestedRegion = ImageAlgorithm::EnlargeRegionOverBox(outputPtr->GetRequestedRegion(),
it,
static_cast< TransformType *>(ITK_NULLPTR),
outputPtr,
fieldPtr);
fieldPtr->SetRequestedRegion( fieldRequestedRegion );
Expand Down

0 comments on commit d62cbd4

Please sign in to comment.