[Insight-users] Photographic Negative ?

Luis Ibanez luis.ibanez at kitware.com
Fri, 16 Apr 2004 14:38:27 -0400


Hi Robert,

The itkIntensityWindowingImageFilter will do the trick:

http://www.itk.org/Insight/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html

Just set up the OutputMinimum and OutputMaximum
inverted, that is:

   SetOutputMinimum( 255 );
   SetOutputMaximum(   0 );

Please let us know if you find any problem with it.

   Thanks

    Luis



----------------------
Atwood, Robert C wrote:

> I cannot figure out a simple filter that returns the negative of an
> image. 
> The RescaleImageFilter does not allow a negative scale, and ScaleShift
> also seems to choke if the scale is -1
> 
> 
> For example I have an image containing values (x) between 0 and 200, I
> want to pass through an image in which each value is 200-x (output of
> distance map)
> 
> Outputting the dmap->GetOutput() data shows me the correct distance map,
> but output of rescaler->GetOutput() creates a file that is all zeros.
> RescaleImageFilter simply returns an error if the minimum is greater
> than the maximum. I am guessing that negative SetScale value is not
> intended to be used in the ShiftScaleImageFilter?
> 
> 
> What is the correct filter to use for this purpose?
> 
> Thanks,
> Robert
> 
>  
> Here are the important definitions and statements used to get all zeros:
> 
> 
> 
> typedef itk::Image<unsigned long, 3>   LabeledImageType;
> typedef itk::ShiftScaleImageFilter<LabeledImageType,LabeledImageType>
> RescaleType;
> RescaleType::Pointer rescaler = RescaleType::New();
> 
> rescaler->SetScale(-1);
> rescaler->SetShift(200);
> 
> rescaler->SetInput(dmapvol->GetOutput());
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>