RoiSet.zip to pixel values

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

RoiSet.zip to pixel values

Andrew Defries
Dear ImageJ users,

Do you have any suggestions regarding the conversion of an RoiSet.zip to
polyline pixels?

I would like to get the pixels of the drawn polyline so that I can send the
individual lines to RGL and perform transformations on the pixel values. I
noticed that the record macro detects the polyline as an object like below:

makeLine(2256,659,2242,703,2235,741,2225,761,2211,770);

But the macro does not show these values when I load an RoiSet from the zip
file. A general solution would be ideal since I use both the polyline and
elliptical selection tools.


Thank you very much,

Andrew


--
------------------------------------------------
Andrew Defries
Lab of Michael Pirrung
University of California Riverside
Botany and Plant Sciences
2150 Batchelor Hall
Riverside, CA 92521

(Phone)        951-827-6991

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RoiSet.zip to pixel values

Cammer, Michael
Perhaps this?

macro "Export ROIs as text" {
  convertROIsToText();
}
 
//=================================================================
macro "Export all ROI Sets in a directory" {  
  dir = getDirectory("Choose a Directory ");
  list = getFileList(dir);
  for (i=0; i<list.length; i++) {
     if (startsWith(list[i], "RoiSet")) {
       title = list[i];
       roiManager("Reset");
       open(dir + title);
       convertROIsToText();
     }
  }
  selectWindow("Log");
}  // Measure all ROI Sets in a directory

//==================================================================
function convertROIsToText() {
    for (i=0;  i<roiManager("count");  i++){
      roiManager("select", i);
      getSelectionCoordinates(xCoordinates, yCoordinates);
      print ("ROI #"+i+"  ============================");
      coordinates = "";
      for (k=0; k<xCoordinates.length; k++){
        coordinates = coordinates + xCoordinates[k] + ", " + yCoordinates[k];
        if (k < (xCoordinates.length-1)) coordinates = coordinates + ", ";
      } // for k
      print(coordinates);
    }  // for  i
  selectWindow("Log");
} // convertROIsToText()

________________________________________________________
Michael Cammer, Assistant Research Scientist
Skirball Institute of Biomolecular Medicine
Lab: (212) 263-3208  Cell: (914) 309-3270



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Andrew Defries
Sent: Sunday, January 06, 2013 12:45 AM
To: [hidden email]
Subject: RoiSet.zip to pixel values

Dear ImageJ users,

Do you have any suggestions regarding the conversion of an RoiSet.zip to polyline pixels?

I would like to get the pixels of the drawn polyline so that I can send the individual lines to RGL and perform transformations on the pixel values. I noticed that the record macro detects the polyline as an object like below:

makeLine(2256,659,2242,703,2235,741,2225,761,2211,770);

But the macro does not show these values when I load an RoiSet from the zip file. A general solution would be ideal since I use both the polyline and elliptical selection tools.


Thank you very much,

Andrew


--
------------------------------------------------
Andrew Defries
Lab of Michael Pirrung
University of California Riverside
Botany and Plant Sciences
2150 Batchelor Hall
Riverside, CA 92521

(Phone)        951-827-6991

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

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