Cells to Individual Images Plugin?

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

Cells to Individual Images Plugin?

gabejackson
Hello!

I was wondering if we have some sort of plugin to create individual images out of cells on a b/w thresholded image? Basically I just got an image from fluorescence microscopy and have the cells are seperated and would now like to create an image out of each cell instead of having them all on one image. Which algorithm or plugin?

Many thanks in advance for any help,

Greetings,

Gabe
Reply | Threaded
Open this post in threaded view
|

Re: Cells to Individual Images Plugin?

BenTupper
Hi,

The macro below will create a subimage for each particle listed in the  
results table.  If you don't have a recent copy of ImageJ you'll have  
to modify this line...

run("Specify...", "width=&bw height=&bh x=&bx y=&by");

to look something like this...

run("Specify...", "width="+bw+"height="+bh+"x="+bx+"y="+by");

Cheers,
Ben

run("Blobs (25K)");
origID = getImageID();
setAutoThreshold();
run("Set Measurements...", "  bounding display redirect=blobs.gif  
decimal=3");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00  
show=Nothing clear display record");

for (i=0; i<nResults(); i++){
        selectImage(origID);
        bx = getResult("BX",i);
        by = getResult("BY",i);
        bw = getResult("Width",i);
        bh = getResult("Height",i);
        run("Specify...", "width=&bw height=&bh x=&bx y=&by");
        run("Copy");
        run("Internal Clipboard");
        rename("sub-"+i);
}

On Jan 19, 2010, at 7:54 AM, gabejackson wrote:

> Hello!
>
> I was wondering if we have some sort of plugin to create individual  
> images
> out of cells on a b/w thresholded image? Basically I just got an  
> image from
> fluorescence microscopy and have the cells are seperated and would  
> now like
> to create an image out of each cell instead of having them all on  
> one image.
> Which algorithm or plugin?
>
> Many thanks in advance for any help,
>
> Greetings,
>
> Gabe
> --
> View this message in context: http://n2.nabble.com/Cells-to-Individual-Images-Plugin-tp4419810p4419810.html
> Sent from the ImageJ mailing list archive at Nabble.com.


Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|

Re: Cells to Individual Images Plugin?

Fabrice Senger
In reply to this post by gabejackson
gabejackson a écrit :

> Hello!
>
> I was wondering if we have some sort of plugin to create individual images
> out of cells on a b/w thresholded image? Basically I just got an image from
> fluorescence microscopy and have the cells are seperated and would now like
> to create an image out of each cell instead of having them all on one image.
> Which algorithm or plugin?
>
> Many thanks in advance for any help,
>
> Greetings,
>
> Gabe
>  
Hi there,
if you use analyse particles on your segmented image, with the option
add to ROI manager, each cell will appear in the ROI manager, if you
next run taht macro :

run("Misc...", "divide=Infinity hide");





title = getTitle;



// Get path to result directory

  result = getDirectory("result");





// Create a directory in temp

  myDir = result+title+File.separator;

  File.makeDirectory(myDir);

 



 setBatchMode(true);



myID = getImageID();

 n = roiManager("count");

 for (i=0; i<n; i++) {

     selectImage(myID);

     roiManager("select", i);

     run("Duplicate...", "duplicate range=0"  );

saveAs("tiff", myDir+getTitle+"_"+i+1);

run("Clear Outside");

 }

You will create a folder of single cells...

Fabrice.
Reply | Threaded
Open this post in threaded view
|

Re: Cells to Individual Images Plugin?

gabejackson
Awesome, thanks a million guys. works like a charm!

Greetings from Switzerland,

Gabe