From 0902971b2ff1fe629ca8f3fa926941995ee6f108 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Tue, 12 Jul 2011 08:10:21 +0200 Subject: [PATCH] Correct bug: when crop is only performed along a single direction. --- itk/clitkCropLikeImageFilter.txx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/itk/clitkCropLikeImageFilter.txx b/itk/clitkCropLikeImageFilter.txx index 0af957b..2877239 100644 --- a/itk/clitkCropLikeImageFilter.txx +++ b/itk/clitkCropLikeImageFilter.txx @@ -136,6 +136,16 @@ GenerateOutputInformation() { << ") of 'like' is " << likeSpacing[i] << "."); } } + + // Check that we must crop along each dimension. If not, we use the + // size of the input image + for(unsigned int i=0; iGetLargestPossibleRegion().GetIndex()[i]; + likeSize[i] = input->GetLargestPossibleRegion().GetSize()[i]; + } + } + // Define output region m_OutputRegion.SetIndex(likeStart); m_OutputRegion.SetSize(likeSize); -- 2.47.1