[Insight-users] transform DICOM Imagetype
Luis Ibanez
luis.ibanez at kitware.com
Sun Sep 24 10:06:01 EDT 2006
Hi 肖 潇,
Thanks for letting us know that you found the solution for your problem.
---
About your new problem,
I'm not sure I understand your description. It seems to be incomplete.
Here is what I can follow:
1) The case that works:
1.1) You read a DICOM image that contains a single slice.
1.2) The pixel type is "signed short"
1.3) In this case you can convert it fine to VTK.
2) The case that does not work:
2.1) You insert a CastImage filter to convert the signed short
image into an unsigned short image.
2.2) This doesn't convert well to VTK.
Answer HERE: casting from signed short to unsigned short is a
bad idea because the casting does not rescale the values.
The negative values will be translated into very high values.
For example
-1 ===> 65535
-2 ===> 65534
-3 ===> 65533
-4 ===> 65532
Since your image actually contains negative values, you
are probably seeing now an unsigned short image with
very high values and very low values, that looks like
a binary image to the naked eye.
Don't use the Cast Filter. The filter that you should use is
the RescaleIntensityFilter or the IntensityWindowingImageFilter.
3) You say that you
"...cannot adopt RescaleIntensityImageFilter
due to some reason..."
Well, you may want to share with us the reason....
Or if you are getting, compilation errors, you probably
should share with the list the *exact error messages* that
you are getting.
Otherwise it is very hard for us to help you in this matter.
Regards,
Luis
===============
肖 潇 wrote:
>
> Hi Luis,
> Thank you for your kindly help.
>
> Subject: Re: [Insight-users] Still about DICOM TAG
>
> With your clue, I finally solved the problem.
> When I took \InsightToolkit-2.6.0 with CMake, I didn't use Show Advanced
> Values.
> After turn on the option GDCM_LEGACY_REMOVE and GDCM_LEGACY_SILENT,
> everything is OK.
>
> Now I am facing a new problem.
>
> Subject: [Insight-users] transform DICOM Imagetype
>
> I am able to read and display a DICOM Image which Imagetype is Short and
> Dimension are three. However, this DICOM Image is one slice and the
> Dimen[3] is 0, I used Image<short,2>,not Image<short,3>,and show it with
> VTK very well.
>
> Now I want to change the Imagetype to unsigned short,then I use the
> function CastImageFilter< InputImagetype, OutputImagetype> , the
> InputImagetype is Image<short,2>, the OutputImagetype is Image<unsigned
> short,2> or Image<unsigned short,3> here,but it seems neither of them
> worked well with VTK.
> I know RescaleIntensityImageFilter can also change the Imagetype.
> However, I cannot adopt RescaleIntensityImageFilter due to some reason.
>
> Look forward to hearing from you.
>
> Thanks
>
> Xiao
>
>
> From: Luis Ibanez <luis.ibanez at kitware.com>
> To: 肖 潇 <rosemarylrm at hotmail.com>
> CC: insight-users at itk.org
> Subject: Re: [Insight-users] Still about DICOM TAG
> Date: Thu, 14 Sep 2006 09:47:29 -0400
>
>>
>> Hi Xiao,
>>
>> The warning message about
>>
>> "identifier was truncated to '255'
>> characters in the debug information"
>>
>> It is just a "feature" of Visual Studio.
>> An annoying one, for sure.
>>
>> This is a Microsoft problem, not an ITK one.
>> (Sorry).
>>
>>
>> You will get that message by just trying to
>> use STL in a 4 lines test program that is
>> compiled for debug.
>>
>> You can disable this warning by adding:
>>
>> #if defined(_MSC_VER)
>> #pragma warning ( disable : 4786 )
>> #endif
>>
>>
>>
>> This warning is unrelated to the problem that
>> you report in the second part of your email.
>>
>>
>> ----------
>>
>>
>> Your actual problem seems to be related to the
>> reading of the DICOM header of a file.
>>
>> Have you verified the integrity of that DICOM
>> file ?
>>
>> You can do so with tools such as MRIConvert:
>>
>> http://lcni.uoregon.edu/~jolinda/MRIConvert/
>>
>> or with David Clunie's tools:
>>
>> http://www.dclunie.com/dicom3tools.html
>>
>>
>> If you find the DICOM file to be valid, then,
>> please send us the file so we can attempt to
>> reproduce the problem.
>>
>>
>> Thanks
>>
>>
>> Luis
>>
>>
>>
>
> _________________________________________________________________
> 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
>
>
More information about the Insight-users
mailing list