[Insight-users] re:resampling a binary image...
Yixun Liu
yxliu at fudan.edu.cn
Wed Aug 23 20:39:12 EDT 2006
Hi,
You can do it as follow,
this->resampler->SetInput(this->inImage);
this->transform->SetIdentity();
this->resampler->SetTransform(this->transform);
//Note that the interpolator is NearestNeighborInterpolateImageFunction
this->resampler->SetInterpolator(this->interpolator);
this->resampler->SetOutputOrigin(this->inImage->GetOrigin());
this->resampler->SetDefaultPixelValue( 0 );
this->resampler->SetOutputSpacing( spacing );//resampled spacing 1.25x1.0x1.0
this->resampler->SetSize( size );//resampled size 160x256x256
//if the resampled size is change you need to use this->UpdateLargestPossibleRegion()
this->Update();
Regards,
Yixun Liu
Hello,
I have a 3D binary image of size 80x128x128 and spacing 0.5x0.5x0.5mm. I need to resample the image to get size 160x256x256 with spacing 1.25x1.0x1.0. Does somebody know how to go about it? Appreciate it.
Shahab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060824/5461a929/attachment.htm
More information about the Insight-users
mailing list