entering an equation

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

entering an equation

shilo2
Dear list members,

I am using the imageJ to produce radiometric images. The images are results of division of two probes with different excitation wavelength.
Since the ration is in correlation to the parameter I interested, I'm looking for a tool to replace the ration values with the parameter value by entering the equation.

Any help will be greatly appreciated.

Thanks
Shilo

   
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

Harry Parker
You could use the "Image Calculator Plus" plugin to simplify your custom macro greatly. Its in the Utilities section of the Plugins web page. Using this, your macro may be simpler to write.  Or just use the record macro feature while processing your images with the standard Process->Math functions to get your macro started.

 --
Harry Parker
Senior Imaging Systems Engineer
Currently available for hire in NJ and Eastern PA or thru the 'net.






________________________________
From: shilo2 <[hidden email]>
To: [hidden email]
Sent: Monday, January 19, 2009 2:39:55 PM
Subject: entering an equation

Dear list members,

I am using the imageJ to produce radiometric images. The images are results
of division of two probes with different excitation wavelength.
Since the ration is in correlation to the parameter I interested, I'm
looking for a tool to replace the ration values with the parameter value by
entering the equation.

Any help will be greatly appreciated.

Thanks
Shilo

 

--
View this message in context: http://n2.nabble.com/entering-an-equation-tp2183006p2183006.html
Sent from the ImageJ mailing list archive at Nabble.com.



     
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

dscho
In reply to this post by shilo2
Hi,

On Mon, 19 Jan 2009, shilo2 wrote:

> I am using the imageJ to produce radiometric images. The images are
> results of division of two probes with different excitation wavelength.
> Since the ration is in correlation to the parameter I interested, I'm
> looking for a tool to replace the ration values with the parameter value
> by entering the equation.

I may misunderstand you, so I repeat in my own words what I think you were
saying.  Please correct me if I am wrong.

You acquire two images, and then call the ImageCalculator to divide one by
the other image.  You would expect the result to be a constant factor, but
then you want to multiply the second image with another number?

Ciao,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

dpoburko
In reply to this post by shilo2
shilo2 wrote:

> Dear list members,
>
> I am using the imageJ to produce radiometric images. The images are results
> of division of two probes with different excitation wavelength.
> Since the ration is in correlation to the parameter I interested, I'm
> looking for a tool to replace the ration values with the parameter value by
> entering the equation.
>
> Any help will be greatly appreciated.
>
> Thanks
> Shilo
>
>    
>
>  
Hi Shilo,

  Have you seen the Fura2 ratio plugin (
http://rsb.info.nih.gov/ij/plugins/ratio-plus.html )? I haven't gone
through the entire code, but you should be able to hack this, and
replace the final calibration calculation with your probe's calibration
formula.

Damon
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

shilo2
Hi Damon
Thank you for your replay.

Unfortunately, I am not familiar with macros so I don't know how to changed
the equation in
the ration plus plugin.

Shilo




On Tue, Jan 20, 2009 at 1:45 AM, Damon Poburko <[hidden email]>wrote:

> shilo2 wrote:
>
>> Dear list members,
>>
>> I am using the imageJ to produce radiometric images. The images are
>> results
>> of division of two probes with different excitation wavelength.
>> Since the ration is in correlation to the parameter I interested, I'm
>> looking for a tool to replace the ration values with the parameter value
>> by
>> entering the equation.
>>
>> Any help will be greatly appreciated.
>>
>> Thanks
>> Shilo
>>
>>
>>
>>
> Hi Shilo,
>
>  Have you seen the Fura2 ratio plugin (
> http://rsb.info.nih.gov/ij/plugins/ratio-plus.html )? I haven't gone
> through the entire code, but you should be able to hack this, and replace
> the final calibration calculation with your probe's calibration formula.
>
> Damon
>
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

dscho
In reply to this post by shilo2
Hi,



[really re-adding the list, as this might be useful for others, too.]


On Tue, 20 Jan 2009, shay ros wrote:

> Yes you are right, I use the calculator plus to divide two images. The
> values (ratio) that I get are changed according to the concentration of
> a specific chemical.
>
> Since the real concentration is in correlation to the ration values I
> would like two produce images that the value will be the concentration
> (in % from control ).
>
> For that purpose I have two enter an equation. For example: if X is the
> ratio value
>
> Concentarion = x-0.6/(0.5*x+0.3)

So you want this for every pixel, right?

The easiest way to do that is IMHO to use the macro language:

-- snip --
// make sure that the values are floating point (high precision)
run("32-bit");

// iterate over all pixels
for (y = 0; y < getHeight(); y++)
        for (x = 0; x < getWidth(); x++) {
                value = getPixel(x, y);
                // evaluate the formula
                newValue = value - 0.5 / (0.5 * x + 0.3);
                setPixel(x, y, newValue);
        }
-- snap --

Note that I talk about a formula here.  A free-form equation -- something
like "cos(newValue) = sin(value)" -- would require third-party libraries
to solve the equation (such as Yacas or Jasymca, or SymPy via Jython), and
therefore you'd need to use another scripting language, such as
Javascript, Jython, JRuby or Clojure (see
http://pacific.mpi-cbg.de/wiki/index.php/Category:Scripting).

Hth,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

Wayne Rasband
In reply to this post by shilo2
> Dear list members,
>
> I am using the imageJ to produce radiometric images. The images are  
> results
> of division of two probes with different excitation wavelength.
> Since the ration is in correlation to the parameter I interested, I'm
> looking for a tool to replace the ration values with the parameter  
> value by
> entering the equation.

ImageJ 1.42h, due next week, will have a Process>Math>Equation command  
where you can enter an equation, such as

    v2=v1-0.6/(0.5*v1+0.3)

that will be applied to all the pixels in the image. This will be  
equivalent to running the macro:

   for (y=0; y<getHeight; y++) {
     for (x=0; x<getWidth; x++) {
       v1=getPixel(x,y);
       v2=v1-0.6/(0.5*v1+0.3)
       setPixel(x,y,v2)
     }
   }

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

shilo2
Thank you very much

*This is exactly what I am looking for.*

 shilo
On Tue, Jan 20, 2009 at 3:46 PM, Rasband Wayne <[hidden email]> wrote:

>  Dear list members,
>>
>> I am using the imageJ to produce radiometric images. The images are
>> results
>> of division of two probes with different excitation wavelength.
>> Since the ration is in correlation to the parameter I interested, I'm
>> looking for a tool to replace the ration values with the parameter value
>> by
>> entering the equation.
>>
>
> ImageJ 1.42h, due next week, will have a Process>Math>Equation command
> where you can enter an equation, such as
>
>   v2=v1-0.6/(0.5*v1+0.3)
>
> that will be applied to all the pixels in the image. This will be
> equivalent to running the macro:
>
>  for (y=0; y<getHeight; y++) {
>    for (x=0; x<getWidth; x++) {
>      v1=getPixel(x,y);
>      v2=v1-0.6/(0.5*v1+0.3)
>      setPixel(x,y,v2)
>    }
>  }
>
> -wayne
>
Reply | Threaded
Open this post in threaded view
|

Re: entering an equation

dscho
In reply to this post by Wayne Rasband
Hi,

On Tue, 20 Jan 2009, Rasband Wayne wrote:

> ImageJ 1.42h, due next week, will have a Process>Math>Equation command
> where you can enter an equation, such as
>
>   v2=v1-0.6/(0.5*v1+0.3)
>
> that will be applied to all the pixels in the image. This will be
> equivalent to running the macro:
>
>  for (y=0; y<getHeight; y++) {
>    for (x=0; x<getWidth; x++) {
>      v1=getPixel(x,y);
>      v2=v1-0.6/(0.5*v1+0.3)
>      setPixel(x,y,v2)
>    }
>  }

Nice!

Thank you very much,
Dscho