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 | |
""" | |
This example reproduces the ODFs in figure 6 and 7 from Paquette et al. | |
"Optimal DSI reconstruction parameter recommendations: better ODFs and better connectivity". | |
The Optimal DSI (figure 7), is obtained using the parameters from the last | |
line of Tbl. 5 as the snr was estimated at 38 following an approach detailed | |
in https://github.com/nipy/dipy/blob/master/doc/examples/snr_in_cc.py | |
Required python modules (with their respective reqs): |
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
""" | |
Dirty example to display signal for individual shell of multi-shell as spherical function. | |
No background maps, just signal spheres. | |
Option to assume or not antipodal symmetry. | |
Assume the gradient table as at least 1 b0. | |
Uses so not very robust ad-hoc function to detect which sample belong to which shell. | |
""" | |
import numpy as np |
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 | |
# shitty way to get 1 voxel of single-shell signal | |
from dipy.data import fetch_isbi2013_2shell, read_isbi2013_2shell | |
fetch_isbi2013_2shell() | |
img, gtab = read_isbi2013_2shell() | |
data = img.get_data() | |
del img |
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 sys | |
import numpy as np | |
import nibabel as nib | |
import tractconverter as tc | |
from dipy.tracking.streamlinespeed import length, set_number_of_points | |
from dipy.tracking.vox2track import track_counts |
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 argparse | |
import numpy as np | |
import nibabel as nib | |
from scipy.spatial.distance import pdist, squareform | |
DESCRIPTION = """ |
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 argparse | |
import numpy as np | |
import nibabel as nib | |
import sklearn.cluster as clu | |
DESCRIPTION = """ |
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 scipy.io import loadmat | |
import numpy as np | |
import sys | |
if __name__ == "__main__": | |
print('input_ants_rigid_transform input_bvecs output_bvec') | |
# Loading Ants transform | |
trans = loadmat(sys.argv[1]) | |
matrice = trans['AffineTransform_double_3_3'][:9].reshape((3,3)) |
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 numpy as np | |
import nibabel as nib | |
import sys | |
def main(input, output, dx, dy, dz): | |
img = nib.load(input) | |
data = img.get_data() | |
downsampling_factor = np.array([int(dx), int(dy), int(dz)]) | |
print('Input image is size {} {} {}'.format(data.shape[0], data.shape[1], data.shape[2])) |
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 BeautifulSoup as bs | |
import requests | |
import pylab as pl | |
def countPubmed(searchterm, minyear, maxyear): | |
quer = '%20'.join(searchterm.split(' ')) | |
N_res = [] | |
y = [] | |
for year in range(minyear, maxyear+1): |
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 -*- | |
# first draft of script to compute voxelwise bvec and bval after GNL | |
# work on the output of calc_grad_perc_dev | |
# calc_grad_perc_dev works on the fullwarp output of gradunwrap.py | |
import numpy as np | |
import nibabel as nib | |
import argparse |
OlderNewer