[Insight-users] itkResampleImageFilter

Martin Urschler martin at urschler.info
Tue Jun 21 05:08:03 EDT 2005


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


More information about the Insight-users mailing list