[vtkusers] vtkDICOMImageReader broken in vtk 5.0 and up?

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue Mar 21 10:51:30 EST 2006


Ben,

	The code you are sending is correct. My guess is that 
vtkDICOMImageReader cannot deal with your DICOM datasets.

	Suggestions:
#1. Make sure to only have one Study/Series in your directory. E.g try 
reading only one slice at a time...
#2. After calling reader->Update() check the Image dimension (doing 
reader->GetOutput()->Print(std::cout), or using a debugger).
#3. Try using ITK(*) to load your data. itk uses GDCM(**) and is known 
to be more robust than vtkDICOMImageReader.
#4. Send me a copy of -at leat- one slice of your dataset, for inspection.

HTH
Mathieu
(*)http://www.itk.org
(**)http://www.creatis.insa-lyon.fr/Public/Gdcm/

Ben Fulton wrote:
> The bug appears to be in vtkDICOMImageReader::ExecuteData.  Apparently the
> buffer returned by data->GetScalarPointer() is not large enough to hold the
> copied image data when it is flipped, and the data in imgData is being
> overwritten.  Could someone explain how this buffer size is determined?
> 
> -----Original Message-----
> From: vtkusers-bounces+bfulton=prosolv.com at vtk.org
> [mailto:vtkusers-bounces+bfulton=prosolv.com at vtk.org] On Behalf Of Ben
> Fulton
> Sent: Monday, March 13, 2006 4:11 PM
> To: 'Mathieu Malaterre'; 'Sven Prevrhal'
> Cc: vtkusers at vtk.org
> Subject: RE: [vtkusers] vtkDICOMImageReader broken in vtk 5.0 and up?
> 
> 
> 
> Did anything come of this?  I'm trying to figure out how to use
> vtkDICOMImageReader now, and getting crashes as well.  I based my code on an
> old email from this list - maybe it's out of date now?
> 
> 
> int main()
> {
>    vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
>    vtkImageViewer2     *viewer = vtkImageViewer2::New();
> 
>    viewer->SetInput(reader->GetOutput());
>    reader->SetDirectoryName("C:\\VTK 5.0\\src\\sample\\study1");
>    reader->Update();
> 
>    int VolData_Images = viewer->GetSliceMax ();
> 
>    for (int i=0;i<=VolData_Images;i++)
>    {
>      viewer->SetSlice(i);
>      //for vtkImageViewer2 before r1.19
>      viewer->GetRenderer()->ResetCameraClippingRange();
>      viewer->Render();
>    }
>    reader->Delete();
>    viewer->Delete();
> 
>    return 0;
> }
> 
> 
> -----Original Message-----
> From: vtkusers-bounces+bfulton=prosolv.com at vtk.org
> [mailto:vtkusers-bounces+bfulton=prosolv.com at vtk.org] On Behalf Of Mathieu
> Malaterre
> Sent: Friday, March 10, 2006 3:49 PM
> To: Sven Prevrhal
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkDICOMImageReader broken in vtk 5.0 and up?
> 
> Sven Prevrhal wrote:
> 
>>I have DICOM images that vtk 4.4 will read just fine, but vtk 5.0 and up 
>>and nightly builds will crash.  (I built vtk with python 2.4). Anybody 
>>experiencing similar behavior?
> 
> 
> Can you send me a sample data to reproduce the problem ?
> 
> Thanks
> Mathieu
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list