Mercurial > repos > greg > create_streamlines
comparison create_streamlines.py @ 15:010f61a2276d draft default tip
Uploaded
author | greg |
---|---|
date | Thu, 30 Nov 2017 10:22:42 -0500 |
parents | 68a58b26d6df |
children |
comparison
equal
deleted
inserted
replaced
14:68a58b26d6df | 15:010f61a2276d |
---|---|
60 streamlines = list(streamline_generator) | 60 streamlines = list(streamline_generator) |
61 cc_slice = labels == 2 | 61 cc_slice = labels == 2 |
62 cc_streamlines = utils.target(streamlines, cc_slice, affine=affine) | 62 cc_streamlines = utils.target(streamlines, cc_slice, affine=affine) |
63 cc_streamlines = list(cc_streamlines) | 63 cc_streamlines = list(cc_streamlines) |
64 | 64 |
65 M, grouping = utils.connectivity_matrix(cc_streamlines, labels, affine=affine, return_mapping=True, mapping_as_streamlines=True) | |
65 lr_superiorfrontal_track = grouping[11, 54] | 66 lr_superiorfrontal_track = grouping[11, 54] |
66 shape = labels.shape | 67 shape = labels.shape |
67 dm = utils.density_map(lr_superiorfrontal_track, shape, affine=affine) | 68 dm = utils.density_map(lr_superiorfrontal_track, shape, affine=affine) |
68 # Save density map | 69 # Save density map |
69 dm_img = nib.Nifti1Image(dm.astype("int16"), hardi_img.affine) | 70 dm_img = nib.Nifti1Image(dm.astype("int16"), hardi_img.affine) |