[Insight-users] IntensityWindowImageFilter

Luis Ibanez luis.ibanez at kitware.com
Fri Jun 10 07:16:35 EDT 2011


Hi Andy,

Thanks for sending your images.

To normalize the intensities to the [0:255] range,
you can certainly use the itkIntensityWindowingImageFilter.

You can also use the RescaleIntensityImageFilter.

In your case, the problem is that you are using
an incorrect pixel type for reading the DICOM
image.

CT scans use signed short values (they include negative
numbers).  Your image looks like it was read using
unsigned integers, and therefore the regions of air
(that are in the -1000 HU range) are wrapped to
be shown as very high intensities.

Please read about HU:
http://en.wikipedia.org/wiki/Hounsfield_scale
http://www.itk.org/Wiki/ITK_Hounsfield_Units

and use as input image:

         itk::Image< signed short, 3 >  ImageType


  Thanks


    Luis


-------------------------------------
On Fri, Jun 10, 2011 at 6:55 AM, Andy Ettisberger
<andreas.ettisberger at students.fhnw.ch> wrote:
> Der Luis,
> How are you?
> I have another question. Im using this code to load a dicom stack. Then I
> have to get all pixel values in the range of 0 to 255 to display it on the
> ipad. I saw the intensitywindowingimage Filter in the documentation. Is my
> idea and the code correct? I expected that then my image on the ipad looks
> like that in the osirix application. I attached both printscreens to show
> you my problem. I used also windowLevel 50 and windowWidth 600. Should now
> the pixeldata not be the same like in the osirix?
> Thanks for your help!
>
>     reader = ReaderType::New();
>
>     reader->SetFileNames(fileNames);
>
>     reader->Update();
>
>     ImageType *  inputImage = reader->GetOutput();
>
>
>
>     typedef itk::IntensityWindowingImageFilter <ImageType, ImageType>
> IntensityWindowingImageFilterType;
>
>
>
>     IntensityWindowingImageFilterType::Pointer filter =
> IntensityWindowingImageFilterType::New();
>
>     filter->SetInput(inputImage);
>
>     filter->SetWindowLevel(windowWidth,windowLevel);
>
>     filter->SetOutputMinimum(0);
>
>     filter->SetOutputMaximum(255);
>
>     filter->Update();
>
>     inputImage = filter->GetOutput();
>
>     SliceIteratorType  inputIt(  inputImage,
> inputImage->GetRequestedRegion() );
>
> Best regards,
>
> Andy


More information about the Insight-users mailing list