From: dsarrut Date: Tue, 12 Jul 2011 06:10:21 +0000 (+0200) Subject: Correct bug: when crop is only performed along a single direction. X-Git-Tag: v1.3.0~293 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0902971b2ff1fe629ca8f3fa926941995ee6f108;p=clitk.git Correct bug: when crop is only performed along a single direction. --- 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);