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 Sep 28, 2018
1 parent 3825538 commit 9ece4e2
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 @@ -122,11 +122,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 @@ -440,11 +440,10 @@ WarpImageFilter< TInputImage, TOutputImage, TDisplacementField >
else
{
typedef typename TDisplacementField::RegionType DisplacementRegionType;
typedef itk::IdentityTransform< SpacePrecisionType, OutputImageType::ImageDimension > IdentityTransformType;
IdentityTransformType* it = IdentityTransformType::New();
typedef itk::Transform< SpacePrecisionType, OutputImageType::ImageDimension, OutputImageType::ImageDimension > TransformType;

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

0 comments on commit 9ece4e2

Please sign in to comment.