-
Notifications
You must be signed in to change notification settings - Fork 62
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
New upsampling method (PTT) for tractogram #818
Conversation
Hello @frheault, Thank you for updating !
Comment last updated at 2024-03-19 17:59:20 UTC |
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.
Some minor comments, otherwise LGTM
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.
Small possible but not required improvement. Otherwise LGTM. Of course, pep8 problems need to be fixed and unit tests would be nice, but can be added later.
Build passed ! Good Job 🍻 ! |
Build passed ! Good Job 🍻 ! |
Build Failed 💥 |
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.
Last round of review. Couple of comments, only the args one is critical.
Build passed ! Good Job 🍻 ! |
@frheault do you need help closing this PR ? It has been open for a while and I would maybe like to use this feature in some work. |
I just added tests so maybe just check that part? Then it would be ready to merge. I think the tests are passing but they restarted and got stuck. |
Build passed ! Good Job 🍻 ! |
@frheault Tests look good to me ! Only thing remaining are pep8 errors then GTG @arnaudbore imo |
Build passed ! Good Job 🍻 ! |
scilpy/utils/spatial_ops.py
Outdated
import numpy as np | ||
|
||
|
||
def parallel_transport_streamline(streamline, nb_streamlines, radius, rng=None): |
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.
After discussion with Arnaud, we would put this in tractogram.streamline_operations.
Can you also move the r(vec, theta) method into utils.util, and name it something like def rotation_around_vector_matrix?
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.
A couple of comments but we are really close !
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.
Small comment - almost GTG
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! Much clearer than the first time I read it!
|
||
Parameters | ||
---------- | ||
tractogram: TrkFile, TckFile, ArraySequence, list |
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.
If I understand, this method would work too if tractogram is a StatefulTractogram, no?
scripts/scil_tractogram_resample.py
Outdated
'points to generate new ones [%(default)s].') | ||
upsampling_group.add_argument('--tube_radius', type=float, default=1, | ||
help='Maximum distance to generate streamlines ' | ||
' around the original ones [%(default)s].') |
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.
two spaces between streamlines and around.
scripts/scil_tractogram_resample.py
Outdated
help='Sigma for smoothing. Use the value of ' | ||
'surrounding X,Y,Z points on the ' | ||
'streamline to blur the streamlines.\n' | ||
'A good sigma choice would around 5.') |
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.
would be
scripts/scil_tractogram_resample.py
Outdated
(args.streamline_wise_std is not None and | ||
args.streamline_wise_std <= 0): | ||
parser.error('STD needs to be above 0.') | ||
if (args.point_wise_std is not None and args.point_wise_std <= 0): |
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.
parenthesis not needed
scripts/scil_tractogram_resample.py
Outdated
parser.error('STD needs to be above 0.') | ||
if (args.point_wise_std is not None and args.point_wise_std <= 0): | ||
parser.error('argument --point_wise_std: must be > 0') | ||
if (args.tube_radius is not None and args.tube_radius <= 0): |
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.
idem
Quick description
The previous version was simply adding zigzag to streamlines and was barely useful (even for data augmentation it was kind of weird). Now this version uses Parallel Transport to create new streamlines around the previous one using their real geometry. This is helpful for model creation, figures and data augmentation.
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
(The input for that image for single centroids from each bundle)
Checklist