Fiji - Math

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fiji - Math

Haimon Alves
I need to perform some mathematical calculations on
grayscale images. However, each multiplication results in
a saturated image (everything below 255 or 65535 eventually
goes to those numbers).

So, is there anyway possible to avoid this? Like, do the math,
the software saves the numbers - even if the image does not
make any sense at first, and then, when everything is done,
those new values are scaled back to 0-255 or 0-65535?!

Thank you for your help

--

*Haimon*

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fiji - Math

LIM Soon Yew John (IMB)
Hi Haimon,

You convert your image to 32 bit using menu command Image>Type>32-bit before you applied your calculation. You can then scale it back to 8 bit or 16 bit at a later stage.

Best Regards,
John
________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of Haimon Alves [[hidden email]]
Sent: Tuesday, April 08, 2014 10:45 AM
To: [hidden email]
Subject: Fiji - Math

I need to perform some mathematical calculations on
grayscale images. However, each multiplication results in
a saturated image (everything below 255 or 65535 eventually
goes to those numbers).

So, is there anyway possible to avoid this? Like, do the math,
the software saves the numbers - even if the image does not
make any sense at first, and then, when everything is done,
those new values are scaled back to 0-255 or 0-65535?!

Thank you for your help

--

*Haimon*

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fiji - Math

Haimon Alves
Hi John,

thanks for your help. one question though: wouldn't that be the same
problem, if
the values goes over the maximum of a 32 bit? Because if any value goes
beyond
of what I need, it will not help.

what I wanted was not to worry about those limits. I just wanted to make
those
calculations and, after those changes, I would scale to an actual image.


2014-04-08 0:02 GMT-03:00 LIM Soon Yew John (IMB) <
[hidden email]>:

> Hi Haimon,
>
> You convert your image to 32 bit using menu command Image>Type>32-bit
> before you applied your calculation. You can then scale it back to 8 bit or
> 16 bit at a later stage.
>
> Best Regards,
> John
> ________________________________________
> From: ImageJ Interest Group [[hidden email]] On Behalf Of Haimon
> Alves [[hidden email]]
> Sent: Tuesday, April 08, 2014 10:45 AM
> To: [hidden email]
> Subject: Fiji - Math
>
> I need to perform some mathematical calculations on
> grayscale images. However, each multiplication results in
> a saturated image (everything below 255 or 65535 eventually
> goes to those numbers).
>
> So, is there anyway possible to avoid this? Like, do the math,
> the software saves the numbers - even if the image does not
> make any sense at first, and then, when everything is done,
> those new values are scaled back to 0-255 or 0-65535?!
>
> Thank you for your help
>
> --
>
> *Haimon*
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--

*Haimon*

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fiji - Math

ctrueden
Hi Haimon,

> wouldn't that be the same problem, if the values goes over the
> maximum of a 32 bit? Because if any value goes beyond of what I need,
> it will not help.
>
> what I wanted was not to worry about those limits. I just wanted to
> make those calculations and, after those changes, I would scale to an
> actual image.

Yeah, that's known as "arbitrary precision arithmetic" and it is much
slower than the usual finite-precision arithmetic done by the vast majority
of computer programs. And ImageJ 1.x does not provide any support for it,
unfortunately.

For what it's worth, the ImgLib2 [1] library is capable of supporting this,
and ImageJ2 [2] uses ImgLib2 as its core data model. We have done some work
on it [3], but more still needs to be done before it will be available for
general use.

Regards,
Curtis

[1] http://imglib2.net/
[2] http://developer.imagej.net/
 [3] http://trac.imagej.net/ticket/1653


On Mon, Apr 7, 2014 at 10:12 PM, Haimon Alves <[hidden email]>wrote:

> Hi John,
>
> thanks for your help. one question though: wouldn't that be the same
> problem, if
> the values goes over the maximum of a 32 bit? Because if any value goes
> beyond
> of what I need, it will not help.
>
> what I wanted was not to worry about those limits. I just wanted to make
> those
> calculations and, after those changes, I would scale to an actual image.
>
>
> 2014-04-08 0:02 GMT-03:00 LIM Soon Yew John (IMB) <
> [hidden email]>:
>
> > Hi Haimon,
> >
> > You convert your image to 32 bit using menu command Image>Type>32-bit
> > before you applied your calculation. You can then scale it back to 8 bit
> or
> > 16 bit at a later stage.
> >
> > Best Regards,
> > John
> > ________________________________________
> > From: ImageJ Interest Group [[hidden email]] On Behalf Of Haimon
> > Alves [[hidden email]]
> > Sent: Tuesday, April 08, 2014 10:45 AM
> > To: [hidden email]
> > Subject: Fiji - Math
> >
> > I need to perform some mathematical calculations on
> > grayscale images. However, each multiplication results in
> > a saturated image (everything below 255 or 65535 eventually
> > goes to those numbers).
> >
> > So, is there anyway possible to avoid this? Like, do the math,
> > the software saves the numbers - even if the image does not
> > make any sense at first, and then, when everything is done,
> > those new values are scaled back to 0-255 or 0-65535?!
> >
> > Thank you for your help
> >
> > --
> >
> > *Haimon*
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
>
>
> --
>
> *Haimon*
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html