[Insight-users] itk3.14 itkGDCMImageIO.cxx and 2D images.
John Drescher
drescherjm at gmail.com
Sun Jun 21 16:55:56 EDT 2009
On Sun, Jun 21, 2009 at 1:38 PM, Mathieu
Malaterre<mathieu.malaterre at gmail.com> wrote:
> On Fri, Jun 19, 2009 at 9:19 PM, John Drescher<drescherjm at gmail.com> wrote:
>> When trying to write a 2D DICOM image I am getting a crash in
>>
>> line 1957
>>
>> 1955: image.SetSpacing(0, m_Spacing[0] );
>> 1956: image.SetSpacing(1, m_Spacing[1] );
>> 1957: image.SetSpacing(2, m_Spacing[2] );
>> 1958: image.SetOrigin(0, m_Origin[0] );
>> 1959: image.SetOrigin(1, m_Origin[1] );
>> 1960: image.SetOrigin(2, m_Origin[2] );
>>
>>
>> The problem is the vector m_Spacing is of size 2 and so m_Spacing[2]
>> is causing the crash. I assume m_Origin[2] is bad as well in line
>> 1960.
>>
>> I would file a bug report but I am not sure if this is fixed in cvs or not.
>>
>
> Did you read what the itk::GDCMImageIO cstor is doing:
>
> GDCMImageIO::GDCMImageIO()
> : m_LoadSequences( m_LoadSequencesDefault ),
> m_LoadPrivateTags( m_LoadPrivateTagsDefault )
> {
> this->m_DICOMHeader = new InternalHeader;
> this->SetNumberOfDimensions(3); //needed for getting the 3 coordinates of
> // the origin, even if it is a 2D slice.
>
>
>
> I think this should work, could you exhibit a way to reproduce the bug ?
>
I will try to put together a small piece of code and an image sometime
next week.
John
More information about the Insight-users
mailing list