Request additional flag for ImageGenerateRoIMask

I am adding various drawing groups programmatically to an image. I'd like to be able to select certain ones for the masking operation.

In essence, I'd like to have an additional flag for ImageGenerateROIMask along this line.

ImageGenerateRoIMask/W=.../I=.../E=.../G=groupname

    /G   selects the drawing group named groupname from the ProgFront layer

 

Here is a sample code that shows the desired benefit.

// current approach to remove drawing that is not to be used in mask
// another option is to move the drawing to a different layer (e.g. Overlayer) and back to ProgFront
// could also repeat the steps on a group list gList

Function toggle_group(string wname, string gname)

    string gCMD = "DoWindow/F " + wname + ";SetDrawLayer ProgFront;DrawAction begininsert;"

    DrawAction/W=$wname/L=ProgFront getgroup=$gname, commands
    gCMD += ReplaceString("\r",ReplaceString("\t",GrepList(S_recreation,"^// ;*",1,"\r"),""),";")
    DrawAction/W=$wname/L=overlay getgroup=$gname, delete

    DoUpdate/W=$wname

// perform the image mask operation

    ImageGenerateROIMask/W=wname imageinstance

// return the removed drawing

    Execute/Z gCMD
   
    return 0
end

// desired approach

Function mask_onlygroup(string wname, string gname)

// perform the image mask operation

    ImageGenerateROIMask/W=wname/G=gname imageinstance
   
    return 0
end