[ITK-users] question about wiki example ResampleDICOM
Matt McCormick
matt.mccormick at kitware.com
Wed Sep 17 11:42:33 EDT 2014
Hi,
Do to this fix [1], if the writer is re-using the GDCMImageIO, the
writer should apply the inverse rescale / slope intercept like the
reader applied the rescale / slope intercept when reading. This was a
long-standing bug that I fixed in 4.6.0. Arnaud, if the manual
inverse rescale / slope operation is removed, does the correct output
result?
Thanks,
Matt
[1] https://github.com/Kitware/ITK/commit/847ec2b79ac2cedaab6714678c0677793aa23a1e
On Wed, Sep 17, 2014 at 10:41 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> I wrote this example many years ago…
> 1) If the input has a non-trivial slope/intercept, the reader applies
> the slope/intercept to the raw data.
> 2) Rather than setting the slope/intercept in the output dicom, I
> apply the inverse of of the slope intercept to the resampled data
> before writing. The output dicom should not have the origin
> slope/intercept tags.
>
> I'll try to verify this with Slicer, but I may be out of touch for 2 weeks…
>
> Bill
>
>
> On Wed, Sep 17, 2014 at 10:15 AM, Arnaud Gelas <arnaudgelas at gmail.com> wrote:
>> Hi Nick,
>>
>> I can confirm that with the example I get a difference of -1024 (+/- 1) in
>> between the input and the output, using the ShiftScaleImage part...
>> While without this part of code the difference is (+/-1)
>>
>> I would like to make sure this is the expected behaviour!?
>>
>> On Wed, Sep 17, 2014 at 3:35 PM, Nick Patterson <pattersonnp.work at gmail.com>
>> wrote:
>>>
>>> OK, I will wait to hear the outcome of your run with the original example
>>> then.
>>>
>>> Cheers, Nick.
>>>
>>>
>>>
>>>
>>> On 17 Sep 2014, at 14:34, Arnaud Gelas <arnaudgelas at gmail.com> wrote:
>>>
>>> Nick,
>>>
>>> I can't roll back to previous ITK version, important patches on
>>> itkGDCMImageIO were very recently merged...
>>>
>>>
>>> https://github.com/Kitware/ITK/commits/master/Modules/IO/GDCM/src/itkGDCMImageIO.cxx
>>>
>>> e.g.
>>>
>>>
>>> https://github.com/Kitware/ITK/commit/33a7e7162fc040f6c7346af5fc1ec15a80834273
>>>
>>> https://github.com/Kitware/ITK/commit/2f86b89df192aa80793b2d7f09624a2e4a74ec3c
>>>
>>>
>>> Arnaud
>>>
>>> On Wed, Sep 17, 2014 at 3:29 PM, Nick Patterson
>>> <pattersonnp.work at gmail.com> wrote:
>>>>
>>>> I should also mention Arnauld that I use ITK4.5.2. I have had many
>>>> issues with using ITK 4.6 with the latest GDCM from git, so rolled back to
>>>> ITK4.5.2.
>>>> Nick.
>>>>
>>>>
>>>>
>>>> On 17 Sep 2014, at 14:32, Arnaud Gelas <arnaudgelas at gmail.com> wrote:
>>>>
>>>> Hi Matias,
>>>>
>>>> I guess you are referring to
>>>>
>>>>
>>>> https://github.com/Kitware/ITK/commit/847ec2b79ac2cedaab6714678c0677793aa23a1e
>>>>
>>>> $ git tag --contains 847ec2b79ac2cedaab6714678c0677793aa23a1e
>>>> v4.6.0
>>>>
>>>> I use the release branch of ITK
>>>>
>>>> ---
>>>>
>>>> Matt,
>>>>
>>>> Can you comment on this, please?
>>>>
>>>> Thanks
>>>> Arnaud
>>>>
>>>> On Sep 17, 2014, at 3:21 PM, Matias Montroull <matimontg at gmail.com>
>>>> wrote:
>>>>
>>>> I had an issue with the resampledicom example once (all my pixel values
>>>> were recalculated by adding rescaleintercept) and then downloaded the latest
>>>> ITK release (4.6) and worked fine.
>>>>
>>>> The issue was with the GDCMIO class I beleive but was fixed somehow in
>>>> the 4.6 version.
>>>>
>>>> On Wed, Sep 17, 2014 at 10:02 AM, Arnaud Gelas <arnaudgelas at gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I have been looking at the following wiki example:
>>>>>
>>>>> http://www.itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM
>>>>>
>>>>> It seems to me that the section to rescale the image is not valid
>>>>> anymore with latest ITK version (?)
>>>>>
>>>>>
>>>>> https://github.com/InsightSoftwareConsortium/ITKWikiExamples/blob/master/DICOM/ResampleDICOM.cxx#L314-L333
>>>>>
>>>>> Can anyone confirm?
>>>>>
>>>>> Is this code validated? are output images compared to input ones in the
>>>>> corresponding test?
>>>>>
>>>>> Thanks
>>>>> Arnaud
>>>>>
>>>>> _____________________________________
>>>>> 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://public.kitware.com/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://public.kitware.com/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://public.kitware.com/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://public.kitware.com/mailman/listinfo/insight-users
More information about the Insight-users
mailing list