Created
May 2, 2015 20:24
-
-
Save arokem/51239fe55c07da101633 to your computer and use it in GitHub Desktop.
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
""" | |
To use: | |
load_ext line_profiler | |
import profile_near_roi as p | |
lprun -f p.ut.near_roi p.func() | |
""" | |
import dipy.data as dpd | |
import nibabel.trackvis as trk | |
import dipy.tracking.utils as ut | |
import numpy as np | |
fornix_file = dpd.get_data('fornix') | |
fornix_content = trk.read(fornix_file) | |
streamlines = [t[0] for t in fornix_content[0]] | |
mask = np.zeros((150, 150, 100), dtype=bool) | |
mask[90:100, 100:110, 90] = 1 | |
def func(): | |
ans = ut.near_roi(streamlines, mask, affine=None, tol=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment