<html><div style='background-color:'><DIV class=RTE>Hai ,</DIV>
<DIV class=RTE> 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 either Itk or Qt for reading the whole set of DICOM files and displaying one file after the other.</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> 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 the Image is not getting updated.</DIV>
<DIV class=RTE> </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 and i have made small changes and the changes are shown below .</DIV>
<DIV class=RTE> </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" ......."0120.dcm".)</DIV>
<DIV class=RTE>void QtSlicer::PreImage()<BR>{<BR> <BR> QString tmp=leImage->text();<BR> string temp = tmp.latin1();<BR> string k(temp,0,temp.size()-8);<BR> int i=sBimageno->value();<BR> i=i-1;<BR> //QtSlicer mGUi( 0, 0, TRUE );<BR> <BR> <BR> <BR> ReaderType::Pointer reader1 = ReaderType::New();<BR> char num[4];<BR> <BR> if(i>=1 && i<10)<BR> {<BR> <BR> if (i<=1) pBprevious->setProperty("enabled",QVariant(false));<BR> _itoa(i,num,10);<BR> k+="000";<BR> k+=num;<BR> k+=".dcm";<BR> }<BR> else if(i<100)<BR> {<BR> _itoa(i,num,10);<BR> k+="00";<BR> k+=num;<BR> k+=".dcm";<BR> }<BR> else if(i<1000)<BR> {<BR> _itoa(i,num,10);<BR> k+="0";<BR> k+=num;<BR> k+=".dcm";<BR> }<BR> <BR> reader1->SetFileName( k.c_str());<BR> std::cout << "loading image " << k<<" ... ";<BR> <BR> reader1->Update();<BR> <BR> std::cout << "Done!" << std::endl;<BR> QtSlicer::SetInputImage( reader1->GetOutput() );<BR> ImageType::Pointer Image = reader1->GetOutput();<BR> sBimageno->setValue(i);<BR>}</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>the code in QtslicerTest.cxx</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>int main( int argc, char* argv[] ) <BR>{<BR> string QtoC;</DIV>
<DIV class=RTE> QApplication myApp( argc, argv );</DIV>
<DIV class=RTE> QtSlicer m_GUI( 0, 0, TRUE );<BR> myApp.setMainWidget(&m_GUI);</DIV>
<DIV class=RTE> m_GUI.setCaption( "Insight Qt Slicer" );<BR> myApp.setStyle( new QPlatinumStyle );<BR> QPalette p( QColor( 239, 239, 239 ) );<BR> myApp.setPalette( p, TRUE );</DIV>
<DIV class=RTE> typedef double PixelType;<BR> typedef itk::Image<PixelType, 3> ImageType;<BR> typedef itk::ImageFileReader<ImageType> ReaderType;</DIV>
<DIV class=RTE> ReaderType::Pointer reader = ReaderType::New();<BR> <BR> QString s = QFileDialog::getExistingDirectory("/home",0,"get existing directory","Choose a directory",TRUE );<BR> QtoC=s.latin1();<BR> QtoC=QtoC+"/0024.dcm";<BR> s=QtoC;<BR> m_GUI.leImage->setText(s);</DIV>
<DIV class=RTE> reader->SetFileName( QtoC.c_str());<BR> std::cout << "loading image " << QtoC.c_str() << " ... ";<BR> try<BR> {<BR> reader->Update();<BR> }<BR> catch (itk::ExceptionObject & e)<BR> {<BR> std::cerr << "Exception in file reader " << std::endl;<BR> std::cerr << e << std::endl;<BR> return EXIT_FAILURE;<BR> }<BR> <BR> std::cout << "Done!" << std::endl;<BR> m_GUI.SetInputImage( reader->GetOutput() );<BR> <BR> try<BR> {<BR> m_GUI.exec();<BR> }<BR> catch (itk::ExceptionObject & e)<BR> {<BR> std::cerr << "Exception during GUI execution" << std::endl;<BR> std::cerr << e << std::endl;<BR> return EXIT_FAILURE;<BR> }<BR> <BR> 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>