trackmate

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

trackmate

Aryeh Weiss
I was wondering if there is a way to get an roiset of each track out of
trackmate. Since I did not hear otherwise, I wrote a macro to
demonstrate this idea, reproduced below. It uses two tables that
trackmate generates:
"Track statistics"                    in order to get the number of
spots in each track
"Spots in tracks statistics"     in order to get the positions (in space
and time) and size of the spots.

I have some questions about this:

1. Is there the "complement" of the "Array.show("title", array1, array2,
...)" ? I mean , just as Array.show() loads an array into a results
table (actually, any results table), is there a command that will read
an entire column from a results table?

2. In my macro I use IJ.renameResults() to rename the tables to be
called "Results", so that I can use getResult() on them. Is there a way
to read the results from these tables without remaining them to "Results"?

Thanks in advance.
--aryeh

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051

Macro follows:

//=============================================================
// get number of spots in each track
// have to rename to Results
IJ.renameResults("Track statistics", "Results");
trackLengths = newArray(nResults);
numberOfTracks = nResults;
for (i=0; i < numberOfTracks; i++){
     trackLengths[i] = getResult("NUMBER_SPOTS", i);
     print( trackLengths[i]);
}
IJ.renameResults("Results", "Track statistics");

// now read the "Spots in tracks statistics" table to get the positions
of each spot in each track.
// populate an ROI list from these spots.
// we could also save a separate ROI list for each track.
IJ.renameResults("Spots in tracks statistics", "Results");

//maxTrack = getResult("TRACK_ID");
//print(maxTrack);
trackIndex = 0;
for (i= 0; i<numberOfTracks; i++){

     for (j=0; j<trackLengths[i]; j++) {
         spotLocX = getResult("POSITION_X", trackIndex+j);
         spotLocY = getResult("POSITION_Y", trackIndex+j);
         spotLocT = getResult("FRAME", trackIndex+j);
         spotDiameter = 2*getResult("RADIUS", trackIndex+j);
         setSlice(spotLocT+1);
         makeOval(spotLocX-spotDiameter/2, spotLocY-spotDiameter/2,
spotDiameter, spotDiameter);
         roiManager("Add");
         roiManager("select", roiManager("count")-1);
         roiManager("Rename", "Track_"+d2s(i,0)+"_spot_"+d2s(j,0));
         roiManager("deselect") ;
     }
     trackIndex = trackIndex + trackLengths[i];
}
IJ.renameResults("Results", "Spots in tracks statistics");

//======================================================================




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