Ejemplo n.º 1
0
INPUT_CSV = "/neurospin/brainomics/2016_deptms/results/Freesurfer/population.csv"
OUTPUT = "/neurospin/brainomics/2016_deptms/results/Freesurfer/data"

# Read pop csv
pop = pd.read_csv(INPUT_CSV)

#############################################################################
## Build mesh template
import brainomics.mesh_processing as mesh_utils
cor_l, tri_l = mesh_utils.mesh_arrays(os.path.join(TEMPLATE_PATH, "lh.pial.gii"))
cor_r, tri_r = mesh_utils.mesh_arrays(os.path.join(TEMPLATE_PATH, "rh.pial.gii"))
cor = np.vstack([cor_l, cor_r])
tri_r += cor_l.shape[0]
tri = np.vstack([tri_l, tri_r])
mesh_utils.mesh_from_arrays(cor, tri, path=os.path.join(TEMPLATE_PATH, "lrh.pial.gii"))
shutil.copyfile(os.path.join(TEMPLATE_PATH, "lrh.pial.gii"), os.path.join(OUTPUT , "lrh.pial.gii"))

#############################################################################
# Read images
n = len(pop)
assert n == 34
Z = np.zeros((n, 2)) #Age,sex 
y = np.zeros((n, 1)) # DX
surfaces = list()

for i, ID in enumerate(pop['subject']):
    cur = pop[pop["subject"] == ID]
ics
    mri_path_lh = cur["mri_path_lh"].values[0]
    mri_path_rh = cur["mri_path_rh"].values[0]
Ejemplo n.º 2
0

    mesh_perfo__centered = aims.SurfaceGenerator.cylinder(ext1, ext2, 1, 1, 100, 1, 1)
"""

tri_lacunes_all = np.vstack(tri_lacunes_all)
tri_perfo_all = np.vstack(tri_perfo_all)

### =======================================================================
### mnts_inv_pc12__lacunes__max_inertia_to_yaxis
### =======================================================================
mnts_inv_pc12__lacunes__max_inertia_to_yaxis_scaled_all = \
    np.vstack(mnts_inv_pc12__lacunes__max_inertia_to_yaxis_scaled_all)
mesh_processing.mesh_from_arrays(
    mnts_inv_pc12__lacunes__max_inertia_to_yaxis_scaled_all,
    tri_lacunes_all,
    path=os.path.join(
        OUTPUT, "mnts_inv_pc12__lacunes__max_inertia_to_yaxis_scaled.gii"))
mnts_inv_pc12__lacunes__max_inertia_to_yaxis_all = \
    np.vstack(mnts_inv_pc12__lacunes__max_inertia_to_yaxis_all)
mesh_processing.mesh_from_arrays(
    mnts_inv_pc12__lacunes__max_inertia_to_yaxis_all,
    tri_lacunes_all,
    path=os.path.join(OUTPUT,
                      "mnts_inv_pc12__lacunes__max_inertia_to_yaxis.gii"))

mnts_inv_pc12__perfo__max_inertia_to_yaxis_all = \
    np.vstack(mnts_inv_pc12__perfo__max_inertia_to_yaxis_all)
mesh_processing.mesh_from_arrays(
    mnts_inv_pc12__perfo__max_inertia_to_yaxis_all,
    tri_perfo_all,