parameters: (self, exp_number, scan_number, tag, file_name)
return_statement: return
docstring: save ROI to file
          Notice: the saved file is a mask file which masks the detectors out of ROI
          :param exp_number:
          :param scan_number:
          :param tag:
          :param file_name:
          :return:
docstring_summary: save ROI to file
          Notice: the saved file is a mask file which masks the detectors out of ROI
          :param exp_number:
          :param scan_number:
          :param tag:
          :param file_name:
          :return:
docstring_tokens: save ROI to file Notice : the saved file is a mask file which masks the detectors out of ROI : param exp_number : : param scan_number : : param tag : : param file_name : : return :
function: def save_roi_to_file(self, exp_number, scan_number, tag, file_name):
          """
          save ROI to file
          Notice: the saved file is a mask file which masks the detectors out of ROI
          :param exp_number:
          :param scan_number:
          :param tag:
          :param file_name:
          :return:
          """
          # check input
          assert isinstance(tag, str), 'Tag {0} shall be a string but not a {1}'.format(tag, type(tag))
          assert isinstance(file_name, str), 'File name {0} shall be a string but not a {1}' \
                                             ''.format(file_name, type(file_name))
  
          # get mask workspace name
          if tag in self._roiDict:
              mask_ws_name = self._roiDict[tag].mask_workspace
              if mask_ws_name is None or AnalysisDataService.doesExist(mask_ws_name) is False:
                  raise RuntimeError('Mask workspace {0} of tag {1} does not exist in ADS.'
                                     ''.format(mask_ws_name, tag))
          else:
              mask_ws_name = self.check_generate_mask_workspace(exp_number=exp_number, scan_number=scan_number,
                                                                mask_tag=tag, check_throw=True)
  
          # save
          mantidsimple.SaveMask(InputWorkspace=mask_ws_name, OutputFile=file_name)
  
          return
function_tokens: def save_roi_to_file ( self , exp_number , scan_number , tag , file_name ) : # check input assert isinstance ( tag , str ) , 'Tag {0} shall be a string but not a {1}' . format ( tag , type ( tag ) ) assert isinstance ( file_name , str ) , 'File name {0} shall be a string but not a {1}' '' . format ( file_name , type ( file_name ) ) # get mask workspace name if tag in self . _roiDict : mask_ws_name = self . _roiDict [ tag ] . mask_workspace if mask_ws_name is None or AnalysisDataService . doesExist ( mask_ws_name ) is False : raise RuntimeError ( 'Mask workspace {0} of tag {1} does not exist in ADS.' '' . format ( mask_ws_name , tag ) ) else : mask_ws_name = self . check_generate_mask_workspace ( exp_number = exp_number , scan_number = scan_number , mask_tag = tag , check_throw = True ) # save mantidsimple . SaveMask ( InputWorkspace = mask_ws_name , OutputFile = file_name ) return