<html><div style='background-color:'><DIV class=RTE>Hai ,</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am using ITK and I have small problem in reading the DICOM file set. First I want to know wether there is any in built function in&nbsp; either Itk or Qt for reading the whole set of DICOM files and displaying one file after the other.</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>&nbsp;what I have done is intially i have selected one file then the image was loaded ,the next thing i have done is i have implemented two buttons one previous and one Next, file loading but when i click these buttons I am getting a message that the loading image was sucessfull , But &nbsp;the Image is not getting updated.</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>I am very new to Itk so please some body help me out .</DIV>
<DIV class=RTE>the code was already exists in Itk applications&nbsp; and i have made small changes and the changes are shown below .</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>the code in Qtslicer.cxx</DIV>
<DIV class=RTE>(it is for the process to be done when clicked on "previous" button the files are named as "0001.dcm"..........."0035.dcm"&nbsp;......."0120.dcm".)</DIV>
<DIV class=RTE>void QtSlicer::PreImage()<BR>{<BR>&nbsp;<BR>&nbsp;QString tmp=leImage-&gt;text();<BR>&nbsp;string temp = tmp.latin1();<BR>&nbsp;string k(temp,0,temp.size()-8);<BR>&nbsp;int i=sBimageno-&gt;value();<BR>&nbsp;i=i-1;<BR>&nbsp;//QtSlicer mGUi( 0, 0, TRUE );<BR>&nbsp;<BR>&nbsp; <BR>&nbsp;<BR>&nbsp;ReaderType::Pointer reader1 = ReaderType::New();<BR>&nbsp;char num[4];<BR>&nbsp;<BR>&nbsp;if(i&gt;=1 &amp;&amp; i&lt;10)<BR>&nbsp;{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;if (i&lt;=1)&nbsp;pBprevious-&gt;setProperty("enabled",QVariant(false));<BR>&nbsp;&nbsp;_itoa(i,num,10);<BR>&nbsp;&nbsp;k+="000";<BR>&nbsp;&nbsp;k+=num;<BR>&nbsp;&nbsp;k+=".dcm";<BR>&nbsp;}<BR>&nbsp;else if(i&lt;100)<BR>&nbsp;{<BR>&nbsp;&nbsp;_itoa(i,num,10);<BR>&nbsp;&nbsp;k+="00";<BR>&nbsp;&nbsp;k+=num;<BR>&nbsp;&nbsp;k+=".dcm";<BR>&nbsp;}<BR>&nbsp;else if(i&lt;1000)<BR>&nbsp;{<BR>&nbsp;&nbsp;_itoa(i,num,10);<BR>&nbsp;&nbsp;k+="0";<BR>&nbsp;&nbsp;k+=num;<BR>&nbsp;&nbsp;k+=".dcm";<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;reader1-&gt;SetFileName( k.c_str());<BR>&nbsp;std::cout &lt;&lt; "loading image " &lt;&lt; k&lt;&lt;" ... ";<BR>&nbsp;<BR>&nbsp;reader1-&gt;Update();<BR>&nbsp;<BR>&nbsp;&nbsp;std::cout &lt;&lt; "Done!" &lt;&lt; std::endl;<BR>&nbsp;QtSlicer::SetInputImage( reader1-&gt;GetOutput() );<BR>&nbsp;ImageType::Pointer Image = reader1-&gt;GetOutput();<BR>&nbsp;sBimageno-&gt;setValue(i);<BR>}</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>the code in QtslicerTest.cxx</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>int main( int argc, char* argv[] ) <BR>{<BR>&nbsp; string QtoC;</DIV>
<DIV class=RTE>&nbsp; QApplication myApp( argc, argv );</DIV>
<DIV class=RTE>&nbsp; QtSlicer m_GUI( 0, 0, TRUE );<BR>&nbsp; myApp.setMainWidget(&amp;m_GUI);</DIV>
<DIV class=RTE>&nbsp; m_GUI.setCaption( "Insight Qt Slicer" );<BR>&nbsp; myApp.setStyle( new QPlatinumStyle );<BR>&nbsp; QPalette p( QColor( 239, 239, 239 ) );<BR>&nbsp; myApp.setPalette( p, TRUE );</DIV>
<DIV class=RTE>&nbsp; typedef double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PixelType;<BR>&nbsp; typedef itk::Image&lt;PixelType, 3&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageType;<BR>&nbsp; typedef itk::ImageFileReader&lt;ImageType&gt;&nbsp;&nbsp; ReaderType;</DIV>
<DIV class=RTE>&nbsp; ReaderType::Pointer reader = ReaderType::New();<BR>&nbsp; <BR>&nbsp; QString s = QFileDialog::getExistingDirectory("/home",0,"get existing directory","Choose a directory",TRUE );<BR>&nbsp; QtoC=s.latin1();<BR>&nbsp; QtoC=QtoC+"/0024.dcm";<BR>&nbsp; s=QtoC;<BR>&nbsp; m_GUI.leImage-&gt;setText(s);</DIV>
<DIV class=RTE>&nbsp; reader-&gt;SetFileName( QtoC.c_str());<BR>&nbsp; std::cout &lt;&lt; "loading image " &lt;&lt; QtoC.c_str() &lt;&lt; " ... ";<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; reader-&gt;Update();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; catch (itk::ExceptionObject &amp; e)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Exception in file reader " &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; e &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp; std::cout &lt;&lt; "Done!" &lt;&lt; std::endl;<BR>&nbsp; m_GUI.SetInputImage( reader-&gt;GetOutput() );<BR>&nbsp; <BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; m_GUI.exec();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; catch (itk::ExceptionObject &amp; e)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Exception during GUI execution" &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; e &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp; return 0;</DIV>
<DIV class=RTE>}<BR></DIV></div><br clear=all><hr>Expressions unlimited! The all new MSN Messenger! <a href="http://g.msn.com/8HMAENIN/2752??PS=47575">Change the way you communicate!</a> </html>