[Insight-developers] Re: [Insight-users] ImageReadDicomSeriesWrite problem

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Oct 19 12:09:55 EDT 2007


Ok this piece of code keeps bitting me over and over (*). Every time
the writer is called it creates an ImageIO of dimension 2. So indeed
m_Direction will not be big enough to hold a DICOM direction cosines.

I have to leave now so this will have to wait until monday, unless
someone wants to work on it.

Eleonora, you can work around it by commenting out :

/*
    str << m_Direction[0][0] << "\\"
        << m_Direction[1][0] << "\\"
        << m_Direction[2][0] << "\\"
        << m_Direction[0][1] << "\\"
        << m_Direction[1][1] << "\\"
        << m_Direction[2][1];
*/

and replace it with:

  str << "1\\0\\0\\0\\1\\0";

HTH
-Mathieu

(*)
  if( ( m_Dimensions.size() > 2 && m_Dimensions[2]>1 ) ||
      m_GlobalNumberOfDimensions == 3 )
    {
    str.str("");
    str << m_Origin[0] << "\\" << m_Origin[1] << "\\" << m_Origin[2];
    header->InsertValEntry(str.str(),0x0020,0x0032); // Image Position (Patient)

    // Handle Direction = Image Orientation Patient
    str.str("");
    str << m_Direction[0][0] << "\\"
        << m_Direction[1][0] << "\\"
        << m_Direction[2][0] << "\\"
        << m_Direction[0][1] << "\\"
        << m_Direction[1][1] << "\\"
        << m_Direction[2][1];
    header->InsertValEntry(str.str(),0x0020,0x0037); // Image
Orientation (Patient)
    }


On 10/19/07, Eleonora Mambrini <e.mambrini at gmail.com> wrote:
> Hi all,
> i'm trying to use the example ImageReadDicomSeriesWrite.exe, to obtain
> a dicom serie from an mha image, but it doesn't work, even with test
> data found in /data dir of ITK.
> I've found a description of the same problem in
> http://public.kitware.com/pipermail/insight-users/2006-September/019480.html
>
> but there's not answer...
>
> Someone can help me?
>
> eleonora
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


-- 
Mathieu


More information about the Insight-developers mailing list