Пример #1
0
def FS_to_Native_warp(Target,
                      Movable_Image,
                      Output,
                      hold_jid=[],
                      prefix='FS_to_Native_warp',
                      fsl_path='/usr/local/aleksey/fsl',
                      ants_path='/usr/local/aleksey/ANTS/bin'):
    visit = Target.visit
    prefix = Movable_Image.series + '_FS_to_Native_warp'
    qsub = Qsub(templatepath=os.path.join(template_folder,
                                          'FS_to_Native_warp.sh'),
                scriptdir=os.path.join(visit.path, 'Qsub'),
                qsubpath='qsub',
                command_args=['mem_free=2G', 'h_vmem=2G'])
    dict = {
        'filename':
        prefix + '_' + visit.visid + '_' + visit.subject.subid + '.sh',
        'subid': visit.subject.subid,
        'visid': visit.visid,
        'fs_folder': os.path.join(visit.path, Movable_Image.folder),
        'Target': Target.path,
        'Movable_Image': Movable_Image.path,
        'Output': Output.path,
        'FSL_PATH': fsl_path,
        'ANTS_PATH': ants_path,
    }
    return qsub.submit(dict, hold_jid=hold_jid)  #return jobid as str
Пример #2
0
    def recon_all(self,
                  fs_subject,
                  prefix='prefix',
                  args='RECON-ALL ARGS GO HERE!',
                  helptext='#The helptext was not filled in',
                  hold_jid=[]):
        '''
        Generic Freesurfer recon-all command. Will create and submit script to SGE qmon
        
        |fs_subject - FS_Subject object we want to work on
        |prefix - text to prepend to script file so we know what operation was carried out
        |args - arguments to the recon-all command
        |helptext - Descriptive text to put at top of script file
        |hold_jid - list of jobids 
        returns jobid of submitted job as string
        '''
        #set up template objects
        reconalltemplate = os.path.join(self.qsubTemplatesDir, 'reconall.sh')
        qsub = Qsub(templatepath=reconalltemplate,
                    scriptdir=os.path.join(self.path, 'runs_freesurfer'),
                    qsubpath='qsub',
                    command_args=['mem_free=3.5G', 'h_vmem=3.5G'])

        #set up substitution dictionary
        subs_dict = self.__buildDict__(fs_subject=fs_subject,
                                       prefix=prefix,
                                       args=args,
                                       helptext=helptext)

        #submit and return jobid
        return qsub.submit(subs_dict,
                           submitted_dir=fs_subject.submitted_dir,
                           done_dir=fs_subject.done_dir,
                           hold_jid=hold_jid)
Пример #3
0
def FS_to_Native_reg(Target, Movable_Image, prefix='FS_to_Native_reg', fsl_path='/usr/local/aleksey/fsl', ants_path='/usr/local/aleksey/ANTS/bin'):
    visit = Target.visit
    qsub = Qsub(templatepath=os.path.join(template_folder, 'FS_to_Native_reg.sh'), scriptdir=os.path.join(visit.path, 'Qsub'), qsubpath='qsub', command_args=['mem_free=2G', 'h_vmem=2G'])
    dict = {'filename':prefix + '_' + visit.visid + '_' + visit.subject.subid + '.sh',
            'subid':visit.subject.subid,
            'visid':visit.visid,
            'fs_folder':os.path.join(visit.path, Movable_Image.folder),
            'Target':Target.path,
            'Movable_Image':Movable_Image.path,
            'FSL_PATH':fsl_path,
            'ANTS_PATH':ants_path,
            }
    return qsub.submit(dict) #return jobid as str
Пример #4
0
    def recon_all(self, fs_subject, prefix='prefix', args='RECON-ALL ARGS GO HERE!', helptext='#The helptext was not filled in', hold_jid=[]):
        '''
        Generic Freesurfer recon-all command. Will create and submit script to SGE qmon
        
        |fs_subject - FS_Subject object we want to work on
        |prefix - text to prepend to script file so we know what operation was carried out
        |args - arguments to the recon-all command
        |helptext - Descriptive text to put at top of script file
        |hold_jid - list of jobids 
        returns jobid of submitted job as string
        '''
        #set up template objects
        reconalltemplate = os.path.join(self.qsubTemplatesDir, 'reconall.sh')
        qsub = Qsub(templatepath=reconalltemplate, scriptdir=os.path.join(self.path, 'runs_freesurfer'), qsubpath='qsub', command_args=['mem_free=3.5G', 'h_vmem=3.5G'])

        #set up substitution dictionary
        subs_dict = self.__buildDict__(fs_subject=fs_subject, prefix=prefix, args=args, helptext=helptext)

        #submit and return jobid
        return qsub.submit(subs_dict, submitted_dir=fs_subject.submitted_dir, done_dir=fs_subject.done_dir, hold_jid=hold_jid)