Bug with ROI properties

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

Bug with ROI properties

lechristophe
Hi Wayne and the ImageJers,

There is something strange in the ROI properties. If I run this macro:

run("Select All");
roiManager("Add");
roiManager("select", roiManager("count")-1);
Roi.setProperty("TracingType", "" + 1);
// roiManager("select", roiManager("count")-1);
print(Roi.getName);
print(Roi.getProperties);
print(Roi.getProperty("TracingType"));

The output is :
0001-1024-1024
TracingType: 1
1

But if I re-select the ROI before asking for its properties (note the
uncommented line):

run("Select All");
roiManager("Add");
roiManager("select", roiManager("count")-1);
Roi.setProperty("TracingType", "" + 1);
roiManager("select", roiManager("count")-1);
print(Roi.getName);
print(Roi.getProperties);
print(Roi.getProperty("TracingType"));

Then the output is OK for the name, but the properties are now an empty
string:
0001-1024-1024

I use properties to "tag" ROIs between macros so right now the properties
are lost, due to this bug I think.

Thanks for your help,

Christophe

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

Re: Bug with ROI properties

Wayne Rasband-2
> On Feb 7, 2018, at 11:10 AM, Christophe Leterrier <[hidden email]> wrote:
>
> Hi Wayne and the ImageJers,
>
> There is something strange in the ROI properties. If I run this macro:

After making a change to an ROI you need to call roiManager("update”) to update the corresponding ROI on the ROI Manager.

   run("Select All");
  roiManager("Add");
  roiManager("select", roiManager("count")-1);
  Roi.setProperty("TracingType", "" + 1);
  roiManager("update”);
  roiManager("select", roiManager("count")-1);
  print(Roi.getName);
  print(Roi.getProperties);
  print(Roi.getProperty("TracingType"));

-wayne

> run("Select All");
> roiManager("Add");
> roiManager("select", roiManager("count")-1);
> Roi.setProperty("TracingType", "" + 1);
> // roiManager("select", roiManager("count")-1);
> print(Roi.getName);
> print(Roi.getProperties);
> print(Roi.getProperty("TracingType"));
>
> The output is :
> 0001-1024-1024
> TracingType: 1
> 1
>
> But if I re-select the ROI before asking for its properties (note the
> uncommented line):
>
> run("Select All");
> roiManager("Add");
> roiManager("select", roiManager("count")-1);
> Roi.setProperty("TracingType", "" + 1);
> roiManager("select", roiManager("count")-1);
> print(Roi.getName);
> print(Roi.getProperties);
> print(Roi.getProperty("TracingType"));
>
> Then the output is OK for the name, but the properties are now an empty
> string:
> 0001-1024-1024
>
> I use properties to "tag" ROIs between macros so right now the properties
> are lost, due to this bug I think.
>
> Thanks for your help,
>
> Christophe

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