-
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
Scripts to project 3D and 4D maps to streamline points and perform math operations in space of streamline points #810
Scripts to project 3D and 4D maps to streamline points and perform math operations in space of streamline points #810
Conversation
Hello @grahamlittlephd, Thank you for updating ! There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-02-19 17:58:10 UTC |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
1 similar comment
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
1 similar comment
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
4 similar comments
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Thanks! I will cite your scripts in my upcoming PR. Let's already give it a good name fitting with the whole renaming fashion. (Question for you Graham. Would it be a better English to say project_streamlines_onto_map??) |
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.
Thanks!
I tested both scripts. Everything seems to work correctly! I still added quite a few comments, but it's just to improve clarity.
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Projects metrics extracted from a map onto the endpoints of 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.
Yes it's fine, but ok. I will manage it in another PR after. Let's simplify this one.
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.
GTG
Quick description
Scripts for projecting and analyzing 3D and 4D data on streamline points. Useful for analyzing different image modalities in the space of streamlines. For example, a correlation could be calculated from rsfMRI timeseries interpolated at streamline endpoints.
scil_tractogram_project_map_to_streamlines.py - takes a tractogram and map as input and interpolates the data from the map to every point for each streamline.
scil_tractogram_dpp_math.py - computes various mathematical operations for all points for each streamline or at each point independently.
Simple Example usage:
Projects fa data to each streamline point
scil_tractogram_project_map_to_streamlines.py in.trk fa.trk --in_maps fa.nii.gz --out_ddp_name fa
_Calculates mean fa for each streamline
scil_tractogram_dpp_math.py mean fa.trk fa_mean_per_streamline.trk --mode dps --in_dpp_name fa --out_name fa_mean
_Could then color streamlines using current functionality
scil_tractogram_assign_custom_color.py fa_mean_per_streamline.trk fa_mean_per_streamline_colored.trk --use_dps fa_mean --min_cmap 0
Example output of mean fa (jet color map) calculated for each streamline for tractography across the caudalenticular gray matter bridges:
Here is toy example and data for testing purposes:
toy_example_usage_project_map_to_two_streamlines.zip
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
...
Checklist