[Insight-users] Resampling images

Diego Parada icebishop at gmail.com
Thu Nov 17 09:42:50 EST 2005


Hi;

See the Insight Applications ImageSliceViewer class.

2005/11/16, Yan Yang <y.yang at apu.ac.uk>:
>
>  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;
> }
> }
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>


--
Diego Armando Parada Cuervo
Estudiante de Ingeniería de Sistemas y Computación
Universidad Pedagógica y Tecnológica de Colombia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051117/0fb5bf11/attachment.html


More information about the Insight-users mailing list