This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messages_defaults = [ ('process filepath', | |
'/home/grg/svn/brainvisa/t1mri/t1mri-gpl/trunk/brainvisa/toolboxes/t1mri\ | |
/processes/segmentationpipeline/components04/segmentation/VipBiasCorrection.py') ] | |
for each in signature.keys(): | |
messages_defaults.append( (each, instance.__getattribute__(each)) ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script type="text/javascript"> | |
<!-- | |
function toggle_visibility(id) { | |
var e = document.getElementById(id); | |
if(e.style.display == 'block') | |
e.style.display = 'none'; | |
else | |
e.style.display = 'block'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def map_values(parc, csv): | |
from soma import aims | |
import numpy as np | |
labels2009 = ['G_and_S_frontomargin', 'G_and_S_occipital_inf', 'G_and_S_paracentral', 'G_and_S_subcentral', 'G_and_S_transv_frontopol', 'G_and_S_cingul-Ant', 'G_and_S_cingul-Mid-Ant', 'G_and_S_cingul-Mid-Post', 'G_cingul-Post-dorsal', 'G_cingul-Post-ventral', 'G_cuneus', 'G_front_inf-Opercular', 'G_front_inf-Orbital', 'G_front_inf-Triangul', 'G_front_middle', 'G_front_sup', 'G_Ins_lg_and_S_cent_ins', 'G_insular_short', 'G_occipital_middle', 'G_occipital_sup', 'G_oc-temp_lat-fusifor', 'G_oc-temp_med-Lingual', 'G_oc-temp_med-Parahip', 'G_orbital', 'G_pariet_inf-Angular', 'G_pariet_inf-Supramar', 'G_parietal_sup', 'G_postcentral', 'G_precentral', 'G_precuneus', 'G_rectus', 'G_subcallosal', 'G_temp_sup-G_T_transv', 'G_temp_sup-Lateral', 'G_temp_sup-Plan_polar', 'G_temp_sup-Plan_tempo', 'G_temporal_inf', 'G_temporal_middle', 'Lat_Fis-ant-Horizont', 'Lat_Fis-ant-Vertical', 'Lat_Fis-post', ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
import pandas as pd | |
import os.path as osp | |
import os | |
import textwrap | |
def process(directory, excel_file, filename): | |
files = [osp.abspath(e) for e in glob(osp.join(directory, '*', '*', filename))] | |
wholeset = [] | |
wholeset2 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import os.path as osp | |
import sys | |
from PIL import Image | |
dim = {'120, 86':(6000,5343), | |
'150, 86':(6000, 4274), | |
'180, 86':(6000,3562), | |
'240, 86':(6000,2671), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import nibabel as nib | |
im1 = nib.load('/tmp/path_to_image.nii.gz') | |
a = np.array(im1.dataobj) | |
im2 = nib.Nifti1Image(a/2.0, header=im1.header, affine=im1.affine) | |
im2.to_filename('/tmp/path_to_new_image.nii.gz') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescale(source, target): | |
import nibabel as nib | |
import numpy as np | |
from nilearn import image | |
n = nib.load(source) | |
d = np.array(n.dataobj) | |
s = n.dataobj.slope | |
i = image.new_img_like(n, d/s) | |
i.to_filename(target) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer