I think yes, I open this dicom series in ITK-SNAP without problems<br>When I use only \Examples\IO\DicomSeriesReadSeriesWrite.cxx<br>everything works fine, but when I use in my code it is wrong...<br><br><div class="gmail_quote">
2011/3/29 John Drescher <span dir="ltr"><<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Tue, Mar 29, 2011 at 3:21 AM, G G <<a href="mailto:greenlander1986@gmail.com">greenlander1986@gmail.com</a>> wrote:<br>
> Hi I have so problem with dicom series read...<br>
><br>
> I have this code for reading... I used this from<br>
> \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 =<br>
> 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*/<br>
> 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:<br>
> C:/InsightApplications-3.20.0/src/muj_test4/Release/neco2/image004.dcm does<br>
> not have a preamble.<br>
><br>
> Could someone help me please?<br>
> Thanks a lot<br>
><br>
<br>
</div></div>Does that file have 128 bytes before the DICM header?<br>
<br>
<a href="http://www.leadtools.com/SDK/medical/dicom-spec1.htm" target="_blank">http://www.leadtools.com/SDK/medical/dicom-spec1.htm</a><br>
<font color="#888888"><br>
John<br>
</font></blockquote></div><br>