Пример #1
0
def load_mask_file(filename, lookup_table_filename=None): 
    # Load file 
    nip = nipy.load_image(filename)
    occ = nipy_to_occiput(nip)
    occ.set_mask_flag(1) 
    
    # Load the lookup table. If not specified, try to load from file with the same name as 
    # the mask image file. 
    if lookup_table_filename == None: 
        f = []
        f.append(os.path.splitext(filename)[0]+'.lut')
        f.append(os.path.splitext(os.path.splitext(filename)[0])[0]+'.lut') #This includes .nii.gz files 
        for lookup_table_filename in f: 
            try: 
                lut = load_freesurfer_lut_file(lookup_table_filename) 
            except: 
                lut = None 
                
    else: 
        lut = load_freesurfer_lut_file(lookup_table_filename) 
    if lut  is not None: 
        occ.set_lookup_table(lut) 
    return occ
Пример #2
0
def import_mask(filename, lookup_table_filename=None): 
    # Load file 
    nip = nipy.load_image(filename)
    occ = nipy_to_occiput(nip)
    occ.set_mask_flag(1) 
    
    # Load the lookup table. If not specified, try to load from file with the same name as 
    # the mask image file. 
    if lookup_table_filename == None: 
        f = []
        f.append(os.path.splitext(filename)[0]+'.lut')
        f.append(os.path.splitext(os.path.splitext(filename)[0])[0]+'.lut') #This includes .nii.gz files 
        for lookup_table_filename in f: 
            try: 
                lut = load_freesurfer_lut_file(lookup_table_filename) 
            except: 
                lut = None 
                
    else: 
        lut = load_freesurfer_lut_file(lookup_table_filename) 
    if lut  is not None: 
        occ.set_lookup_table(lut) 
    return occ
Пример #3
0
def load_image_file(filename): 
    nip = nipy.load_image(filename)
    return nipy_to_occiput(nip)
Пример #4
0
def import_nifti(filename):
    nip = nipy.load_image(filename)
    return nipy_to_occiput(nip)
Пример #5
0
def import_nifti(filename): 
    nip = nipy.load_image(filename)
    return nipy_to_occiput(nip)