[vtkusers] DICOM Images: vtkDicomReader & vtkGdcmReader

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Oct 8 11:44:26 EDT 2009


On Thu, Oct 8, 2009 at 5:30 PM, Michael Lynch <mick.lynch at gmail.com> wrote:
> hey there,
> I have a series of DICOM images on my system. I have the names stored in
> vtkStringArray. I want to display the images as a volume and have tried two
> different methods.
> 1. I looked into vtkDicomReader. And actually, if I try to open and view a
> single dicom then vtkDicomReader works perfectly. However, it was not able
> to open a series of images if I passed it the vtkStringArray. I first
> checked if the individual DICOM files were readable using CanReadFile...the
> results were positive for all files in the string array. Below is the error
> I got.
> error message:
> vtkDICOMImageReader.cxx, line 256
> vtkDICOMImageReader (0xd043180): Either a filename was not specified or the
> specified directory does not contain any DICOM images.
> I thought perhaps vtkDicomReader was not able to open a series of images so
> I decided to migrate to vtkGdcmReader (which I heard was more powerful).
> 2. So I tried to read the file selection using vtkDicomReader. The result
> was a little more cryptic though. I get no error message when I build or run
> but the volume did not appear as it should. The series of images appear as
> just one image, perhaps it's a problem with image spacing? My main problem
> is that, even though I compiled GDCM in debug, qtcreator will not run in
> debug when I'm using vtkGdcmReader. Can anyone tell me what the problem is?
> I hope this is the right forum for this question. But I know this mailing
> list has a lot of expertise and a large responsive community...so I thought
> I'd post here.
> Thanks in advance,

You are using vtkGDCMImageReader right ? Not the old vtkGdcmReader
from gdcm 1.x ?

Just pass in the vtkStringArray:

http://gdcm.sourceforge.net/html/classvtkGDCMImageReader.html#051e8ec877c64032750d1b628be247ca

The list of file will NOT be reordered automatically, you need to
explicitely ask for reordering:

http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames

HTH
-- 
Mathieu



More information about the vtkusers mailing list