<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 . 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> if( argc < 3 )<br> {<br> std::cerr << "Usage: " << std::endl;<br> std::cerr << argv[0] << " DicomDirectory outputFileName [seriesName]" << std::endl;<br> return EXIT_FAILURE;<br>
}<br><br> typedef signed short PixelType;<br> const unsigned int Dimension = 3;<br><br> typedef itk::OrientedImage< PixelType, Dimension > ImageType;<br><br> typedef itk::ImageSeriesReader< ImageType > ReaderType;<br> ReaderType::Pointer reader = ReaderType::New();<br><br> typedef itk::GDCMImageIO ImageIOType;<br> ImageIOType::Pointer dicomIO = ImageIOType::New();<br> <br> reader->SetImageIO( dicomIO );<br><br> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<br><br> nameGenerator->SetUseSeriesDetails( true );<br> nameGenerator->AddSeriesRestriction("0008|0021" );<br> //argv[1]="C:/Documents and
Settings/Sirouna/Mes documents/Master/imgdicom/DICOM/09033118/07230000";<br> nameGenerator->SetDirectory( "C:/Documents and Settings/Sirouna/Mes documents/Master/imgdicom/DICOM/09033118/07230000" );<br> <br><br> try<br> {<br> std::cout << std::endl << "The directory: " << std::endl;<br> std::cout << std::endl << argv[1] << std::endl ;<br> std::cout << "Contains the following DICOM Series: ";<br> std::cout << std::endl << std::endl;<br><br><br> typedef std::vector< std::string > SeriesIdContainer;<br> <br> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();<br> <br> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br> while( seriesItr != seriesEnd )<br> {<br> std::cout << seriesItr->c_str() << std::endl;<br> seriesItr++;<br> }<br><br> std::string seriesIdentifier;<br><br> if( argc > 3 ) <br> {<br> seriesIdentifier = argv[3];<br> }<br> else<br> {<br> seriesIdentifier = seriesUID.begin()->c_str();<br> }<br><br> std::cout << std::endl << std::endl;<br> std::cout << "Now reading series: " << std::endl << std::endl;<br> std::cout <<
seriesIdentifier << std::endl;<br> std::cout << std::endl << std::endl;<br><br> typedef std::vector< std::string > FileNamesContainer;<br> FileNamesContainer fileNames;<br><br> fileNames = nameGenerator->GetFileNames( seriesIdentifier );<br><br> reader->SetFileNames( "c:/ );<br><br> try<br> {<br> reader->Update();<br> }<br> catch (itk::ExceptionObject &ex)<br> {<br> std::cout << ex << std::endl;<br> return EXIT_FAILURE;<br> }<br><br><br>}<br> catch (itk::ExceptionObject &ex)<br> {<br> std::cout << ex <<
std::endl;<br> return EXIT_FAILURE;<br> }<br><br><br> return EXIT_SUCCESS;<br><br>}<br> <br><br></div></div><br>
</body></html>