[Insight-users] itkResampleImageFilter

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 21 09:11:59 EDT 2005


Hi Martin,

This is not an issue of the ResampleImageFilter;
instead, it relates to the Interpolator that you
choose to plug in it.

I couldn't find in your code the interpolator
that you use...

According to the description of the behavior that
you consider desirable, it seems that the Nearest
Neighbor interpolator is the class that you want.

For a full description of the interpolator available
in ITK, please refer to the ITK Software Guide:

    http://www.itk.org/ItkSoftwareGuide.pdf


Note that ... if none of the existing interpolators
fit your needs, you are always free to create your
own and plug it into the itk::ResampleImageFilter.


    Regards,


       Luis


-----------------------
Martin Urschler wrote:

> hi,
> 
> i have a remark concerning the resample image filter
> 
> suppose you have an image with voxel size 32x32x32
> the voxel spacing is quite large, i.e. 10 mm in each direction
> if I use the resampleImageFilter on this image with a translation that 
> is quite small compared to the voxel spacing
> (i.e. translation = <0.0, 0.0, -0.1>),
> then the entire first z slice is set to the default voxel value
> 
> IMHO this is not the best solution for small translations. I would think 
> that as long as you translate by at least -5mm (half of the voxel 
> spacing) in any direction, the interpolation should still lead to a 
> valid voxel value (get clamped to the edge value instead of being set to 
> the default value)
> 
> what do you think about that?
> 
> 
> 
> here is my code, the input data 'image' is a 32^3 data set with the 
> voxel spacing described above:
> 
> typedef itk::ResampleImageFilter<
>                             Int16ImageType,
>                             Int16ImageType >    ResampleFilterType;
> 
> typedef itk::VersorRigid3DTransform< double > TransformType; 
> TransformType::Pointer transform = TransformType::New();
> TransformType::OutputVectorType translation;
> translation[0] = 0.0;
> translation[1] = 0.0;
> translation[2] = -0.1;
> transform->SetTranslation( translation );
> 
> ResampleFilterType::Pointer resample = ResampleFilterType::New();
> 
> resample->SetInput( image );
> resample->SetTransform( transform );
> 
> resample->SetOutputParametersFromImage( image );
> resample->SetDefaultPixelValue( -1100 );
> 
> resample->Update();
> 
> 
> 
> thanks,
> Martin
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 





More information about the Insight-users mailing list