<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Dear ALL</span></div><div><span><br></span></div><div><span>I am new to ITK and I am trying to read dicom series to ITK volume but the program usually crash at reader->update</span></div><div><span>I could not understand what is wrong</span></div><div><span>any advice is more than welcome</span></div><div><span><br></span></div><div><span><br></span></div><div><span><div>class BoneSegment</div><div>{</div><div>public:</div><div> BoneSegment();</div><div> void readDirectory(QString dirName);</div><div> vtkImageData* getImageData()const;</div><div> typedef signed short PixelType;</div><div> typedef itk::Image< PixelType, 3 >ImageType;</div><div> typedef itk::ImageSeriesReader< ImageType >
ReaderType;</div><div> ReaderType::Pointer reader;</div><div> typedef itk::GDCMImageIO ImageIOType;</div><div> ImageIOType::Pointer dicomIO;</div><div> typedef itk::GDCMSeriesFileNames NamesGeneratorType;</div><div> NamesGeneratorType::Pointer nameGenerator;</div><div> typedef std::vector< std::string > SeriesIdContainer;</div><div> typedef std::vector< std::string > FileNamesContainer;</div><div> typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;</div><div>};</div><div>BoneSegment::BoneSegment(){</div><div><br></div><div>}</div><div><br></div><div>void BoneSegment::readDirectory(QString dirName){</div><div> reader = ReaderType::New();</div><div> dicomIO = ImageIOType::New();</div><div>
reader->SetImageIO( dicomIO );</div><div> nameGenerator = NamesGeneratorType::New();</div><div><br></div><div> nameGenerator->SetUseSeriesDetails( true );</div><div> nameGenerator->AddSeriesRestriction("0008|0021" );</div><div> nameGenerator->SetDirectory( dirName.toStdString().c_str());</div><div> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();</div><div> std::string seriesIdentifier;</div><div> seriesIdentifier = seriesUID.begin()->c_str();</div><div> FileNamesContainer fileNames;</div><div> fileNames = nameGenerator->GetFileNames( seriesIdentifier );</div><div> reader->SetFileNames( fileNames );</div><div> try</div><div> {</div><div> reader->Update();</div><div>
}</div><div> catch (itk::ExceptionObject &ex)</div><div> {</div><div> std::cout << ex << std::endl;</div><div> }</div><div><br></div><div>}</div><div><br></div><div>Best</div></span></div><div> </div><div>El-Hassan Mohamed <br>Biomedical engineering</div></div></body></html>