[vtkusers] vtkDICOMImageReader broken in vtk 5.0 and up?
Ben Fulton
bfulton at prosolv.com
Wed Mar 22 10:31:18 EST 2006
Thanks, I'll take a look at those. Two slices = 25MB and I doubt my mail
server will accept that, but I can tell you that the crash is at line 930 of
dicomapphelper.cxx. ImageData is allocated for the first slice, but the
code that flips the data in vtkDICOMImageReader::ExecuteData trashes that
memory, and when the second slice is being read the delete for ImageData
fails. (Since the crash occurs inside reader->Update() I can't check the
dimensions after that point.)
-----Original Message-----
From: Mathieu Malaterre [mailto:mathieu.malaterre at kitware.com]
Sent: Tuesday, March 21, 2006 10:52 AM
To: Ben Fulton
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkDICOMImageReader broken in vtk 5.0 and up?
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