# get the masks
        mask_path = op.join(func_path, "%s_mask.gii" % side)

        # read the texture and curvature data
        tex = read(tex_path).darrays[0].data.ravel()
        curv = (read(curv_path).darrays[0].data < 0).astype(np.int)
        mask = read(mask_path).darrays[0].data

        ### Plot meshes
        f = mlab.figure(bgcolor=(0.05, 0, 0.1), size=(400, 400))
        mlab.clf()
        vmin, vmax = -np.pi, np.pi
        plot_retino_image(
            inflated_mesh_path,
            name="%s hemisphere" % side,
            mask=mask,
            tf=None,
            tex=tex,
            curv=curv,
            vmin=vmin,
            vmax=vmax,
        )
        if side == "left":
            mlab.view(280, 120)
        else:
            mlab.view(250, 120)
        mlab.savefig(op.join(func_path, "%s_%s.png") % (subject, side))

mlab.show()
示例#2
0
        tex_path = op.join(func_path, '%s_phase_wedge.gii' % side)
        inflated_mesh_path = op.join(anat_path, '%sh.inflated.gii' % side[0])
        curv_path = op.join(anat_path, '%sh.avg_curv.gii' % side[0])
    
        # get the masks
        mask_path = op.join(func_path, '%s_mask.gii' % side)

        # read the texture and curvature data
        tex = read(tex_path).darrays[0].data.ravel()
        curv = (read(curv_path).darrays[0].data < 0).astype(np.int)
        mask = read(mask_path).darrays[0].data

        ### Plot meshes
        f = mlab.figure(bgcolor=(.05, 0, .1), size=(400, 400))
        mlab.clf()
        vmin, vmax = -np.pi, np.pi
        plot_retino_image(inflated_mesh_path, 
                          name="%s hemisphere" % side, 
                          mask=mask,
                          tf=None, 
                          tex=tex, 
                          curv=curv, 
                          vmin=vmin, vmax=vmax)
        if side == 'left':
            mlab.view(280, 120)
        else:
            mlab.view(250, 120)
        mlab.savefig(op.join(func_path, '%s_%s.png') % (subject, side))

mlab.show()
    ltex = read(ltex_path).darrays[0].data.ravel()
    lcurv = (read(lcurv_path).darrays[0].data < 0).astype(np.int)
    lmask = read(lmask_path).darrays[0].data
    rtex = read(rtex_path).darrays[0].data.ravel()
    rcurv = (read(rcurv_path).darrays[0].data < 0).astype(np.int)
    rmask = read(rmask_path).darrays[0].data

    ### Plot meshes

    # left hemisphere
    f = mlab.figure(bgcolor=(.05, 0, .1), size=(400, 400))
    mlab.clf()
    plot_retino_image(lmesh_path_inflated,
                      name="LeftHemisphere",
                      mask=lmask,
                      tf=None,
                      tex=ltex,
                      curv=lcurv,
                      vmin=-np.pi,
                      vmax=np.pi)
    #plot_retino_image(lmesh_path_inflated, name="LeftHemisphere", mask=lmask,
    #                  tf=None, tex=ltex, curv=lcurv, vmin=-np.pi, vmax=0)
    mlab.view(280, 120)
    mlab.savefig(op.join(func_path, '%s_%s.png') % (subject, 'left'))

    # right hemisphere
    f = mlab.figure(bgcolor=(.05, 0, .1), size=(400, 400))
    mlab.clf()
    plot_retino_image(rmesh_path_inflated,
                      name="RightHemisphere",
                      mask=rmask,
                      tf=None,
    rmask_path = op.join(func_path, 'right_mask.gii')

    # read the texture and curvature data
    ltex = read(ltex_path).darrays[0].data.ravel()
    lcurv = (read(lcurv_path).darrays[0].data < 0).astype(np.int)
    lmask = read(lmask_path).darrays[0].data
    rtex = read(rtex_path).darrays[0].data.ravel()
    rcurv = (read(rcurv_path).darrays[0].data < 0).astype(np.int)
    rmask = read(rmask_path).darrays[0].data

    ### Plot meshes
    
    # left hemisphere
    f = mlab.figure(bgcolor=(.05, 0, .1), size=(400, 400))
    mlab.clf()
    plot_retino_image(lmesh_path_inflated, name="LeftHemisphere", mask=lmask,
                      tf=None, tex=ltex, curv=lcurv, vmin=-np.pi, vmax=np.pi)
    #plot_retino_image(lmesh_path_inflated, name="LeftHemisphere", mask=lmask,
    #                  tf=None, tex=ltex, curv=lcurv, vmin=-np.pi, vmax=0)
    mlab.view(280, 120)
    mlab.savefig(op.join(func_path,'%s_%s.png') % (subject, 'left'))

    # right hemisphere
    f = mlab.figure(bgcolor=(.05, 0, .1), size=(400, 400))
    mlab.clf()
    plot_retino_image(rmesh_path_inflated, name="RightHemisphere", mask=rmask,
                      tf=None, tex=rtex, curv=rcurv, vmin=-np.pi, vmax=np.pi)
    #plot_retino_image(rmesh_path_inflated, name="RightHemisphere", mask=rmask,
    #                  tf=None, tex=rtex, curv=rcurv, vmin=0, vmax=np.pi)
    mlab.view(250, 120)
    mlab.savefig(op.join(func_path, '%s_%s.png') % (subject, 'right'))
    mlab.show()