ImageContainsSelection boolean?

Hello all,

Is there a way to know if an image contains a selection in imageJ macro format ?
I’m trying to batch export selections for a folder, but if the image doesn’t have a selection, my script stops running.

Thanks for your help !

Good day,

why don’t you search the “ImageJ User Guide” at:

There are several possibilities but I would prefer:

“Returns the selection type, where 0=rectangle, 1=oval, 2=polygon, 3=freehand, 4=traced, 5=straight line, 6=segmented line, 7=freehand line, 8=angle, 9=composite and 10=point. Returns -1 if there is no selection. For an example, see the ShowImageInfo macro.”



Thanks for the answer and for the link. I should have RTFM, sorry ! :wink: