Hi;<br>
<br>
See the Insight Applications ImageSliceViewer class.<br><br><div><span class="gmail_quote">2005/11/16, Yan Yang &lt;<a href="mailto:y.yang@apu.ac.uk">y.yang@apu.ac.uk</a>&gt;:</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">&nbsp;Dear all,</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</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>&nbsp;</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&nbsp;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>&nbsp;</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>&nbsp;</div>
<div><font face="Arial" size="2">Kind regards,</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">Yan</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">//-------------------------------------------------------------------------------------------------------------------------------------------------</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">&nbsp;for(i=0; i&lt;inputRegion.GetSize()[1]; 
i++)<br>&nbsp;{<br>&nbsp;&nbsp;inputStart[1] = 
i;<br>&nbsp;&nbsp;desiredRegion.SetIndex( 
inputStart);<br>&nbsp;&nbsp;extractFilter-&gt;SetExtractionRegion( desiredRegion 
);<br>&nbsp;&nbsp;resampleSliceFilter-&gt;SetInput( 
extractFilter-&gt;GetOutput() 
);<br>&nbsp;&nbsp;resampleSliceFilter-&gt;Update();<br>&nbsp;&nbsp;extractFilter-&gt;Update();<br>&nbsp;&nbsp;sprintf(axialFilename, 
&quot;..\\Results\\checkerboard\\Axial\\Axial%03d.png&quot;, 
inputStart[1]+1);<br>&nbsp;&nbsp;seriesWriter-&gt;SetInput( 
resampleSliceFilter-&gt;GetOutput() );&nbsp;&nbsp;&nbsp;// if this line is 
subtituted by &quot;seriesWriter-&gt;SetInput( extractFilter-&gt;GetOutput() );&quot;, it 
works.<br>&nbsp;&nbsp;seriesWriter-&gt;SetFileName( axialFilename 
);</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">&nbsp;&nbsp;try<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;seriesWriter-&gt;Update();<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;catch( 
itk::ExceptionObject &amp; err )<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;std::cout 
&lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; 
std::endl;<br>&nbsp;&nbsp;&nbsp;std::cout &lt;&lt; err &lt;&lt; 
std::endl;<br>&nbsp;&nbsp;}<br>&nbsp;}</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