Example #1
0
   def get_valid_opts(self):
      """return an OptionsList of valid program options"""

      # terminal, informative options
      vopts = OPT.OptionList('uber_subject.py options')
      vopts.add_opt('-help', 0, [], helpstr='show this help')
      vopts.add_opt('-help_gui', 0, [], helpstr='show help for GUI')
      vopts.add_opt('-help_todo', 0, [], helpstr='show todo list')
      vopts.add_opt('-help_howto_program',0,[],helpstr='programming overview')
      vopts.add_opt('-hist', 0, [], helpstr='show revision history')
      vopts.add_opt('-show_default_vars',0,[],helpstr='show variable defaults')
      vopts.add_opt('-show_valid_opts',0,[],helpstr='show all valid options')
      vopts.add_opt('-ver', 0, [], helpstr='show module version')

      vopts.add_opt('-verb', 1, [], helpstr='set verbose level')

      vopts.add_opt('-no_gui', 0, [], helpstr='do not open graphical interface')
      vopts.add_opt('-qt_opts',-1, [],helpstr='pass the given options to PyQt')

      vopts.add_opt('-print_script', 0, [], helpstr='print align test script')
      vopts.add_opt('-save_script', 1, [], helpstr='save align test script')
      vopts.add_opt('-cvar', -2, [], helpstr='set control variable')
      vopts.add_opt('-uvar', -2, [], helpstr='set user variable to value')

      vopts.trailers = 0   # do not allow unknown options

      return vopts
Example #2
0
   def get_valid_opts(self):
      vopts = OL.OptionList('valid opts')

      # short, terminal arguments
      vopts.add_opt('-help', 0, [], helpstr='display program help')
      vopts.add_opt('-help_examples', 0, [], helpstr='display program examples')
      vopts.add_opt('-hist', 0, [], helpstr='display the modification history')
      vopts.add_opt('-ver', 0, [], helpstr='display the current version number')

      # general options
      vopts.add_opt('-labels', -1, [],
                    helpstr='specify labels to search for')
      vopts.add_opt('-logfile', 1, [],
                    helpstr='specify input label table log file')
      vopts.add_opt('-show_all_orig', 0, [],
                    helpstr='show all unranked indices, even if not found')
      vopts.add_opt('-show_orig', 0, [],
                    helpstr='only show unranked indices')
      vopts.add_opt('-show_rank', 0, [],
                    helpstr='only show ranked indices')
      vopts.add_opt('-verb', 1, [], helpstr='set the verbose level (def=1)')

      vopts.sort()

      return vopts
Example #3
0
    def get_valid_opts(self):
        vopts = OL.OptionList('valid opts')

        # short, terminal arguments
        vopts.add_opt('-help', 0, [], helpstr='display program help')
        vopts.add_opt('-hist',
                      0, [],
                      helpstr='display the modification history')
        vopts.add_opt('-ver',
                      0, [],
                      helpstr='display the current version number')

        # general options
        vopts.add_opt('-infiles', -1, [], helpstr='specify input files')
        vopts.add_opt('-overwrite',
                      0, [],
                      helpstr='flag to overwrite any existing output files')
        vopts.add_opt('-prefix',
                      1, [],
                      helpstr='specify prefix for output files')
        vopts.add_opt('-verb', 1, [], helpstr='set the verbose level (def=1)')

        vopts.sort()

        return vopts
Example #4
0
    def init_options(self):
        self.valid_opts = OL.OptionList('valid opts')

        # terminal options
        self.valid_opts.add_opt('-help', 0, [], helpstr='display program help')
        self.valid_opts.add_opt('-help_dot_files',
                                0, [],
                                helpstr='display help on shell setup files')
        self.valid_opts.add_opt('-help_rc_files',
                                0, [],
                                helpstr='display help on shell setup files')
        self.valid_opts.add_opt('-hist',
                                0, [],
                                helpstr='display the modification history')
        self.valid_opts.add_opt('-show_valid_opts',
                                0, [],
                                helpstr='display all valid options')
        self.valid_opts.add_opt('-todo',
                                0, [],
                                helpstr='display the current "todo list"')
        self.valid_opts.add_opt('-ver',
                                0, [],
                                helpstr='display the current version number')

        # action options
        self.valid_opts.add_opt(
            '-casematch',
            1, [],
            acplist=['yes', 'no'],
            helpstr='yes/no: specify case sensitivity in -find_prog')
        self.valid_opts.add_opt('-check_all',
                                0, [],
                                helpstr='perform all system checks')
        self.valid_opts.add_opt('-data_root',
                                1, [],
                                helpstr='directory to check for class data')
        self.valid_opts.add_opt('-dot_file_list',
                                0, [],
                                helpstr='list found dot files')
        self.valid_opts.add_opt(
            '-dot_file_pack',
            1, [],
            helpstr='package dot files into given tgz package')
        self.valid_opts.add_opt('-dot_file_show',
                                0, [],
                                helpstr='display contents of dot files')
        self.valid_opts.add_opt(
            '-exact',
            1, [],
            acplist=['yes', 'no'],
            helpstr='yes/no: use exact matching in -find_prog')
        self.valid_opts.add_opt('-find_prog',
                                1, [],
                                helpstr='search path for *PROG*')
        self.valid_opts.add_opt('-verb',
                                1, [],
                                helpstr='set verbosity level (default=1)')

        return 0
Example #5
0
    def init_opts(self):
        global g_help_string
        self.valid_opts = option_list.OptionList('for input')

        # short, terminal arguments
        self.valid_opts.add_opt('-help', 0, [],      \
                        helpstr='display program help')
        self.valid_opts.add_opt('-hist', 0, [],      \
                        helpstr='display the modification history')
        self.valid_opts.add_opt('-show_valid_opts', 0, [], \
                        helpstr='display all valid options')
        self.valid_opts.add_opt('-ver', 0, [],       \
                        helpstr='display the current version number')

        # required arguments
        self.valid_opts.add_opt('-infiles',
                                -1, [],
                                req=1,
                                helpstr='input files (containing BOLD curve)')

        # optional arguments
        self.valid_opts.add_opt('-kernel',
                                1, [],
                                helpstr='response kernel [GAM])')

        self.valid_opts.add_opt(
            '-kernel_file',
            1, [],
            helpstr='file for reponse kernel [resp_kernel.1D]')

        self.valid_opts.add_opt('-mask_dset',
                                1, [],
                                helpstr='computational mask dataset')

        self.valid_opts.add_opt('-old',
                                0, [],
                                helpstr='generate script with old method')

        self.valid_opts.add_opt('-outdir',
                                1, [],
                                helpstr='specify output directory')

        self.valid_opts.add_opt('-prefix',
                                1, [],
                                helpstr='prefix for deconvolved dataset')

        self.valid_opts.add_opt('-script',
                                1, [],
                                req=1,
                                helpstr='output script filename')

        self.valid_opts.add_opt('-tr',
                                1, [],
                                helpstr='specify TR for 3dDeconvolve command')
        self.valid_opts.add_opt(
            '-tr_nup', 1, [], helpstr='upsample TR factor, e.g. 20 (=2.0/0.1)')

        self.valid_opts.add_opt(
            '-verb', 1, [], helpstr='verbose level (0=quiet, 1=default, ...)')
Example #6
0
    def init_opts(self):
        global g_help_string
        self.valid_opts = option_list.OptionList('for input')

        # short, terminal arguments
        self.valid_opts.add_opt('-help', 0, [],      \
                        helpstr='display program help')
        self.valid_opts.add_opt('-hist', 0, [],      \
                        helpstr='display the modification history')
        self.valid_opts.add_opt('-show_valid_opts', 0, [], \
                        helpstr='display all valid options')
        self.valid_opts.add_opt('-ver', 0, [],       \
                        helpstr='display the current version number')

        # required arguments
        self.valid_opts.add_opt('-dsets',
                                -1, [],
                                req=1,
                                helpstr='list of input datasets')

        # optional arguments
        self.valid_opts.add_opt('-script',
                                1, [],
                                helpstr='name for output script')
        self.valid_opts.add_opt(
            '-verb', 1, [], helpstr='verbose level (0=quiet, 1=default, ...)')
        self.valid_opts.add_opt('-windows',
                                -1, [],
                                acplist=['axial', 'coronal', 'sagittal'],
                                helpstr='choose afni image windows to display')

        # corrdinate arguments
        self.valid_opts.add_opt('-im_size',
                                2, [],
                                helpstr='image size, in pixels (2 integers)')
        self.valid_opts.add_opt('-im_xoff',
                                1, [],
                                helpstr='x-offset for image, in pixels')
        self.valid_opts.add_opt('-im_yoff',
                                1, [],
                                helpstr='y-offset for image, in pixels')

        self.valid_opts.add_opt('-gr_size',
                                2, [],
                                helpstr='graph size, in pixels (2 integers)')
        self.valid_opts.add_opt('-gr_xoff',
                                1, [],
                                helpstr='x-offset for graph, in pixels')
        self.valid_opts.add_opt('-gr_yoff',
                                1, [],
                                helpstr='y-offset for graph, in pixels')
Example #7
0
   def init_options(self):
      """return an option list instance"""

      valid_opts = OL.OptionList('valid opts')

      # short, terminal arguments
      valid_opts.add_opt('-help', 0, [],
                      helpstr='display program help')
      valid_opts.add_opt('-hist', 0, [],
                      helpstr='display the modification history')
      valid_opts.add_opt('-show_valid_opts', 0, [],
                      helpstr='display all valid options')
      valid_opts.add_opt('-ver', 0, [],
                      helpstr='display the current version number')

      # general options
      valid_opts.add_opt('-verb', 1, [],
                      helpstr='set the verbose level (default is 1)')

      valid_opts.add_opt('-data_choice', 1, [],
                      helpstr='which data to send (motion, motion_norm,...)')
      valid_opts.add_opt('-dc_params', -2, [],
                      helpstr='set parameters for data_choice processing')
      valid_opts.add_opt('-extras_on_one_line', 1, [],
                      acplist=['no', 'yes'],
                      helpstr='print sets of data each on only 1 line')
      valid_opts.add_opt('-serial_port', 1, [],
                      helpstr='serial port filename (e.g. /dev/ttyS0 or COM1)')
      valid_opts.add_opt('-show_data', 1, [],
                      acplist=['no', 'yes'],
                      helpstr='whether to display received data in terminal')
      valid_opts.add_opt('-show_comm_times', 0, [],
                      helpstr='display communication times')
      valid_opts.add_opt('-write_text_data', 1, [],
                      helpstr='write data to text file')

      # demo options
      valid_opts.add_opt('-show_demo_data', 1, [],
                      acplist=['no', 'yes'],
                      helpstr='whether to display demo data in terminal')
      valid_opts.add_opt('-show_demo_gui', 1, [],
                      acplist=['no', 'yes'],
                      helpstr='whether to display demo data in a GUI')

      valid_opts.add_opt('-swap', 0, [],
                      helpstr='byte-swap numerical reads')
      valid_opts.add_opt('-tcp_port', 1, [],
                      helpstr='TCP port for incoming connections')

      return valid_opts
Example #8
0
    def get_valid_opts(self):
        """return an OptionsList of valid program options"""

        # terminal, informative options
        vopts = OPT.OptionList('uber_subject.py options')
        vopts.add_opt('-help', 0, [], helpstr='show this help')
        vopts.add_opt('-help_gui', 0, [], helpstr='show help for GUI')
        vopts.add_opt('-help_todo', 0, [], helpstr='show todo list')
        vopts.add_opt('-hist', 0, [], helpstr='show revision history')
        vopts.add_opt('-show_default_vars',
                      0, [],
                      helpstr='show variable defaults')
        vopts.add_opt('-show_valid_opts',
                      0, [],
                      helpstr='show all valid options')
        vopts.add_opt('-show_cvar_dict',
                      0, [],
                      helpstr='show control var dict')
        vopts.add_opt('-show_uvar_dict',
                      0, [],
                      helpstr='show user var dictionary')
        vopts.add_opt('-ver', 0, [], helpstr='show module version')

        vopts.add_opt('-verb', 1, [], helpstr='set verbose level')

        vopts.add_opt('-no_gui',
                      0, [],
                      helpstr='do not open graphical interface')
        vopts.add_opt('-qt_opts',
                      -1, [],
                      helpstr='pass the given options to PyQt')

        vopts.add_opt('-print_script',
                      0, [],
                      helpstr='print align test script')
        vopts.add_opt('-save_script', 1, [], helpstr='save align test script')
        vopts.add_opt('-cvar', -2, [], helpstr='set control variable')
        vopts.add_opt('-uvar', -2, [], helpstr='set user variable to value')

        vopts.trailers = 0  # do not allow unknown options

        # add user and control vars directly
        for dict in [LTT.g_cvar_dict, LTT.g_uvar_dict]:
            keys = list(dict.keys())
            keys.sort()
            for name in keys:
                if name == 'verb': continue  # already included
                vopts.add_opt('-' + name, -1, [], helpstr=dict[name])

        return vopts
Example #9
0
   def get_valid_opts(self):
      vopts = OL.OptionList('valid opts')

      # short, terminal arguments
      vopts.add_opt('-help', 0, [], helpstr='display program help')
      vopts.add_opt('-hist', 0, [], helpstr='display the modification history')
      vopts.add_opt('-ver', 0, [], helpstr='display the current version number')

      # general options
      vopts.add_opt('-infiles', -1, [],
                    helpstr='input text files (from @ss_review_basic)')
      vopts.add_opt('-overwrite', 0, [],
                    helpstr='allow overwrite for output table file')
      vopts.add_opt('-report_outliers', -2, [],
                    helpstr='report outlier subjects for test')
      vopts.add_opt('-report_outliers_fill_style', 1, [],
                    acplist=self.ro_valid_fills,
                    helpstr='how to fill empty (non-outlier) entries')
      vopts.add_opt('-report_outliers_header_style', 1, [],
                    acplist=self.ro_valid_heads,
                    helpstr='how to format column headers')
      vopts.add_opt('-separator', 1, [],
                    helpstr="specify field separator (default=':')")
      vopts.add_opt('-outlier_sep', 1, [],
                    helpstr="output field separator (default=tab)")
      vopts.add_opt('-showlabs', 0, [],
                    helpstr='show list of labels found')
      vopts.add_opt('-show_infiles', 0, [],
                    helpstr='make tablefile output start with input files')
      vopts.add_opt('-show_missing', 0, [],
                    helpstr='show all missing keys')
      vopts.add_opt('-write_outliers', 1, [],
                    helpstr='file name for outlier table (default=stdout)')
      vopts.add_opt('-write_table', 1, [],
                    helpstr='file name for output table (dupe for -tablefile)')
      vopts.add_opt('-tablefile', 1, [],
                    helpstr='file name for output table')
      vopts.add_opt('-verb', 1, [], helpstr='set the verbose level (def=1)')

      vopts.sort()

      return vopts
Example #10
0
    def get_valid_opts(self):
        vopts = OPT.OptionList('valid opts')

        # short, terminal arguments
        vopts.add_opt('-help', 0, [], helpstr='display program help')
        vopts.add_opt('-hist',
                      0, [],
                      helpstr='display the modification history')
        vopts.add_opt('-show_default_cvars',
                      0, [],
                      helpstr='show default cvars')
        vopts.add_opt('-show_default_uvars',
                      0, [],
                      helpstr='show default uvars')
        vopts.add_opt('-show_valid_opts',
                      0, [],
                      helpstr='display all valid options')
        vopts.add_opt('-ver',
                      0, [],
                      helpstr='display the current version number')

        vopts.add_opt('-cvar', -2, [], helpstr='set control variable')
        vopts.add_opt('-uvar', -2, [], helpstr='set user variable to value')

        # general options
        vopts.add_opt('-on_surface',
                      1, [],
                      acplist=['yes', 'no'],
                      helpstr='work directly on the surface (yes/no)')
        vopts.add_opt('-print_script',
                      0, [],
                      helpstr='print script to terminal window')
        vopts.add_opt('-save_script',
                      1, [],
                      helpstr='write script to given file')
        vopts.add_opt('-verb',
                      1, [],
                      helpstr='set the verbose level (default=1)')

        return vopts
Example #11
0
   def init_options(self):
      self.valid_opts = OL.OptionList('valid opts')

      # short, terminal arguments
      self.valid_opts.add_opt('-help', 0, [],           \
                      helpstr='display program help')
      self.valid_opts.add_opt('-hist', 0, [],           \
                      helpstr='display the modification history')
      self.valid_opts.add_opt('-show_valid_opts', 0, [],\
                      helpstr='display all valid options')
      self.valid_opts.add_opt('-ver', 0, [],            \
                      helpstr='display the current version number')

      # required parameters
      self.valid_opts.add_opt('-infile', 1, [], 
                      helpstr='read the given 1D file')

      # general options
      self.valid_opts.add_opt('-verb', 1, [], 
                      helpstr='set the verbose level (default is 1)')

      return 0
Example #12
0
def get_valid_opts():
   """return an OptionsList of valid program options"""

   # terminal, informative options
   vopts = OPT.OptionList('uber_subject.py options')
   vopts.add_opt('-help', 0, [], helpstr='show this help')
   vopts.add_opt('-help_gui', 0, [], helpstr='show help for GUI')
   vopts.add_opt('-help_howto_program', 0, [], helpstr='help for programming')
   vopts.add_opt('-help_install', 0, [], helpstr='show install notes')
   vopts.add_opt('-help_install_nokia', 0, [], helpstr='Nokia install help')
   vopts.add_opt('-hist', 0, [], helpstr='show revision history')
   vopts.add_opt('-show_default_vars',0,[],helpstr='show variable defaults')
   vopts.add_opt('-show_valid_opts',0,[],helpstr='show all valid options')
   vopts.add_opt('-show_svar_dict',0,[],helpstr='show subject var dictionary')
   vopts.add_opt('-ver', 0, [], helpstr='show module version')

   vopts.add_opt('-verb', 1, [], helpstr='set verbose level')

   vopts.add_opt('-no_gui', 0, [], helpstr='do not open graphical interface')
   vopts.add_opt('-qt_opts', -1, [], helpstr='pass the given options to PyQt')
   vopts.add_opt('-print_ap_command',0,[],helpstr='show afni_proc.py script')
   vopts.add_opt('-save_ap_command',1,[],helpstr='save afni_proc.py script')
   vopts.add_opt('-exec_ap_command',0,[],helpstr='run afni_proc.py command')
   vopts.add_opt('-exec_proc_script',0,[],helpstr='run proc script')
   vopts.add_opt('-cvar', -2, [], helpstr='set control variable to value')
   vopts.add_opt('-svar', -2, [], helpstr='set subject variable to value')

   # and add all subject vars directly
   keys = list(USUBJ.g_svar_dict.keys())
   keys.sort()
   for name in keys:
      vopts.add_opt('-'+name, -1, [], helpstr=USUBJ.g_svar_dict[name])

   vopts.trailers = 0   # do not allow unknown options

   return vopts
Example #13
0
def get_opts():
    global g_help_string
    okopts = option_list.OptionList('for input')
    okopts.add_opt('-help', 0, [],      \
                   helpstr='display program help')
    okopts.add_opt('-hist', 0, [],      \
                   helpstr='display the modification history')
    okopts.add_opt('-show_valid_opts', 0, [],   \
                   helpstr='display all valid options')
    okopts.add_opt('-ver', 0, [],       \
                   helpstr='display the current version number')

    okopts.add_opt('-amplitudes', 0, [],        \
                   helpstr='output is in -stim_times_AM1 format')
    okopts.add_opt('-files',
                   -1, [],
                   req=1,
                   okdash=0,
                   helpstr='set the list of input files')
    okopts.add_opt('-prefix', 1, [], req=1,     \
                   helpstr='specify the prefix for output files')
    okopts.add_opt('-tr', 1, [], req=1, \
                   helpstr='set the TR time, in seconds')
    okopts.add_opt('-nt', 1, [], req=0, \
                   helpstr='set the number of TRs per run')
    okopts.add_opt('-nruns', 1, [], req=0,      \
                   helpstr='set the number of runs')
    okopts.add_opt('-no_consec', 0, [],    \
                   helpstr='do not allow consecutive events')
    okopts.add_opt('-offset', 1, [],    \
                   helpstr='specify offset to add to all output times')
    okopts.add_opt('-run_trs', -1, [], req=0,      \
                   helpstr='specify TRs per run, if they vary')
    okopts.add_opt('-labels',
                   -1, [],
                   okdash=0,
                   helpstr='add these labels to the file names')
    okopts.add_opt('-verb', 1, [],      \
                   helpstr='set the verbosity level')
    okopts.trailers = 1

    # process any optlist_ options
    okopts.check_special_opts(sys.argv)

    # if argv has only the program name, or user requests help, show it
    if len(sys.argv) <= 1 or '-help' in sys.argv:
        print(g_help_string)
        return

    if '-hist' in sys.argv:  # print history
        print(g_mst_history)
        return

    if '-show_valid_opts' in sys.argv:  # show all valid options
        okopts.show('', 1)
        return

    if '-ver' in sys.argv:  # print version
        print(g_mst_version)
        return

    opts = option_list.read_options(sys.argv, okopts)

    return opts
Example #14
0
   def init_options(self):
      self.valid_opts = OL.OptionList('valid opts')

      # short, terminal arguments
      self.valid_opts.add_opt('-help', 0, [],           \
                         helpstr='display program help')
      self.valid_opts.add_opt('-help_gui', 0, [],       \
                         helpstr='display program help')
      self.valid_opts.add_opt('-hist', 0, [],           \
                         helpstr='display the modification history')
      self.valid_opts.add_opt('-show_valid_opts', 0, [],\
                         helpstr='display all valid options')
      self.valid_opts.add_opt('-test', 0, [],           \
                         helpstr='run a basic test with known files')
      self.valid_opts.add_opt('-test_libs', 0, [],           \
                         helpstr='test for existence of neede python libraries')
      self.valid_opts.add_opt('-ver', 0, [],            \
                         helpstr='display the current version number')

      # computational options
      self.valid_opts.add_opt('-load_xmat', 1, [], 
                         helpstr='load the given X-matrix')
      self.valid_opts.add_opt('-load_1D', 1, [], 
                         helpstr='load the given 1D time series')

      self.valid_opts.add_opt('-choose_cols', 1, [], 
                         helpstr='choose X-matrix columns')

      self.valid_opts.add_opt('-show_col_types', 0, [], 
                         helpstr='show the types of columns in the X-matrix')
      self.valid_opts.add_opt('-show_conds', 0, [], 
                         helpstr='show condition numbers from the X-matrix')
      self.valid_opts.add_opt('-show_cormat', 0, [], 
                         helpstr='show the XtX correlation matrix')
      self.valid_opts.add_opt('-show_cosmat', 0, [], 
                         helpstr='show the XtX cosine matrix')
      self.valid_opts.add_opt('-show_cormat_warnings', 0, [], 
                         helpstr='show warnings for the XtX correlation matrix')
      self.valid_opts.add_opt('-show_cosmat_warnings', 0, [], 
                         helpstr='show warnings for the XtX cosine matrix')
      self.valid_opts.add_opt('-show_fit_betas', 0, [], 
                         helpstr='show fit betas of X-matrix to time series')
      self.valid_opts.add_opt('-show_fit_ts', 0, [], 
                         helpstr='show fit time series of X-mat to time series')
      self.valid_opts.add_opt('-show_xmat', 0, [], 
                         helpstr='display info about the given X-matrix')
      self.valid_opts.add_opt('-show_1D', 0, [], 
                         helpstr='display info about the given 1D time series')

      # general options
      self.valid_opts.add_opt('-chrono', 0, [], 
                         helpstr='process options chronologically')
      self.valid_opts.add_opt('-cormat_cutoff', 1, [], 
                         helpstr='set the correlation matrix warning cutoff')
      self.valid_opts.add_opt('-cosmat_cutoff', 1, [], 
                         helpstr='set the cosine matrix warning cutoff')
      self.valid_opts.add_opt('-cosmat_motion', 0, [], 
                         helpstr='include mot vs base/mot in cosmat warnings')
      self.valid_opts.add_opt('-verb', 1, [], 
                         helpstr='set the verbose level (default is 1)')

      # GUI options
      self.valid_opts.add_opt('-no_gui', 0, [], 
                         helpstr='do not start the graphical user interface')

      self.valid_opts.add_opt('-gui_plot_xmat_as_one', 0, [], 
                         helpstr='plot Xmat columns on single axis')


      return 0