[Insight-users] absolute value

Jakub Bican jakub.bican at matfyz.cz
Wed May 25 03:43:57 EDT 2005


Hi

i recently wanted to use AbsImageFilter and i found out, that it is not
using standard C++ abs() function (and overloads), but does something like
this:
if (A<0)
    return -1*A;
else
    return A;

This is a big problem with e.g. complex<> values! So, Isabelle, be aware of
the AbsImageFilter!

ITK team> should be AbsImageFilter changed to use standard abs() function
and it's overloads, please? Or is there any reason why it is not so?

Thanks,
Jakub


----- Original Message ----- 
From: "Gavin Baker" <gavinb+xtk at cs.mu.OZ.AU>
To: "Renaud Isabelle" <renauisa at yahoo.fr>
Cc: "insight-users" <insight-users at itk.org>
Sent: Wednesday, May 25, 2005 8:49 AM
Subject: Re: [Insight-users] absolute value and Hilbert transform


>
> Bonjour Isabelle,
>
> On Tue, May 24, 2005 at 07:43:21PM +0200, Renaud Isabelle wrote:
>
> > I am working on RF images. In order to visualize these ones, I have
> > to compute the absolute value of the image and then rescale image
> > data.
> >
> > I am wondering if there is already an ITK function adapted to
> > calculate the absolute value of an image. Or should I use abs()
> > function of math library in C?
>
> Yes, ITK has a filter to calculate the absolute value per-pixel.  It
> is one of many unary functors, as described here:
>
>   http://www.itk.org/Doxygen/html/classitk_1_1AbsImageFilter.html
>
> You may also be interested in these filters (for the rescaling):
>
>
http://www.itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html
>   http://www.itk.org/Doxygen/html/classitk_1_1ShiftScaleImageFilter.html
>
http://www.itk.org/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html
>
> > In future, I would have to transform RF images in B-mode images for
> > a better visualization. This is by computing the absolute value of
> > the Hilbert transform of RF image data. Is it also an ITK Hilbert
> > transform already computed?
>
> ITK doesn't currently provide such a filter (AFAIK).  The Software
> Guide has a section on writing new filters, and you should be able to
> base your new filter on an existing filter (most likely starting with
> ImageToImageFilter).  The VNL library has quite a comprehensive matrix
> math library, which should provide what you need for the implementation.
>
> Good luck,
>
>   :: Gavin
>
> -- 
> Gavin Baker                                      Complex Systems Group
> http://www.cs.mu.oz.au/~gavinb             The University of Melbourne
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



More information about the Insight-users mailing list