[Insight-users] ResamplingFilter problem
Alessandro
notinmyhead at gmail.com
Tue Oct 2 06:37:01 EDT 2012
Hello,
I tried to Resample a 3d Slice Volume using a reference image. I wrote the following function (inside a class) to perform the task:
ImageVolumeType::Pointer VolumeRetriever::applyResamplingFromImage (ImageVolumeType::Pointer img, ImageVolumeType::Pointer ref) {
typedef itk::IdentityTransform<double, 3> TransformType;
typedef itk::ResampleImageFilter<ImageVolumeType, ImageVolumeType> ResampleImageFilterType;
ResampleImageFilterType::Pointer resample = ResampleImageFilterType::New();
resample->SetInput(img);
resample->UseReferenceImageOn();
resample->SetReferenceImage(ref);
resample->UpdateLargestPossibleRegion();
return resample->GetOutput();
}
where ImageVolumeType is typedef itk::Image< InputPixelType, 3 > ImageVolumeType;
Problem is: when I run it the return is a NULL pointer...
What am I missing?
Thanks,
Ale
More information about the Insight-users
mailing list