def visualize_colorbar(savedir, min=0.75, max=1.0):
    gl.resetdefaults()
    gl.minmax(0, min, max)
    gl.colorname(0, colorname)
    gl.opacity(0, 0)
    gl.colorbarposition(1)
    gl.savebmp(os.path.join(savedir, 'colorbar.png'))
def main():
    EXP_DIR='results/graph_neural_mapping'
    NII_DIR='saliency_nii'
    SAVE_DIR='saliency_img'

    os.makedirs(os.path.join(EXP_DIR, SAVE_DIR), exist_ok=True)

    gl.resetdefaults()
    gl.loadimage('mni152')
    gl.overlayloadsmooth(True)
    gl.opacity(0, 50)
    gl.colorbarposition(0)

    visualize_axial(os.path.join(EXP_DIR, NII_DIR), os.path.join(EXP_DIR, SAVE_DIR))
    visualize_sagittal(os.path.join(EXP_DIR, NII_DIR), os.path.join(EXP_DIR, SAVE_DIR))
    visualize_colorbar(os.path.join(EXP_DIR, SAVE_DIR))
Esempio n. 3
0
)
OA_filename = [
    '//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/oldadult/spmT_0001.nii'
]
#OA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/oldadult/spmT_0002.nii']
#OA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/oldadult/spmT_0003.nii']
#OA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/oldadult/spmT_0004.nii']
#OA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/oldadult/spmT_0005.nii']

gl.overlayload(OA_filename[0])
gl.minmax(1, 1, 5)
gl.colorname(1, "8redyell")
gl.opacity(1, 80)
#gl.mosaic('l+ h -0.3 v -0.1 a 55 s x r 0')
gl.mosaic('a 55')
gl.colorbarposition(0)
#gl.linewidth(5)
gl.savebmp(OA_filename[0])

gl.loadimage(
    '//cifs.rc.ufl.edu/ufrc/rachaelseidler/tfettrow/Crunch_Code/MR_Templates/MNI_2mm.nii'
)
YA_filename = [
    '//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/youngadult/spmT_0001.nii'
]
#YA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/youngadult/spmT_0002.nii']
#YA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/youngadult/spmT_0003.nii']
#YA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/youngadult/spmT_0004.nii']
#YA_filename = ['//cifs.rc.ufl.edu/ufrc/rachaelseidler/share/FromExternal/Research_Projects_UF/CRUNCH/MiM_Data/Level2_Results/MRI_files/05_MotorImagery/youngadult/spmT_0005.nii']

gl.overlayload(YA_filename[0])