[Insight-users] Dicom and Image Spacing

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 10 10:27:59 EST 2012


I believe that DICOM always required special handling to get the
position correct.

On Mon, Dec 10, 2012 at 4:10 AM, Alexander Schmidt-Richberg
<schmidt-richberg at imi.uni-luebeck.de> wrote:
> Hi Bill,
>
> I just use the simple ImageWriter since I want 3D images written and the file type is unknown at compile time:
>
>  typedef ImageFileWriter< ImageType > ImageWriterType;
>  ImageWriterType::Pointer writer;
>  writer = ImageWriterType::New();
>  writer->SetInput( image );
>  writer->SetFileName( imageName );
>  writer->Update();
>
> Is this a problem in ITK4? That means, do DICOM images now require a special handling?
>
> Regards,
> Alex
>
> On 07.12.2012, at 17:27, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
>> Our handing of Image Position Patient in ITK is tricky to use. How are
>> you writing your DICOM volume? SeriesWriter or ImageWriter?
>>
>> Bill
>>
>> On Fri, Dec 7, 2012 at 9:02 AM, Alexander Schmidt-Richberg
>> <schmidt-richberg at imi.uni-luebeck.de> wrote:
>>> Thanks, Bill and Rômulo, for pointing that out. I just checked the
>>> current git version and the problem still remains: If I read, for
>>> example, a .mhd volume image with a spacing not equal to one (not a
>>> DICOM series), write it as DICOM volume file and then read the file, it
>>> will get a z-spacing of 1 (the in-plane spacing, however, is
>>> maintained). If this is really intended, it is kind of an awkward
>>> behavior, imo.
>>>
>>> Best regards
>>> Alex
>>>
>>> On Thu, 2012-12-06 at 15:52 +0000, Bill Lorensen wrote:
>>>> In ITK 3 and 4 we compute the distance between slice centers (spacing)
>>>> form the image position patient and orientation.
>>>> In ITKv4 there was a bug that was recently fixed. It will appear in
>>>> the 4.3 release. For now, you can try the latest 4.3 release candidate
>>>> which was announced recently on the mailing list.
>>>>
>>>> On Thu, Dec 6, 2012 at 4:35 AM, Rômulo Pinho
>>>> <romulo.pinho at lyon.unicancer.fr> wrote:
>>>>> Hello, Alex
>>>>> It is indeed a change in GDCM 2.x. You can read about it at
>>>>>
>>>>>
>>>>
>>> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames
>>>>>
>>>>>
>>>>
>>> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Imager_Pixel_Spacing#Spacing_along_Z_.28third_dimension.29
>>>>>
>>>>>
>>>>
>>> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Where_is_the_value_of_gdcm.Image.Spacing_coming_from_.3F
>>>>>
>>>>> Kind regards,
>>>>> Rômulo
>>>>>
>>>>>
>>>>>
>>>>> On 12/06/2012 10:16 AM, Alexander Schmidt-Richberg wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> sorry if this has been discussed before. I'm sure I'm not the first
>>> to
>>>>> realize, but I couldn't find anything in the mailing lists.
>>>>>
>>>>> I have a problem with reading/writing volume images as Dicom files
>>>> with
>>>>> ITKv4, presumably due to the change from GDCM 1.x to 2.x.
>>>>>
>>>>> In ITK 3, the image spacing was stored in the tags
>>>>> "SpacingBetweenSlices" and "ImagerPixelSpacing". In v4,
>>>>> "NominalScannedPixelSpacing" is used for the in-plane spacing,
>>>> however,
>>>>> the z-spacing is not stored at all (if I'm right). That means, all
>>> of
>>>>> the "old" images I'm reading with ITK4 have a uniform spacing of 1,
>>>>> since the old tags are not interpreted. Moreover, programs like
>>>> MeVisLab
>>>>> ignore the new tag.
>>>>>
>>>>> Has this behavior been discussed? Is it working as intended and is
>>>> there
>>>>> any workaround?
>>>>>
>>>>> Best regards Alex
>>>>>
>>>>>
>>>>>
>>>>> _____________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.php
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>
>>>
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the Insight-users mailing list