[vtkusers] : DICOM Image with wrong orientation

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Jun 9 09:28:59 EDT 2008


Ben,

On Sat, Jun 7, 2008 at 6:04 PM, ben said tarek <tarekbensaid at gmail.com> wrote:
> Hi,
> I have a problem with the orientation of DICOM Image. When I visualize a set
> of DICOM Images, I find that the volume is wrong : i.e , a part of this
> volume is not in the appropriate place, it has depaced. Here my source code:
>
> vtkVolume16Reader *reader = vtkVolume16Reader::New();
>  reader->SetDataDimensions (512,512);
>  reader->SetDataOrigin (0.0, 0.0, 0.0);
>  reader->SetDataByteOrderToLittleEndian();
>  reader->SetFilePrefix ("C:\\test\\000000");
>  reader->SetImageRange (1, 83);
>  reader->SetDataSpacing (0.59, 0.59, 3);
> reader->Update();
> ..........

vtkVolume16Reader was never meant to read DICOM files. Whoever uses it
in any kind of context, has never-ever read/understood the DICOM file
format specification. This is a hack that used to work for some
ACR-NEMA v1 file (ACR NEMA 2 & DICOM v3 are allowed to be compressed
which breaks this hack right away.).
There is a limited DICOM reader shipped with VTK: vtkDICOMImageReader,
use that instead. If you are looking for a far more complete solution,
try gdcm, at http://gdcm.sf.net

> vtkImageMarchingCubes *iso = vtkImageMarchingCubes::New();
>  iso->SetInput(reader->GetOutput());
>  iso->SetValue(0,1150);
>  iso->SetInputMemoryLimit(3000);
>  isoMapper->SetInput (iso->GetOutput());
> .............
> You can find the Image Result and the desired Image as attached files
>
> Rq : when I use ITK  to transform the serie of DICOM image to a .vtk file,
> and then I visualize this file with vtkStructuredPointsReader I have no
> problem,

ITK is internally using GDCM as it's default DICOM library.

-Mathieu


-- 
Mathieu



More information about the vtkusers mailing list