예제 #1
0
 def norm_write(self, in_prefix='', out_prefix='w'):
     sess_scans = scans_for_fnames(
         fnames_presuffix(self.data_def['functionals'], in_prefix))
     matname = fname_presuffix(self.data_def['anatomical'],
                             suffix='_seg_sn.mat',
                             use_ext=False)
     subj = {
         'matname': np.zeros((1,), dtype=object),
         'resample': np.vstack(sess_scans.flat),
         }
     subj['matname'][0] = matname
     roptions = {
         'preserve':False,
         'bb':np.array([[-78,-112, -50],[78,76,85.0]]),
         'vox':fltcols([2.0,2.0,2.0]),
         'interp':1.0,
         'wrap':[0.0,0.0,0.0],
         'prefix': out_prefix,
         }
     nwinfo = make_job('spatial', 'normalise', [{
             'write':{
                 'subj': subj,
                 'roptions': roptions,
                 }
             }])
     run_jobdef(nwinfo)
     # knock out the list of images, replacing with only one
     subj['resample'] = np.zeros((1,), dtype=object)
     subj['resample'][0] = self.data_def['anatomical']
     roptions['interp'] = 4.0
     run_jobdef(nwinfo)
     return out_prefix + in_prefix
예제 #2
0
def norm_write(data_def):
    sess_scans = scans_for_fnames(fnames_presuffix(data_def['functionals'], 'a'))
    matname = fname_presuffix(data_def['anatomical'],
                              suffix='_seg_sn.mat',
                              use_ext=False)
    subj = {
        'matname': np.zeros((1,), dtype=object),
        'resample': np.vstack(sess_scans.flat),
        }
    subj['matname'][0] = matname
    roptions = {
        'preserve':False,
        'bb':np.array([[-78,-112, -50],[78,76,85.0]]),
        'vox':fltcols([2.0,2.0,2.0]),
        'interp':1.0,
        'wrap':[0.0,0.0,0.0],
        }
    nwinfo = make_job('spatial', 'normalise', [{
            'write':{
                'subj': subj,
                'roptions': roptions,
                }
            }])
    run_jobdef(nwinfo)
    # knock out the list of images, replacing with only one
    subj['resample'] = np.zeros((1,), dtype=object)
    subj['resample'][0] = data_def['anatomical']
    roptions['interp'] = 4.0
    run_jobdef(nwinfo)
예제 #3
0
 def coregister(self, in_prefix=""):
     func1 = self.data_def["functionals"][0]
     mean_fname = fname_presuffix(func1, "mean" + in_prefix)
     crinfo = make_job(
         "spatial",
         "coreg",
         [
             {
                 "estimate": {
                     "ref": np.asarray(mean_fname, dtype=object),
                     "source": np.asarray(self.data_def["anatomical"], dtype=object),
                     "other": [""],
                     "eoptions": {
                         "cost_fun": "nmi",
                         "sep": [4.0, 2.0],
                         "tol": np.array(
                             [0.02, 0.02, 0.02, 0.001, 0.001, 0.001, 0.01, 0.01, 0.01, 0.001, 0.001, 0.001]
                         ).reshape(1, 12),
                         "fwhm": [7.0, 7.0],
                     },
                 }
             }
         ],
     )
     run_jobdef(crinfo)
     return in_prefix
예제 #4
0
def coregister(data_def):
    func1 = data_def['functionals'][0]
    mean_fname = fname_presuffix(func1, 'meana')
    crinfo = make_job('spatial', 'coreg', [{
            'estimate':{
                'ref': [mean_fname],
                'source': [data_def['anatomical']],
                'other': [[]],
                'eoptions':{
                    'cost_fun':'nmi',
                    'sep':[4.0, 2.0],
                    'tol':np.array(
                            [0.02,0.02,0.02,
                             0.001,0.001,0.001,
                             0.01,0.01,0.01,
                             0.001,0.001,0.001]).reshape(1,12),
                    'fwhm':[7.0, 7.0]
                    }
                }
            }])
    run_jobdef(crinfo)
예제 #5
0
 def norm_write(self, in_prefix="", out_prefix="w"):
     sess_scans = scans_for_fnames(fnames_presuffix(self.data_def["functionals"], in_prefix))
     matname = fname_presuffix(self.data_def["anatomical"], suffix="_seg_sn.mat", use_ext=False)
     subj = {"matname": np.zeros((1,), dtype=object), "resample": np.vstack(sess_scans.flat)}
     subj["matname"][0] = matname
     roptions = {
         "preserve": False,
         "bb": np.array([[-78, -112, -50], [78, 76, 85.0]]),
         "vox": fltcols([2.0, 2.0, 2.0]),
         "interp": 1.0,
         "wrap": [0.0, 0.0, 0.0],
         "prefix": out_prefix,
     }
     nwinfo = make_job("spatial", "normalise", [{"write": {"subj": subj, "roptions": roptions}}])
     run_jobdef(nwinfo)
     # knock out the list of images, replacing with only one
     subj["resample"] = np.zeros((1,), dtype=object)
     subj["resample"][0] = self.data_def["anatomical"]
     roptions["interp"] = 4.0
     run_jobdef(nwinfo)
     return out_prefix + in_prefix
예제 #6
0
def coregister(data_def):
    func1 = data_def['functionals'][0]
    mean_fname = fname_presuffix(func1, 'meana')
    crinfo = make_job('spatial', 'coreg', [{
        'estimate': {
            'ref': [mean_fname],
            'source': [data_def['anatomical']],
            'other': [[]],
            'eoptions': {
                'cost_fun':
                'nmi',
                'sep': [4.0, 2.0],
                'tol':
                np.array([
                    0.02, 0.02, 0.02, 0.001, 0.001, 0.001, 0.01, 0.01, 0.01,
                    0.001, 0.001, 0.001
                ]).reshape(1, 12),
                'fwhm': [7.0, 7.0]
            }
        }
    }])
    run_jobdef(crinfo)
예제 #7
0
 def coregister(self, in_prefix=''):
     func1 = self.data_def['functionals'][0]
     mean_fname = fname_presuffix(func1, 'mean' + in_prefix)
     crinfo = make_job('spatial', 'coreg', [{
             'estimate':{
                 'ref': np.asarray(mean_fname, dtype=object),
                 'source': np.asarray(self.data_def['anatomical'],
                                      dtype=object),
                 'other': [''],
                 'eoptions':{
                     'cost_fun':'nmi',
                     'sep':[4.0, 2.0],
                     'tol':np.array(
                             [0.02,0.02,0.02,
                             0.001,0.001,0.001,
                             0.01,0.01,0.01,
                             0.001,0.001,0.001]).reshape(1,12),
                     'fwhm':[7.0, 7.0]
                     }
                 }
             }])
     run_jobdef(crinfo)
     return in_prefix
예제 #8
0
파일: process_ds105.py 프로젝트: Lx37/nipy
 def coregister(self, in_prefix=''):
     func1 = self.data_def['functionals'][0]
     mean_fname = fname_presuffix(func1, 'mean' + in_prefix)
     crinfo = make_job('spatial', 'coreg', [{
             'estimate':{
                 'ref': np.asarray(mean_fname, dtype=object),
                 'source': np.asarray(self.data_def['anatomical'],
                                      dtype=object),
                 'other': [''],
                 'eoptions':{
                     'cost_fun':'nmi',
                     'sep':[4.0, 2.0],
                     'tol':np.array(
                             [0.02,0.02,0.02,
                             0.001,0.001,0.001,
                             0.01,0.01,0.01,
                             0.001,0.001,0.001]).reshape(1,12),
                     'fwhm':[7.0, 7.0]
                     }
                 }
             }])
     run_jobdef(crinfo)
     return in_prefix