X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkResampleImageWithOptionsFilter.txx;h=aa09f7129812ce2cc3065e85925d5d09faac173f;hb=e5668c0a55ca5387e61292f93b8517d723a06f84;hp=993b7ec85abc8199c6d2822133a6c4fe96fc1202;hpb=25f2ec51914dc5a55443c223bc52ca8c234fe100;p=clitk.git diff --git a/itk/clitkResampleImageWithOptionsFilter.txx b/itk/clitkResampleImageWithOptionsFilter.txx index 993b7ec..aa09f71 100644 --- a/itk/clitkResampleImageWithOptionsFilter.txx +++ b/itk/clitkResampleImageWithOptionsFilter.txx @@ -28,6 +28,7 @@ #include "itkResampleImageFilter.h" #include "itkAffineTransform.h" #include "itkNearestNeighborInterpolateImageFunction.h" +#include "itkWindowedSincInterpolateImageFunction.h" #include "itkLinearInterpolateImageFunction.h" #include "itkBSplineInterpolateImageFunction.h" #include "itkBSplineInterpolateImageFunctionWithLUT.h" @@ -188,8 +189,8 @@ GenerateData() static const unsigned int dim = InputImageType::ImageDimension; // Set regions and allocate - this->GetOutput()->SetRegions(m_OutputRegion); - this->GetOutput()->Allocate(); + //this->GetOutput()->SetRegions(m_OutputRegion); + //this->GetOutput()->Allocate(); // this->GetOutput()->FillBuffer(m_DefaultPixelValue); // Create main Resample Image Filter @@ -213,6 +214,7 @@ GenerateData() case Linear: std::cout << "Linear" << std::endl; break; case BSpline: std::cout << "BSpline " << m_BSplineOrder << std::endl; break; case B_LUT: std::cout << "B-LUT " << m_BSplineOrder << " " << m_BLUTSamplingFactor << std::endl; break; + case WSINC: std::cout << "Windowed Sinc" << std::endl; break; } std::cout << "Threads = " << this->GetNumberOfThreads() << std::endl; std::cout << "LastDimIsTime = " << m_LastDimensionIsTime << std::endl; @@ -257,6 +259,12 @@ GenerateData() filter->SetInterpolator(interpolator); break; } + case WSINC: { + typedef itk::WindowedSincInterpolateImageFunction InterpolatorType; + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + filter->SetInterpolator(interpolator); + break; + } } // Initial Gaussian blurring if needed @@ -288,7 +296,10 @@ GenerateData() // Set output // DD("before Graft"); - this->GraftOutput(filter->GetOutput()); + + //this->GraftOutput(filter->GetOutput()); + this->SetNthOutput(0, filter->GetOutput()); + // DD("after Graft"); } //--------------------------------------------------------------------