Composite ROIs not saved RoiManager .zip files

Hello Forum,

I am using a macro that builds composite rois with the RoiManager using roiManager(“Combine”). When I save the rois through the RoiManager, and open the saved .zip folder, all of the composite rois are missing.

Is there a way to save my composite rois?
What’s special about composite rois that is preventing them from being saved?

Composite ROIs are saved in ROI Manager .zip files. The following macro creates two composite ROIs, adds them to the ROI Manager, saves them in a .zip file, and then re-opens and displays them.

   newImage("Untitled", "8-bit black", 512, 512, 1);
   makeOval(87, 60, 166, 160);
   roiManager("Add");
   makeOval(319, 92, 162, 176);
   roiManager("Add");
   makeOval(98, 303, 253, 150);
   roiManager("Add");
   roiManager("Combine");
   roiManager("Add");
   roiManager("Select", newArray(0,1));
   roiManager("Combine");
   roiManager("Add");
   roiManager("Deselect");
   dir = getDirectory("temp");
   roiManager("Save", dir+"RoiSet.zip");
   roiManager("Delete");
   roiManager("Open", dir+"RoiSet.zip");
   for (i=0; i<roiManager("count"); i++) {
      roiManager("select", i);
      wait(1000);
   }

Thanks @Wayne. Your are right. My mistake. I was testing the wrong folder.
I have noticed what might be a roi bug. It seems like when I open roi zip files, if properties keys have spaces, a ‘:’ appears when the properties are printed to the Log window. This doesn’t happen when properties are printed from a current RoiManager. This seems to prevent retrieving the property value. I edited your script to try and illustrate this.

newImage("Untitled", "8-bit black", 512, 512, 1);
makeOval(87, 60, 166, 160);
roiManager("Add");
roiManager("select", roiManager("count")-1);
print("on "+ roiManager("index"));
Roi.setProperty("property with spaces", 10);
Roi.setProperty("another property", "test");
roiManager("update");
roiManager("Deselect");
makeOval(319, 92, 162, 176);
roiManager("Add");
roiManager("select", roiManager("count")-1);
print("on "+ roiManager("index"));
Roi.setProperty("property with spaces", "Test Property");
Roi.setProperty("another property", "test2");
roiManager("update");
roiManager("Deselect");
wait(1000);

for(i=0; i<roiManager("count"); i++) {
    roiManager("select", i);
    print("roi test: "+Roi.getName()+"  "+Roi.getProperties());
	roiManager("Deselect");   
    wait(1000);
   }
dir = getDirectory("temp");
roiManager("Save", dir+"RoiSet2.zip");

If the newly created rois in a separate program, the previous assigned property appears with print( Roi.getProperties() ) but won’t from Roi.getProperty("key")

newImage("Untitled", "8-bit black", 512, 512, 1);
dir = "C:\\Users\\alpeterson7\\Desktop\\";
//dir = getDirectory("temp");

roiManager("Open", dir+"RoiSet2.zip");
for (i=0; i<roiManager("count"); i++) {
    roiManager("select", i);
    roiManager("rename", "new name"+i);
    print("roi test: "+Roi.getName()+"  "+Roi.getProperties());
    wait(1000);
   }

for (f=0; f<roiManager("count"); f++) {
    roiManager("select", f);
    key_test = Roi.getProperty("property: with spaces");
    print("retrieved property" +"  "+key_test);
    wait(1000);
   }

I won’t be writing spaces into my properties keys in the future, but I am curious why this might be happening. Any insights? Is there still a way to retrieve these property values?
-thanks

ImageJ does not support ROI properties with keys containing spaces. Roi.setProperty(key,value) will abort the macro in the next version of ImageJ if the key contains a space.