From 8e4f61d01c82ffcf2e9180d7fd4e3aedac83f6f7 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Tue, 11 May 2010 09:06:37 +0000 Subject: [PATCH] - future resample class (do not use yet) --- itk/clitkResampleImageWithOptionsFilter.h | 6 +++--- itk/clitkResampleImageWithOptionsFilter.txx | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/itk/clitkResampleImageWithOptionsFilter.h b/itk/clitkResampleImageWithOptionsFilter.h index 7c212f0..9a8f5e2 100644 --- a/itk/clitkResampleImageWithOptionsFilter.h +++ b/itk/clitkResampleImageWithOptionsFilter.h @@ -92,8 +92,8 @@ namespace clitk { // Options itkGetMacro(LastDimensionIsTime, bool); itkSetMacro(LastDimensionIsTime, bool); - itkSetMacro(IsoSpacing, double); - itkGetMacro(IsoSpacing, double); + itkSetMacro(OutputIsoSpacing, double); + itkGetMacro(OutputIsoSpacing, double); itkSetMacro(OutputSpacing, OutputImageSpacingType); itkGetMacro(OutputSpacing, OutputImageSpacingType); itkSetMacro(OutputSize, OutputImageSizeType); @@ -120,7 +120,7 @@ namespace clitk { virtual ~ResampleImageWithOptionsFilter() {} bool m_LastDimensionIsTime; - double m_IsoSpacing; + double m_OutputIsoSpacing; InterpolationTypeEnumeration m_InterpolationType; bool m_GaussianFilteringEnabled; int m_BSplineOrder; diff --git a/itk/clitkResampleImageWithOptionsFilter.txx b/itk/clitkResampleImageWithOptionsFilter.txx index 87f34dd..aee15f5 100644 --- a/itk/clitkResampleImageWithOptionsFilter.txx +++ b/itk/clitkResampleImageWithOptionsFilter.txx @@ -41,7 +41,7 @@ namespace clitk { ResampleImageWithOptionsFilter():itk::ImageToImageFilter() { static const unsigned int dim = InputImageType::ImageDimension; this->SetNumberOfRequiredInputs(1); - m_IsoSpacing = -1; + m_OutputIsoSpacing = -1; m_InterpolationType = NearestNeighbor; m_GaussianFilteringEnabled = true; m_BSplineOrder = 3; @@ -115,9 +115,9 @@ namespace clitk { InputImageSpacingType inputSpacing = input->GetSpacing(); InputImageSizeType inputSize = input->GetLargestPossibleRegion().GetSize(); - if (m_IsoSpacing != -1) { // apply isoSpacing + if (m_OutputIsoSpacing != -1) { // apply isoSpacing for(unsigned int i=0; iGetLargestPossibleRegion().GetIndex()); + DD(input->GetLargestPossibleRegion().GetIndex()); outputImage->SetLargestPossibleRegion(region); + outputImage->SetSpacing(m_OutputSpacing); // Init Gaussian sigma if (m_GaussianSigma[0] != -1) { // Gaussian filter set by user @@ -189,6 +191,9 @@ namespace clitk { typedef itk::ResampleImageFilter FilterType; typename FilterType::Pointer filter = FilterType::New(); filter->GraftOutput(this->GetOutput()); +// this->GetOutput()->Print(std::cout); +// this->GetOutput()->SetBufferedRegion(this->GetOutput()->GetLargestPossibleRegion()); +// this->GetOutput()->Print(std::cout); // Print options if needed if (m_VerboseOptions) { @@ -282,7 +287,9 @@ namespace clitk { filter->Update(); // Set output + // DD("before Graft"); this->GraftOutput(filter->GetOutput()); + // DD("after Graft"); } //-------------------------------------------------------------------- -- 2.47.1