Write mask image to script's working directory
This MR sets the output mask filename to a local path to avoid needing write permission to the input image directory.
This MR sets the output mask filename to a local path to avoid needing write permission to the input image directory.