Hi;<br>
<br>
See the Insight Applications ImageSliceViewer class.<br><br><div><span class="gmail_quote">2005/11/16, Yan Yang <<a href="mailto:y.yang@apu.ac.uk">y.yang@apu.ac.uk</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><font face="Arial" size="2"> Dear all,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I have got a problem with resampling images, I am
using ITK2.2.0.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">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.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I would be very grateful if anyone can help me
solve the problem.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Kind regards,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Yan</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">//-------------------------------------------------------------------------------------------------------------------------------------------------</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"> for(i=0; i<inputRegion.GetSize()[1];
i++)<br> {<br> inputStart[1] =
i;<br> desiredRegion.SetIndex(
inputStart);<br> extractFilter->SetExtractionRegion( desiredRegion
);<br> resampleSliceFilter->SetInput(
extractFilter->GetOutput()
);<br> resampleSliceFilter->Update();<br> extractFilter->Update();<br> sprintf(axialFilename,
"..\\Results\\checkerboard\\Axial\\Axial%03d.png",
inputStart[1]+1);<br> seriesWriter->SetInput(
resampleSliceFilter->GetOutput() ); // if this line is
subtituted by "seriesWriter->SetInput( extractFilter->GetOutput() );", it
works.<br> seriesWriter->SetFileName( axialFilename
);</font></div>
<div> </div>
<div><font face="Arial" size="2"> try<br> {<br> seriesWriter->Update();<br> }<br> catch(
itk::ExceptionObject & err )<br> {<br> std::cout
<< "ExceptionObject caught !" <<
std::endl;<br> std::cout << err <<
std::endl;<br> }<br> }</font></div>
<br>_______________________________________________<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Diego Armando Parada Cuervo<br>Estudiante de Ingeniería de Sistemas y Computación<br>Universidad Pedagógica y Tecnológica de Colombia