[Insight-developers] ImageSeriesWriter + GDCMImageIO

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Sep 29 11:40:16 EDT 2009


On Tue, Sep 29, 2009 at 4:22 PM, Daniele E. Domenichelli
<daniele.domenichelli at gmail.com> wrote:
> Hello,
>
>
> I'm trying to read a 2D dicom set as a 3D volume, do something on this
> volume, than write it back into a 2D DICOM set and I found 2 bugs:
>
>
> 1) When directional cosines are copied from 3D volume to 2D slices by
> ImageSeriesWriter, only the upper-left 2x2 matrix can be copied, due to
> the dimension of m_Direction matrix.
> Then GDCMImageIO sets zeros in the missing values of the first 2 lines
> of the matrix.
>
> This is not a problem if the directional cosines matrix is the identity
> matrix, otherwise DICOM tag (0020,0037) Image Orientation (Patient) of
> the output DICOM files is not valid.
>
> I suggest that an ITK_Direction entry containing Direction Matrix could
> be added in MetaDataDictionary. In this way there is no need to change
> the behaviour of this filter and ImageIOs have an easy way to access
> this information.
>
>
> The first attached file (ITK_Direction.diff) is a patch to add this
> entry in MetaDataDictionary and to read this tag in GDCMImageIO

Ok, assign this to me in the bug tracker + patch at: http://itk.org/Bug

> 2) When I read a DICOM set as a volume that has direction cosines
> written as:
>
>  Ax\Ay\Az\Bx\By\Bz
>
> these values are stored in a 3x3 matrix as:
>
>  Ax  Bx  Cx
>  Ay  By  Cy   (where C=AxB)
>  Az  Bz  Cz
>
> When I write back this volume as 2D DICOM, direction cosines are:
>
>  Ax\Bx\Cx\Ay\By\Cy
>
>
> The second attached file (GDCMDirectionCosines.diff) should correct this
> behaviour. (I tested this only for GDCM 2)

This is exactly the opposite of bug 0007748 which was recently applied
to CVS HEAD
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkGDCMImageIO.cxx?root=Insight&r1=1.161&r2=1.162

Can you check what is your test case and how is it different from the
bug report 0007748

Thanks,
-- 
Mathieu


More information about the Insight-developers mailing list