[Insight-users] Resampling images
Yan Yang
y.yang at apu.ac.uk
Wed Nov 16 13:58:26 EST 2005
Dear all,
I have got a problem with resampling images, I am using ITK2.2.0.
I have got a 3D data (slices based on coronal orientation) with space (1, 1, 5), I am trying to crop the 3D data in a series of 2D slices in other orientations, axial and sagittal, so I have to resample the image with a space (1,5) into (1,1) to display in png format. The extract filter from 3D to 2D works well, I can get correct images without resampling, but I can only get blank images when resampling the output images of the extract filter to the the physical space.
I would be very grateful if anyone can help me solve the problem.
Kind regards,
Yan
//-------------------------------------------------------------------------------------------------------------------------------------------------
for(i=0; i<inputRegion.GetSize()[1]; i++)
{
inputStart[1] = i;
desiredRegion.SetIndex( inputStart);
extractFilter->SetExtractionRegion( desiredRegion );
resampleSliceFilter->SetInput( extractFilter->GetOutput() );
resampleSliceFilter->Update();
extractFilter->Update();
sprintf(axialFilename, "..\\Results\\checkerboard\\Axial\\Axial%03d.png", inputStart[1]+1);
seriesWriter->SetInput( resampleSliceFilter->GetOutput() ); // if this line is subtituted by "seriesWriter->SetInput( extractFilter->GetOutput() );", it works.
seriesWriter->SetFileName( axialFilename );
try
{
seriesWriter->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051116/cbccc156/attachment.htm
More information about the Insight-users
mailing list