Hi I have so problem with dicom series read...<br><br>I have this code for reading... I used this from \Examples\IO\DicomSeriesReadSeriesWrite.cxx<br><br> typedef unsigned char /*signed short*/ PixelType;<br> const unsigned int InputDimension = 3;<br>
<br> typedef itk::Image< PixelType, InputDimension > ImageType;<br> typedef itk::ImageSeriesReader< ImageType > ReaderType;<br><br> typedef itk::GDCMImageIO ImageIOType;<br>
typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br><br> ImageIOType::Pointer gdcmIO = ImageIOType::New();<br> NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New();<br><br> size_t found = path.find_last_of("/\\");<br>
std::string str = path.substr(0,found);<br><br> namesGenerator->SetInputDirectory( str.c_str() );<br> const ReaderType::FileNamesContainer & filenames = namesGenerator->GetInputFileNames();<br><br> ReaderType::Pointer reader = ReaderType::New();<br>
reader->SetImageIO( gdcmIO );<br> reader->SetFileNames( filenames );<br><br> try<br> {<br> reader->Update();<br> }<br> catch (itk::ExceptionObject &e)<br> {<br> cerr << e << endl;<br>
return;<br> }<br><br> typedef unsigned char /*signed short*/ /*float*/ PixelType2;<br> const unsigned int OutputDimension = 3;<br> typedef itk::Image< PixelType2, OutputDimension > OutputImageType;<br>
<br><br><br> typedef itk::ImageToVTKImageFilter< OutputImageType > ConnectorType;<br><br><br> ConnectorType::Pointer connector = ConnectorType::New();<br><br> connector->SetInput(reader->GetOutput());<br>
// ... continue and display image in QvtkWidget<br><br>but when I am trying load dicom series I get this<br><br>WARNING: In ..\..\..\..\src\Insight\Code\IO\itkGDCMImageIO.cxx, line 348<br>GDCMImageIO (02B4A198): The DICOM file: C:/InsightApplications-3.20.0/src/muj_test4/Release/neco2/image004.dcm does not have a preamble.<br>
<br>Could someone help me please?<br>Thanks a lot<br>