[vtkusers] loading a vtkImageData correctly
Mathieu Malaterre
mathieu.malaterre at kitware.com
Thu Mar 8 16:15:30 EST 2007
Hi Mark,
Can you try passing the IOP from the DICOM reader to vtkImageReslice.
pseudocode:
float *direction_cosines = reader->GetImageOrientationPatient();
vtkMath::Cross(direction_cosines, direction_cosines+3, cross_vect);
reslice = vtkImageReslice;
reslice->SetResliceAxesDirectionCosines(
direction_cosines[0],
direction_cosines[1],
direction_cosines[2],
direction_cosines[3],
direction_cosines[4],
direction_cosines[5],
cross_vect[0],
cross_vect[1],
cross_vect[2]
);
HTH
-Mathieu
Mark Wyszomierski wrote:
> Hi Matieu,
>
> I tested a bunch of studies, and one is handled unexpectedly - it is a
> coronal study. The cols/rows are heading to the feet/left
> respectively. The images move from anterior to posterior.
>
> I am directing the output of vtkDICOMImageReader to vtkImageData and
> then volume rendering it:
>
> vtkImageData = vtkDICOMImageReader->GetOutput() // pseudocode
>
> the initial position of the volume is such that it seems the patient's
> back is toward the camera (I would have expected the front of the
> patient to be facing the camera). The end effect is that the left and
> right side of the patient get swapped. Is this normal behavior for
> this type of ordering? I may just be doing something incorrectly, but
> it seemed to work fine for my other axial and sagital tests.
>
> Thanks,
> Mark
>
>
> On 3/8/07, Mark Wyszomierski <markww at gmail.com> wrote:
>> Mathieu,
>>
>> So far vtkDICOMImageReader looks good - seems that it handles the
>> 'inside out' studies correctly. What a life saver!
>>
>> Thanks,
>> Mark
>>
>> On 3/8/07, Mathieu Malaterre <mathieu.malaterre at kitware.com> wrote:
>> > We have also our own implementation in GDCM:
>> >
>> >
>> http://groups.google.com/group/comp.protocols.dicom/browse_frm/thread/962794718131167c/ddf92d03f6fa84b4
>>
>> >
>> > good luck,
>> > -M
>> >
>> > Mark Wyszomierski wrote:
>> > > Ah I just found a quick example of using vtkDICOMImageReader to
>> read a
>> > > series of images to create a volume - this method would be much more
>> > > preferable than writing my own code to do it (leave it to the
>> > > experts).
>> > >
>> > > I'll give it a try now, thanks again.
>> > >
>> > > Mark
>> > >
>> > > On 3/8/07, Mark Wyszomierski <markww at gmail.com> wrote:
>> > >> Hi Mathieu,
>> > >>
>> > >> First off - thanks for replying. I took a look at the
>> > >> vtkDICOMImageReader class - it looks like it only reads a single
>> image
>> > >> - is there any class that handles reading an entire series and then
>> > >> orders them 'correctly' based on IPP + IOP?
>> > >>
>> > >> I read through the other links you posted but it will take me a few
>> > >> more reads to understand the right way to figure out the ordering
>> > >> using IPP + IOP,
>> > >>
>> > >> Thanks,
>> > >> Mark
>> > >>
>> > >> On 3/8/07, Mathieu Malaterre <mathieu.malaterre at kitware.com> wrote:
>> > >> > Mark Wyszomierski wrote:
>> > >> > > Hi,
>> > >> > >
>> > >> > > I have two axial studies - one scanned from head to foot, the
>> other
>> > >> > > scanned from foot to head.
>> > >> > >
>> > >> > > What can I do to load each study correctly into a vtkImageData?
>> > >> > > Previously I was simply loading them in a slice at a time
>> based on
>> > >> > > instance number, but this fails miserably for the study which
>> was
>> > >> > > scanned head to foot (the volume comes out backwards).
>> > >> >
>> > >> >
>> > >> > Hi Mark,
>> > >> >
>> > >> >
>> > >> > See my answer to your post in dicom newsgroup. I would also
>> suggest
>> > >> > you have a look at what is being done in vtkDICOMImageReader.
>> This is
>> > >> > exactly the same idea, you order IPP along the normal (computed
>> > >> using IOP).
>> > >> >
>> > >> > HTH
>> > >> > -Mathieu
>> > >> >
>> > >>
>> > >
>> >
>> >
>>
>
More information about the vtkusers
mailing list