Thanks a lot... :) It works<br><br><div class="gmail_quote">2011/3/29 Abayiz <span dir="ltr">&lt;<a href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hi,<br><br>For try the following partial code for reading your dicom series: <br>*********************************************************************<br>
 typedef signed short    PixelType;<br>  const unsigned int      Dimension = 3;<br>  typedef itk::OrientedImage&lt; PixelType, Dimension &gt;         ImageType;<div class="im"><br>typedef itk::ImageSeriesReader&lt; ImageType &gt;        ReaderType;<br>
</div><div class="im">  ReaderType::Pointer reader = ReaderType::New();<br></div> typedef itk::GDCMImageIO       ImageIOType;<br>  ImageIOType::Pointer dicomIO = ImageIOType::New();    <br>  reader-&gt;SetImageIO( dicomIO );<br>
  typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br> 
 NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<br>  nameGenerator-&gt;SetUseSeriesDetails( true );<br>  nameGenerator-&gt;AddSeriesRestriction(&quot;0008|0021&quot; );  <br>  nameGenerator-&gt;SetDirectory( argv[1] );<br>
  try<br>    {<br>    <br>    typedef std::vector&lt; std::string &gt;    SeriesIdContainer;    <br>    const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();   <br>    SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
    SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br>    while( seriesItr != seriesEnd )<br>      {<br>      std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; std::endl;<br>     
 seriesItr++;<br>    }<br>    std::string seriesIdentifier;<br>    if( argc &gt; 3 ) <br>      {<br>      seriesIdentifier = argv[3];<br>      }<br>    else<br>      {<br>      seriesIdentifier = seriesUID.begin()-&gt;c_str();<br>
           }<br>   <br>    typedef std::vector&lt; std::string &gt;   FileNamesContainer;<br>    FileNamesContainer fileNames; <br>    fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier ); <br>    reader-&gt;SetFileNames( fileNames );<br>
   try<br>     {<br>     reader-&gt;Update();<br>     }<br>   catch (itk::ExceptionObject
 &amp;ex)<br>     {<br>      std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>      return EXIT_FAILURE;<br>     }<br><br>      }<br><br>  catch (itk::ExceptionObject &amp;ex)<br>    {<br>    std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>
    return EXIT_FAILURE;<br>    }<br><br>--- On <b>Tue, 3/29/11, G G <i>&lt;<a href="mailto:greenlander1986@gmail.com" target="_blank">greenlander1986@gmail.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px">
<br>From: G G &lt;<a href="mailto:greenlander1986@gmail.com" target="_blank">greenlander1986@gmail.com</a>&gt;<br>Subject: Re: [Insight-users] dicom series read<br>To: &quot;John Drescher&quot; &lt;<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;<br>
Cc: &quot;insight-users&quot; &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br>Date: Tuesday, March 29, 2011, 4:12 AM<div><div></div><div class="h5"><br><br><div>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>
2011/3/29 John Drescher <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;</span><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

<div><div></div><div>On Tue, Mar 29, 2011 at 3:21 AM, G G &lt;<a rel="nofollow" href="http://mc/compose?to=greenlander1986@gmail.com" target="_blank">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 rel="nofollow" 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>
</div><br></div></div>-----Inline Attachment Follows-----<br><br><div>_____________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></blockquote></td></tr></tbody></table><br>







      </blockquote></div><br>