[Insight-users] Resample Filter

Njiwa njiwa at creatis.insa-lyon.fr
Thu Mar 27 07:54:41 EDT 2008


Hi every body,

I would like to use the transform parameters computed via the 
registration framework called IterativeClosestPoint to apply on the 
moving image and then write this image into a file. After getting the 
transform, i used a resaple filter and then a writer. I could not write 
the file properly and have an error message after execution which is: 
Error while writting Slice to file
Reason: Domain error

These are my code lines:

transform->SetParameters(
       registration->GetLastTransformParameter() );
resample->SetTransform(tranform);
resample->SetInput(movingImageReader->GetOutput);
resample->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resample->SetOutputOrigin(fixedImage->GetOrigin);
resample->SetOutputSpacing(fixedImage->GetSpacing);
resample->SetDefaultPixelValue(100);

typedef itk:ImageFileWriter<ImageType>WriterFixedType;
WriterFixedType::Pointer  writer =WriterFixedType::New();
writer->SetFilename(argv[6]);
writer->SetInput(resample->GetOutput());

Should somebody helps me to solve this problem?
Thanks a lot,

Josiane.


More information about the Insight-users mailing list