From: Simon Rit Date: Fri, 17 Jun 2011 16:40:45 +0000 (+0200) Subject: Resample is not robust to i/o spacings with different signs => launch X-Git-Tag: v1.3.0~318^2~4 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=909125a84e0cd7af31f1bf95dbd7816656765d81;p=clitk.git Resample is not robust to i/o spacings with different signs => launch exception --- diff --git a/itk/clitkResampleImageWithOptionsFilter.txx b/itk/clitkResampleImageWithOptionsFilter.txx index 7e5eeab..36e08bf 100644 --- a/itk/clitkResampleImageWithOptionsFilter.txx +++ b/itk/clitkResampleImageWithOptionsFilter.txx @@ -125,11 +125,15 @@ GenerateOutputInformation() // floor() is used to intentionally reduce the number of slices // because, from a clinical point of view, it's better to // remove data than to add data that privously didn't exist. + if(inputSpacing[i]*m_OutputSpacing[i]<0) + itkExceptionMacro( << "Input and output spacings don't have the same size, can't cope with that" ); m_OutputSize[i] = (int)floor(inputSize[i]*inputSpacing[i]/m_OutputSpacing[i]); } } else { if (m_OutputSpacing[0] != -1) { // apply spacing, compute size for(unsigned int i=0; iGetOutput(0); // OutputImageRegionType region;