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
""" | |
========================================== | |
Motion correction of DWI data | |
========================================== | |
""" | |
import numpy as np | |
from dipy.viz import regtools | |
from dipy.data import fetch_stanford_hardi, read_stanford_hardi | |
from dipy.data.fetcher import fetch_syn_data, read_syn_data |
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
dname = 'C:\\Users\\elef\\Data\\rodrigo\\' | |
fname1 = dname + 'ADRC_TMP_wholeBrain.trk.gz' | |
fname2 = dname + 'IIT2mean.trk' | |
from nibabel.streamlines import load | |
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
# -*- coding: utf-8 -*- | |
from __future__ import division | |
import numpy as np | |
from numpy.testing import (assert_, assert_equal, assert_array_equal, | |
assert_array_almost_equal, assert_almost_equal, | |
run_module_suite) |
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
# -*- coding: utf-8 -*- | |
import numpy as np | |
from dipy.segment.clustering import QuickBundles | |
from dipy.segment.metric import IdentityFeature, Feature | |
from dipy.segment.metric import AveragePointwiseEuclideanMetric, EuclideanMetric, SumPointwiseEuclideanMetric | |
#data = np.random.rand(10, 3) | |
data = [np.random.rand(1, 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
import sys | |
import numpy as np | |
from dipy.viz import actor, window, ui | |
from dipy.io.image import load_nifti | |
if __name__ == '__main__': | |
#data, affine = load_nifti('resliced.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
# Correct Boekel et. al public datasets | |
# The last b-vector is invalid as the norm is 0 when it should be 1. | |
# https://www.nitrc.org/projects/dwi_test-retest/ | |
# | |
# Run this using | |
# python correct_boekel_dwi.py pp01_dwi_run01_A.nii.gz bvals bvecs | |
import os | |
import sys |