programming ratiometric imaging : need help

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

programming ratiometric imaging : need help

Julien Husson-3
Dear Micro-Manager users,

the beanshell I was coding for ratiometric imaging is now working smoothly (horrah to Micro-Manager team again). Code would need some reasonable cleaning and tweeking to adapt it to another set-up, but I would be happy to send it from now on to any interested person.

For technical info my set-up is based on
a Nikon TiE inverted microscope with a Ludl filter wheel. I am using the Fura2AM ratiometric probe, acquiring for ratio at 340 and 380nm excitation wavelength, emitting on FITC channel.

Beanshell works as follows.
* A menu asks for acquisition specs (file name, number of frames, time between frames, exposure times etc).
* User is first defines a background ROI (btw
Beanshell handles subarray).
* User then defines a threshold to define cell/empty area (basically to avoid division by zero).
* Then the main loop acquires:
     - wavelength 1 image (340nm) and background level is measured,
     - wavelength 2 image (380nm)
and background level is measured,
     - wavelength 3 image (FITC)
     - transmission image
     - displays on a separate window the wavelength1/wavelength 2 ratio with appropriate LUT and range to have a live monitoring.
* I also have a simpler beanshell that gives a single ratio snapshot of the system to monitor before starting a fullacquisition.
* I handle stack postprocessing with image j macros.

Cheers,

Julien

On Tue, 09 Jun 2009 16:53:24 -0700, Damon Poburko wrote

> Dear Julien, Arthur and Nico,
>
>   This is looking great. I am guessing that there are a large number of micro-manager users out there that would be interested in a generic ratiometric imaging plugin for micro-manager. I'm suggesting that Julien's efforts be supported and expanded to create a generic ratiometric imaging plugin. I'm still trying to wrap my head around writing plugins, but I would be happy to help with this.
>    Also, I seem to recall a posting about creating a method to get a live trace of a given ROI during acquisition. I'm wondering if anyone is working on a generic plugin for this kind of functionality. I would think that it wouldn't be all that much different from the current line profile function. Again, I'm trying to get a feeling for what might already be available before re-inventing the wheel as it were.
>
> Cheers,
> Damon
>
> --
>
>
> Damon Poburko, PhD
> Postdoctoral Research Fellow
> Stanford University School of Medicine
> Dept. of Molecular & Cellular Physiology
> 279 Campus Dr., Beckman B103, Stanford, CA 94305
>
Ph: 650 725 7564, fax: 650 725 8021
> Arthur D. Edelstein wrote:
Dear 
Julien,

Here is an example for creating and ImageStack and displaying it in 
a
StackWindow:

import 
ij.*;
import 
ij.gui.*;

x1 = 
mmc.getImage();
x2 = 
mmc.getImage();
st = new 
ImageStack(512,512);
st.addSlice("",x1);
st.addSlice("",x2);
imgp = new 
ImagePlus("",st);
win = new 
StackWindow(imgp);

Best 
regards,
Arthur

On Mon, Jun 8, 2009 at 6:08 AM, Julien Husson[hidden email] 
wrote:
  
Dear Micro-Manager 
team,
thanks to your help I have a beanshell (see below for it's minimal 
version)
running and displaying ratio images obtained via the calculate method. 
However
images are separate. I would still need some little help to make each 
new
ratio image incorporated into a stack. I was guessing that if I remove 
the
"create" option in ic.calculate 
arguments
(
  ic.calculate("Divide create 32-bit", imgp1, 
imgp2);
), I would be able to access some image processor without displaying 
the
separate image ratio, then use the processor to add a slice to a main 
stack.
By now I did not make it, could you give me a 
hand?

Best,
Julien

import 
ij.*;
import 
ij.process.*;
import 
ij.gui.*;
import 
java.awt.*;
import 
ij.plugin.*;
import 
ij.plugin.filter.*;

channelGroup="Filter 
wheel";
wavelength1 = 
"340";
wavelength2 = 
"380";
int nframes = 
5;

for (int n=1; n<nframes; n++) 
{

mmc.setConfig(channelGroup, 
wavelength1);
mmc.waitForConfig(channelGroup, 
wavelength1);
mmc.snapImage();
img1 = 
mmc.getImage();

mmc.setConfig(channelGroup, 
wavelength2);
mmc.waitForConfig(channelGroup, 
wavelength2);
mmc.snapImage();
img2 = 
mmc.getImage();

width = 
mmc.getImageWidth();
height = 
mmc.getImageHeight();
byteDepth = 
mmc.getBytesPerPixel();

ip1 = new ShortProcessor((int)width, 
(int)height);
ip1.setPixels(img1);
ip2 = new ShortProcessor((int)width, 
(int)height);
ip2.setPixels(img2);

imgp1=new 
ImagePlus(wavelength1,ip1);
imgp2=new 
ImagePlus(wavelength2,ip2);
ic = new 
ImageCalculator();
ic.calculate("Divide create 32-bit", imgp1, 
imgp2);

};

--
Julien Husson, 
postdoc
Macromolécules et Microsystèmes en Biologie et en 
Médecine
Laboratoire Physico Chimie Curie - UMR 
168
Institut 
Curie
11 rue P. et M. Curie, 75231 PARIS Cedex 05, 
FRANCE
Tel : (33) (0) 1 56 24 67 
75
Fax : (33) (0) 1 40 51 06 
36
http://www.curie.fr/recherche/themes/detail_equipe.cfm/lang/_fr/id_equipe/69.htm

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for 
enterprises
looking to deploy the next generation of Solaris that includes the 
latest
innovations from Sun and the OpenSource community. Download a copy 
and
enjoy capabilities such as Networking, Storage and 
Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
micro-manager-general mailing 
list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

    
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day 
Trial
Check out the new simplified licensing option that enables 
unlimited
royalty-free distribution of the report engine for externally facing 

server and web 
deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
micro-manager-general mailing 
list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
  


--
Julien Husson, postdoc
Macromolécules et Microsystèmes en Biologie et en Médecine
Laboratoire Physico Chimie Curie - UMR 168
Institut Curie
11 rue P. et M. Curie, 75231 PARIS Cedex 05, FRANCE
Tel : (33) (0) 1 56 24 67 75
Fax : (33) (0) 1 40 51 06 36
http://www.curie.fr/equipe/69/lang/_gb

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general