[Insight-users] Writting DICOM Images
Rodolfo Palacios
rpalacios75 at hotmail.com
Tue May 17 20:31:25 EDT 2005
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.
More information about the Insight-users
mailing list