[vtkusers] again DICOM, how to read the data?

Peter F Bradshaw pfb at exadios.com
Mon Sep 10 10:02:27 EDT 2007


Hi Mauro;

On Mon, 10 Sep 2007, mauro maiorca wrote:

> Hi all,
> I got a problem trying to read my DICOMs using vtkDICOMImageReader,
> but it seems unable to read the images!
> I.e. the code:
>
> vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
> reader->SetDirectoryName("/home/mauro/data/patient1");
> reader->SetFileName("im0021.dcm");
> reader->Update();
> //vtkImageData *tmpImage = vtkImageData::New();
> //tmpImage = reader->GetOutput();

What are you trying to do here? You have assigned tmpImage to a
vtkImageSource object and straight away you throw that away. I can
predict that the tmpImage->Delete() below will give you a seg fault.

> printf ("width:%d  Height:%d\n", reader->GetWidth (), reader->GetHeight() );
> reader->Delete();
> //tmpImage->Delete();
> return 0;
>
> it gives:
> width:0  Height:0
>
> if I leave the comments out, it gives the following segmentation fault
> error message:
>
> "ERROR: In /home/mauro/source_packages/VTK/Filtering/vtkImageSource.cxx, line 73
> vtkDICOMImageReader (0x8059a78): Execute(): Method not defined.
> Segmentation fault (core dumped)"
>
> I don't have any clue, do you?
>
> cheers,
> Mauro

Cheers

-- 
Peter F Bradshaw: http://www.exadios.com (public keys avaliable there).
Personal site: http://personal.exadios.com
"I love truth, and the way the government still uses it occasionally to
 keep us guessing." - Sam Kekovich.



More information about the vtkusers mailing list