<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span><br></span></div><div> Hi John</div><div><br></div><div>I built a UI system with QT and the creation of bonesegment class is carried by an action so i am sure that the path I sent to reader is correct I even tried the same path with vtkDicomReader and it works fine. </div><div>I also tried to make the path hardwired and it does not work. I am using itk 4.2</div><div><br></div><div>Please help this problem is driving me crazy</div><div>best</div><div>El-Hassan Mohamed <br>Biomedical engineering<br></div> <div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> John Drescher
<drescherjm@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Elhassan Abdou <hassan.abdou@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "insight-users@itk.org" <insight-users@itk.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 19, 2012 5:53 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] ITK DICOM series reading<br> </font> </div> <br>
> class BoneSegment<br>> {<br>> public:<br>> BoneSegment();<br>> void readDirectory(QString dirName);<br>> vtkImageData* getImageData()const;<br>> typedef signed short PixelType;<br>> typedef itk::Image< PixelType, 3 >ImageType;<br>> typedef itk::ImageSeriesReader< ImageType > ReaderType;<br>> ReaderType::Pointer reader;<br>> typedef itk::GDCMImageIO ImageIOType;<br>> ImageIOType::Pointer dicomIO;<br>> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br>> NamesGeneratorType::Pointer nameGenerator;<br>> typedef std::vector< std::string > SeriesIdContainer;<br>> typedef std::vector< std::string >
FileNamesContainer;<br>> typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;<br>> };<br>> BoneSegment::BoneSegment(){<br>><br>> }<br>><br>> void BoneSegment::readDirectory(QString dirName){<br>> reader = ReaderType::New();<br>> dicomIO = ImageIOType::New();<br>> reader->SetImageIO( dicomIO );<br>> nameGenerator = NamesGeneratorType::New();<br>><br>> nameGenerator->SetUseSeriesDetails( true );<br>> nameGenerator->AddSeriesRestriction("0008|0021" );<br>> nameGenerator->SetDirectory( dirName.toStdString().c_str());<br>> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();<br>> std::string seriesIdentifier;<br>> seriesIdentifier = seriesUID.begin()->c_str();<br>>
FileNamesContainer fileNames;<br>> fileNames = nameGenerator->GetFileNames( seriesIdentifier );<br>> reader->SetFileNames( fileNames );<br>> try<br>> {<br>> reader->Update();<br>> }<br>> catch (itk::ExceptionObject &ex)<br>> {<br>> std::cout << ex << std::endl;<br>> }<br>><br>> }<br>><br>> Best<br>><br><br>Are there any series found? The reader will not be happy if fileNames is empty.<br><br>John<br><br><br> </div> </div> </div></body></html>