ImageJ/Fiji XOR selection with overlays

I’m using ImageJ/Fiji.

$ ImageJ --headless --console -eval "print(getVersion());" | tail -n 1

Given two region of interest, I know how to select the XOR between the region of interest. In ROI Manager window, I will find the option XOR in the More menu.

I’m searching of how can I do the same if I’m using overlays. The overlay menu does not list the XOR operation.

I do not want to move selections between overlays and ROI. Any suggestion on how to perform the XOR operation? Thanks!

The ImageJ 1.53h20 daily build adds an Overlay.xor(indexes) macro function that creates a new ROI by XORing all the ROIs in the overlay with indexes in the array ‘indexes’. Here is an example:

  run("Blobs (25K)");
  makeOval(44, 31, 112, 106);
  makeOval(86, 74, 112, 106);



@Wayne, Thanks for the reply. I’m curious to see the macro source code. Can you message me the commit ID that has the macro source code for Overlay.xor()?

The commit can be found at Commits · imagej/imagej1 · GitHub.