[Insight-users] Image Arithmetic with Scalars

Dan Mueller d.mueller at qut.edu.au
Wed Apr 18 06:10:47 EDT 2007


Hi Andreas,

The itk::ShiftScaleImageFilter may be what you are after: 
http://www.itk.org/Doxygen/html/classitk_1_1ShiftScaleImageFilter.html

This filter allows you to specify a shift value (0.0 in your case) which 
is added to each pixel, and a scale value (0.3333 in your case) with is 
multiplied with each pixel. You'll probably need a real-valued image 
(float or double).

HTH

Cheers, Dan

Andreas Keil wrote:
> Dear all,
>
> how is it possible to do perform scalar operations with images, e.g.
>
>   1 / 3 * myImage
>
> The solution of filling an image with constant values and using
> AddImageFilter etc. is of course not the way to go. Do I have to subclass
> UnaryFunctorImageFilter or is there an easier way?
>
> Thank you,
> Andreas.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070418/c1b91777/attachment.html


More information about the Insight-users mailing list