예제 #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
파일: Volume.py 프로젝트: lynch829/occiput
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
파일: Volume.py 프로젝트: lynch829/occiput
def import_nifti(filename): 
    nip = nipy.load_image(filename)
    return nipy_to_occiput(nip)