[Insight-users] Writting DICOM Images

Miller, James V (Research) millerjv at crd.ge.com
Wed May 18 09:28:16 EDT 2005


Most DICOM application have a set of required fields that have to be
specified in the DICOM file.  Unfortunately, each application has a 
different set of tags that have to be specified.

We have used GDCMImageIO to create DICOM images from scratch (without
reading a DICOM image).  To do this, you need to specify a number of
DICOM tags in the MetaDataDictionary on the input to the writer.
This requires a good bit of understanding of what is needed for 
a proper DICOM file for the particular modality (CT, MR, etc) that 
you are using.

We could add an example that builds a DICOM image from scratch
that has the necessary tags for many DICOM readers.

Jim



-----Original Message-----
From: insight-users-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-users-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of
Rodolfo Palacios
Sent: Tuesday, May 17, 2005 8:31 PM
To: insight-users at itk.org
Subject: [Insight-users] Writting DICOM Images


Hi everyone,

I really hope you can help me on this one:

I'm reading a series of dicom files using itkGDCMImageIO.
Then I pass the resulting images to VTK to do some processing using the 
ConnectPipelines template.
Then I return one slice of the volume to ITK to write to a dicom file again 
using itkGDCMImageIO.

The problem is that I can't read the images I wrote using the process 
described above (the program crashes). VolView can open the images but still 
a vtkOutputWindow opens telling me that some required elements are missing 
(vtkDICOMCollector).

Do I need to specify some extra parameters to the writer? Add some extra 
information to the header maybe? I've checked the examples in the 
/Examples/IO directory but I can't find anything different.

In ITK's documentation I found that "Basically you always need a DICOM as 
input to write a proper DICOM image file". Does this mean that there is no 
way to write DICOM files after they've been processed?

Here's some of the code:

//read Images

gdcmNames->SetInputDirectory(directory.c_str());
reader->SetFileNames(gdcmNames->GetInputFileNames());
reader->SetImageIO(itk::GDCMImageIO::New());
reader->ReverseOrderOn();
reader->Update();
itkExporter->SetInput( reader->GetOutput() );
ConnectPipelines( itkExporter, vtkImporter );
vtkImporter->Update();

//do some processing with vtk

...

//write a slice to disk

plugin->vtkExporter->SetInput( reslice->GetOutput() );
ConnectPipelines( plugin->vtkExporter, plugin->itkImporter );
plugin->itkImporter->Update();

writer->SetFileName(fileName.c_str());
writer->SetInput(itkImporter->GetOutput());
writer->SetImageIO( imageIO );
writer->Update();

Thank you very much for your time.
Rodolfo Palacios.


_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list