From 909125a84e0cd7af31f1bf95dbd7816656765d81 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 17 Jun 2011 18:40:45 +0200 Subject: [PATCH] Resample is not robust to i/o spacings with different signs => launch exception --- itk/clitkResampleImageWithOptionsFilter.txx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.45.1