<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000;"><div>Hi luis,<br>yesterday i send a mail to know what's wrong on it since i had read the software kit&nbsp; . i change as i said before the installation. now i have itk 3.12 with visual studio 8 (2005) and cmake2.6.My system is windows xp.<br>all right,when i read the kit i find that if we need to give a dicom serie as input ,this will be possible if i use setFileName() method.<br>My questions are:<br>1.if i have a directory of dicom serie 2D or 3D how can i put him in the code.<br>2.as i understood, the argv[] is an array. what he will contain exactly?<br>3. if the reading is done. how can i know that is correct or false .in other words, the system must give me some indicaton or no if the reading is done.<br>4.where can i put the directory to have the image after writing
 it.<br><br>May be my questions are so stupid but those points are important to understand to can progress.i will send my code again and please can you indicate to me where is the error and where i must mention the input and out put directories.<br>Excuse-me again<br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br><br>#ifdef __BORLANDC__<br>#define ITK_LEAN_AND_MEAN<br>#endif<br><br><br>#include "itkOrientedImage.h"<br>#include "itkGDCMImageIO.h"<br>#include "itkGDCMSeriesFileNames.h"<br>#include "itkImageSeriesReader.h"<br>#include "itkImageFileWriter.h"<br>int main( int argc, char* argv[] )<br>{<br><br>&nbsp; if( argc &lt; 3 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "Usage: " &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; " DicomDirectory&nbsp; outputFileName&nbsp; [seriesName]" &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp;&nbsp;
 }<br><br>&nbsp; typedef signed short&nbsp;&nbsp;&nbsp; PixelType;<br>&nbsp; const unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension = 3;<br><br>&nbsp; typedef itk::OrientedImage&lt; PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageType;<br><br>&nbsp; typedef itk::ImageSeriesReader&lt; ImageType &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType;<br>&nbsp; ReaderType::Pointer reader = ReaderType::New();<br><br>&nbsp; typedef itk::GDCMImageIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageIOType;<br>&nbsp; ImageIOType::Pointer dicomIO = ImageIOType::New();<br>&nbsp; <br>&nbsp; reader-&gt;SetImageIO( dicomIO );<br><br>&nbsp; typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br>&nbsp; NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<br><br>&nbsp; nameGenerator-&gt;SetUseSeriesDetails( true );<br>&nbsp; nameGenerator-&gt;AddSeriesRestriction("0008|0021" );<br>&nbsp; //argv[1]="C:/Documents and
 Settings/Sirouna/Mes documents/Master/imgdicom/DICOM/09033118/07230000";<br>&nbsp; nameGenerator-&gt;SetDirectory( "C:/Documents and Settings/Sirouna/Mes documents/Master/imgdicom/DICOM/09033118/07230000" );<br> <br><br>&nbsp; try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; std::endl &lt;&lt; "The directory: " &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; std::endl &lt;&lt; argv[1] &lt;&lt; std::endl ;<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; "Contains the following DICOM Series: ";<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br><br><br>&nbsp;&nbsp;&nbsp; typedef std::vector&lt; std::string &gt;&nbsp;&nbsp;&nbsp; SeriesIdContainer;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>&nbsp;&nbsp;&nbsp;
 SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br>&nbsp;&nbsp;&nbsp; while( seriesItr != seriesEnd )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seriesItr++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; std::string seriesIdentifier;<br><br>&nbsp;&nbsp;&nbsp; if( argc &gt; 3 ) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seriesIdentifier = argv[3];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seriesIdentifier = seriesUID.begin()-&gt;c_str();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; "Now reading series: " &lt;&lt; std::endl &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt;
 seriesIdentifier &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br><br>&nbsp;&nbsp;&nbsp; typedef std::vector&lt; std::string &gt;&nbsp;&nbsp; FileNamesContainer;<br>&nbsp;&nbsp;&nbsp; FileNamesContainer fileNames;<br><br>&nbsp;&nbsp;&nbsp; fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );<br><br>&nbsp;&nbsp;&nbsp; reader-&gt;SetFileNames( "c:/ );<br><br>&nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader-&gt;Update();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; catch (itk::ExceptionObject &amp;ex)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br>}<br>&nbsp; catch (itk::ExceptionObject &amp;ex)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; ex &lt;&lt;
 std::endl;<br>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp;&nbsp; }<br><br><br>&nbsp; return EXIT_SUCCESS;<br><br>}<br>&nbsp;&nbsp;&nbsp; <br><br></div></div><br>



      </body></html>