[Insight-users] DICOMWriter for wide dynamic intensity range (SOLVED)

Li, Wen WLi at childrensnational.org
Wed Aug 21 12:26:44 EDT 2013


Maybe I should say partially solved. I used a wrong slope (too small). gdcmRescaler is smart enough to cast inverse rescaled pixel type to INT32 but gdcmIO doesn't know that. It allocated a small size of memory for INT16 to keep output image, which is ready to write. So my program stopped because of the memory issue. I changed the slope value and now it is ok.

By the way, I can see from the output dicom file that the RescaleIntercept and RescaleSlope get retained as I specified for the writer.

It is really tricky. Takes time to make it work. Now I see strange "Smallest/Largest Image Pixel Value". I wonder if it is calculated "intelligently" by gdcmIO too....

Wen
________________________________
From: Bill Lorensen [bill.lorensen at gmail.com]
Sent: Wednesday, August 21, 2013 12:01 PM
To: Li, Wen
Cc: insight-users at itk.org
Subject: Re: [Insight-users] DICOMWriter for wide dynamic intensity range

It is different but related. The handling of rescale/slope in the current implementation is tricky.



On Wed, Aug 21, 2013 at 10:39 AM, Li, Wen <WLi at childrensnational.org<mailto:WLi at childrensnational.org>> wrote:
Thank you for your responding.
The bug you reported is related with my issue but slightly different.

I can't even confirm whether the output dicom retains the specific RescaleIntercept and RescaleSlope I set. The writer simple stopped working at the first slice when gdcm is doing inverse rescaling. Of course I use a double RescaleSlope like normally PET images need. I suspect it is the memory (pixel type) issue. I will investigate it.

Wen
________________________________
From: Bill Lorensen [bill.lorensen at gmail.com<mailto:bill.lorensen at gmail.com>]
Sent: Wednesday, August 21, 2013 10:24 AM
To: Li, Wen
Cc: insight-users at itk.org<mailto:insight-users at itk.org>
Subject: Re: [Insight-users] DICOMWriter for wide dynamic intensity range

I have an outstanding bug request that deals with similar issues. I hope to get to it soon...
https://issues.itk.org/jira/browse/ITK-3194



On Wed, Aug 21, 2013 at 9:38 AM, Li, Wen <WLi at childrensnational.org<mailto:WLi at childrensnational.org>> wrote:
Only ITK in Debug mode allows manipulating RescaleIntercept and RescaleSlope AND if output pixel type of the dicom writer is float or double. That's fine.

Now the problem is gdcm::Rescaler may not work correctly. It stopped at gdcmRescaler::InverseRescaleFunction without finishing it.

I suppose that function handles inverse rescaling for float input pixel type. I don't expect anyone to look into that problem for me but just a little frustrated.

Wen
________________________________
From: insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org> [insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org>] on behalf of Li, Wen [WLi at childrensnational.org<mailto:WLi at childrensnational.org>]
Sent: Monday, August 19, 2013 11:24 PM
To: insight-users at itk.org<mailto:insight-users at itk.org>
Subject: [Insight-users] DICOMWriter for wide dynamic intensity range

Hi Insight users,

I am talking about PET images. The data I am dealing with has a wide dynamic intensity range.
Now I am trying to write it as a DICOM image.

As we all know, DICOM only stores 16bit integer as pixel value. I tried to manipulate DICOM tag 0028|1052 and 0028|1053 for the RescaleIntercept and RescaleSlope. Failed. They were always reset to be 0 and 1.

Is there any suggestion about how to store the original intensity values instead of having them chopped off to be 16bit integer. In my case, I probably need float non-1 RescaleSlope.

BTW, I define my writer as
typedef itk::ImageSeriesWriter< OutputImageType, OutputImageType2D > SeriesWriterType;
OutputImageType::PixelType is float and OutputImageType2D::PixelType is signed short.

Thanks,
Wen

_____________________________________
Powered by www.kitware.com<http://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



--
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130821/ce40b0ad/attachment.htm>


More information about the Insight-users mailing list