get acos of a 3D matrix

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

get acos of a 3D matrix

HuaLei (Shelley) Zhang
Hello
I opened a 3d dataset and try to get inverse cosine of the intensity of each
pixel, but the math functions only allow me to do simple algebraic
calculations such as add/subtract/multiply/divide, etc.

any way I can get acos of a stack? or even just a 2D image?

thank you!!
Reply | Threaded
Open this post in threaded view
|

Re: get acos of a 3D matrix

jmutterer
Hello,
you can use the ExpressionNT plugin by Ulf Dittmer to do that.
It is available at http://www.ulfdittmer.com/imagej/expression.html

jerome.

On 8/22/07, Shelley <[hidden email]> wrote:

>
> Hello
> I opened a 3d dataset and try to get inverse cosine of the intensity of
> each
> pixel, but the math functions only allow me to do simple algebraic
> calculations such as add/subtract/multiply/divide, etc.
>
> any way I can get acos of a stack? or even just a 2D image?
>
> thank you!!
>
Reply | Threaded
Open this post in threaded view
|

Re: get acos of a 3D matrix

Gabriel Landini
In reply to this post by HuaLei (Shelley) Zhang
On Wednesday 22 August 2007 02:41:38 Shelley wrote:
> I opened a 3d dataset and try to get inverse cosine of the intensity of
> each pixel, but the math functions only allow me to do simple algebraic
> calculations such as add/subtract/multiply/divide, etc.
>
> any way I can get acos of a stack? or even just a 2D image?

Convert to the image to 32 bit and use the acos() macro function to filter the
image pixel by pixel.

Cheers,
G.
Reply | Threaded
Open this post in threaded view
|

Re: get acos of a 3D matrix

Wayne Rasband
In reply to this post by HuaLei (Shelley) Zhang
This macro calculates the inverse cosine of every pixel in a 32-bit
stack.

   w=getWidth; h=getHeight;
   for (i=1; i<=nSlices; i++) {
       showStatus(i+"/"+nSlices);
       setSlice(i);
       for (y=0; y<h; y++) {
           for (x=0; x<w; x++) {
               value = getPixel(x,y);
               setPixel(x, y, acos(value));
           }
       }
   }

-wayne

On Aug 21, 2007, at 9:41 PM, Shelley wrote:

> Hello
> I opened a 3d dataset and try to get inverse cosine of the intensity
> of each
> pixel, but the math functions only allow me to do simple algebraic
> calculations such as add/subtract/multiply/divide, etc.
>
> any way I can get acos of a stack? or even just a 2D image?
>
> thank you!!
>