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