def visualize_sagittal(niidir, savedir, min=0.75, max=1.0):
    for hemisphere in ['lh', 'rh']:
        if hemisphere =='lh': gl.clipazimuthelevation(0.49, 90, 0)
        elif hemisphere =='rh': gl.clipazimuthelevation(0.49, 270, 0)
        for network in ['Vis', 'SomMot', 'DorsAttn', 'SalVentAttn', 'Limbic', 'Cont', 'Default']:
            for gender in ['female', 'male']:
                gl.overlayload(os.path.join(niidir, 'network', 'saliency_{}_top20_{}_{}'.format(method, gender, network, hemisphere)))
                gl.minmax(1, min, max)
                gl.colorname(1, colorname)

                gl.viewsagittal(1)
                gl.savebmp(os.path.join(savedir, '{}_{}_sagittal_{}_lt.png'.format(network, gender, hemisphere)))
                gl.viewsagittal(0)
                gl.savebmp(os.path.join(savedir, '{}_{}_sagittal_{}_rt.png'.format(network, gender, hemisphere)))
                gl.overlaycloseall()
Beispiel #2
0
import gl
gl.resetdefaults()
kframesperrotation = 180
gl.meshcolor(210, 148, 148)
gl.meshload('BrainMesh_ICBM152Left.mz3')
gl.edgeload('LPBA40.edge')
gl.clipazimuthelevation(0.3, 0, 130)
gl.nodesize(6, 1)
gl.edgesize(3, 1)
gl.nodehemisphere(-1)
gl.azimuthelevation(250, 35)
gl.edgecolor('actc', 1)
gl.nodecolor('red', 1)
gl.nodethresh(1.0, 1.0)
gl.edgethresh(0.5, 1.0)
for i in range(1, kframesperrotation * 5):
    s = 0.5 + (i + 0.0) / 72
    if (s <= 1):
        gl.cameradistance(s)
    if ((i % kframesperrotation) == 0):
        rot = (i / kframesperrotation)
        if rot == 1:
            gl.shadername('metal')
        elif rot == 2:
            gl.shadername('wireframe')
        elif rot == 3:
            gl.shadername('toon')
            gl.shaderambientocclusion(0)
        else:
            gl.shadername('wire')
            gl.shaderforbackgroundonly(1)
Beispiel #3
0
import gl
ksteps = 100
gl.resetdefaults()
gl.meshload('stroke.mz3')
gl.trackload('stroke.trk.gz')
gl.trackprefs(15, 3, 0.5)
for i in range(1, ksteps):
    gl.clipazimuthelevation(((0.8 * i) / ksteps), 0, 130)
    gl.wait(20)
Beispiel #4
0
import gl
gl.resetdefaults()
gl.meshload('BrainMesh_ICBM152.rh.mz3')
gl.meshcurv()
gl.overlayminmax(1, -1, 1)
gl.overlaycolorname(1, 'surface')
gl.overlayinvert(1, 1)
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlaycolorname(2, 'kelvin')
gl.overlayminmax(2, 2, 7)
gl.overlayload('scalp.mz3')
gl.overlaycolorname(3, 'gold')
gl.shaderxray(1.0, 0.9)
gl.meshoverlayorder(1)
gl.colorbarvisible(0)
gl.shaderambientocclusion(0.05)
gl.azimuthelevation(90, 15)
gl.clipazimuthelevation(0.5, 0, 90)
Beispiel #5
0
import gl
ksteps = 12
ktime = 100
thick = 1.0 / ksteps
gl.resetdefaults()
gl.loadimage('spm152')
gl.overlayload('spmMotor')
gl.minmax(1, 4, 4)
gl.shaderadjust('boundThresh', 0.35)
gl.shaderadjust('edgeThresh', 0.42)
gl.shaderadjust('edgeBoundMix', 0.05)
gl.shaderadjust('colorTemp', 0.8)
gl.backcolor(255, 255, 255)
gl.clipazimuthelevation(0.36, 0, 180)
gl.clipthick(thick)
gl.shaderadjust('overlayClip', 1)
for x in range(1, ksteps):
    gl.clipazimuthelevation(0.001 + ((x - 1) * thick), 0, 180)
    gl.wait(ktime)
    #gl.savebmp(str(x)+'.png')
Beispiel #6
0
import gl
gl.resetdefaults()
#open background image
gl.loadimage('spm152')
#open overlay: show positive regions
gl.overlayload('spmMotor')
gl.minmax(1, 4, 4)
gl.opacity(1, 50)
gl.clipazimuthelevation(0.4, 0, 160)
Beispiel #7
0
import gl
gl.resetdefaults()
gl.loadimage('CT_Philips')
gl.colorname(0, 'CT_Kidneys')
gl.shadername('Tomography')
gl.azimuthelevation(150, 10)
gl.clipazimuthelevation(0.25, 180, 60)
Beispiel #8
0
import gl
gl.resetdefaults()
gl.meshload('mni152_2009.mz3')
gl.overlayload('motor_4t95mesh.mz3')
gl.clipazimuthelevation(0.37, 0, 140)
gl.shaderambientocclusion(0.5)
gl.azimuthelevation(90, 20)
gl.shaderxray(1.0, 0.3)