-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project streamlines from/to wm/gm #640
Conversation
Build passed ! Good Job 🍻 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following discussions that we had, the main should be cleaned up and functions should be moved into scilpy
instead of mixing IO and logic.
logging.warning('Empty bundle file {}. Skipping'.format(args.bundle)) | ||
return | ||
|
||
mins, maxs, indices = _process_streamlines(sft.streamlines, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following lines should be abstracted in a or multiple functions, which can reside in scilpy
. The function(s) could return maps that can be saved in the main function. Overall, only IO should be in the main function.
return p | ||
|
||
|
||
def _compute_streamline_mean(cur_ind, cur_min, cur_max, data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably has a place in the library
return streamline_average | ||
|
||
|
||
def _process_streamlines(streamlines, just_endpoints): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably has a place in the library and/or use functions that are already in the library
return mins, maxs, indices | ||
|
||
|
||
def _project_metrics(curr_metric_map, count, orig_s, streamline_mean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also go into the library. I would also add comments to tell the user that this function has side-effects instead of returns.
6b25d6e
to
27a5f6a
Compare
Build passed ! Good Job 🍻 ! |
This new script expands on a previous version, projecting values from WM (streamlines) to the cortex (endpoints).
This version can project data from GM or WM to GM or WM (4 combos)
The data can come from metric maps (like before, FA, MD) or data_per_streamline or data_per_point (new).
The data_per_* can be from the .trk metadata or loaded from an array file.
This can be useful to project FA to the cortex, (WM->GM) or cortical thickness to the deep WM (GM->WM).
It can be used to visualize the distribution of streamlines and what they "touch" in a different way.
test_for_kurt_project.zip