[vtkusers] the use of vtkDicomImageReader.

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Fri Nov 7 04:03:13 EST 2003


Yasser,

	[Thanks for changing your ML adress ;)]

	Here is a simple C++ code(*) that use SetDirectoryName(). I suggest you 
use a tool like 'DicomWorks'(**) to sort the file in directories & 
subdir like this:

DICOMDIR/
	/study
		/serie

Then all you have to do is choose a *serie* dir (and not the top dir or 
the study dir).
Also please note that you should remove all 'README' files, only pure 
DICOM files, otherwise it's not sure to works.

HTH
mathieu


(*)
//---------------------------------------------------
#include "vtkDICOMImageReader.h"
#include "vtkImageData.h"
#include "vtkStructuredPointsWriter.h"

int main()
{
   vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
   //reader->SetFileName( "foo.dcm" );
   reader->SetDirectoryName( "/mnt/esavoir/DICOM/Phantom/Phantom6/" );
   reader->SetDirectoryName( 
"/DICOM/1.3.46.670589.5.2.14.2198403904.1065781852.599073/1.3.46.670589.5.2.14.2198403904.1065782189.293302/");
   reader->Update();

   //reader->GetOutput()->Print( std::cout );

   vtkStructuredPointsWriter *writer = vtkStructuredPointsWriter::New();
   writer->SetInput( reader->GetOutput() );
   writer->SetFileName( "yasser.vtk" );
   writer->Write();

   return 0;
}
//---------------------------------------------------


(**)
http://www.dicomworks.com/




More information about the vtkusers mailing list