; @Dataset(label="Classification",description="Image of classification labels") class-img
; @File(label="Save to ROI filename", style="save") roi-filename

(ns lymphatic-junctions.scripts.roi-exclusion)

(refer 'user)

(let [gd (ij.gui.NonBlockingGenericDialog. "ROI exclusion")
      rm (ij.plugin.frame.RoiManager/getRoiManager)]
     (.enableYesNoCancel gd "Done" "Quit")
     (.showDialog gd)
     (ij.IJ/setTool "freehand")
     (loop []
           (when-not (or (.wasCanceled gd)
                         (.wasOKed gd))
            (Thread/sleep 20)))
     (.runCommand rm "Save" (.getAbsolutePath roi-filename)))
