Skip to content
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

WIP: New labels maps and simplification of tractometry profile scripts #554

Merged
merged 31 commits into from
Nov 2, 2022

Conversation

frheault
Copy link
Member

@frheault frheault commented Mar 3, 2022

Adding new functionalities to scil_compute_bundle_voxel_label_map.py

Support multiples (co-registered) input to improve longitudinal tractometry and add the new (yet undertested) labeling approach based on bundle-shape (instead of simple euclidian distance to a single centroid).

Also, remove the need for NPZ file in tractometry and rely simply on NIFTI file instead (simpler to follow). Fix a problem with double weighting using density (can explain if needed)

Finally, use a memmap for distance to centroids instead of pure RAM. So big bundle can have their labels map computed with >> 20 points!

image

This PR requires an update to the Tractometry-Flow pipeline.

@pep8speaks
Copy link

pep8speaks commented Mar 3, 2022

Hello @frheault, Thank you for updating !

Line 59:80: E501 line too long (80 > 79 characters)
Line 61:80: E501 line too long (82 > 79 characters)

Line 232:80: E501 line too long (81 > 79 characters)

Line 10:80: E501 line too long (80 > 79 characters)
Line 155:80: E501 line too long (83 > 79 characters)
Line 157:80: E501 line too long (87 > 79 characters)
Line 167:80: E501 line too long (88 > 79 characters)

Line 46:80: E501 line too long (80 > 79 characters)

Line 33:80: E501 line too long (81 > 79 characters)
Line 45:80: E501 line too long (80 > 79 characters)

Line 91:80: E501 line too long (80 > 79 characters)
Line 225:80: E501 line too long (82 > 79 characters)

Line 40:80: E501 line too long (82 > 79 characters)

Comment last updated at 2022-07-27 18:26:08 UTC

@scil-admin
Copy link

@scil-admin
Copy link

@scil-admin
Copy link

@scil-admin
Copy link

Build passed ! Good Job 🍻 !

@scil-admin
Copy link

Build passed ! Good Job 🍻 !

Copy link
Contributor

@arnaudbore arnaudbore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I covered everything but will do a second round once you fixed everything.

scilpy/utils/metrics_tools.py Outdated Show resolved Hide resolved
scilpy/utils/streamlines.py Outdated Show resolved Hide resolved
centroid = get_streamlines_centroid(ref_bundle.streamlines,
20)[0]
else:
centroid = get_streamlines_centroid(sft.streamlines, 20)[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 20 points has never been an arg and is hardcoded ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply because I have to convert streamlines to an array with an equal number of pts, it could be 10, 20, 50, but in the end, it changes virtually nothing.

scripts/scil_compute_bundle_mean_std.py Outdated Show resolved Hide resolved
scripts/scil_compute_bundle_mean_std_per_point.py Outdated Show resolved Hide resolved
scripts/scil_compute_bundle_mean_std_per_point.py Outdated Show resolved Hide resolved
scripts/scil_compute_bundle_mean_std_per_point.py Outdated Show resolved Hide resolved
Co-authored-by: arnaudbore <arnaud.bore@gmail.com>
@scil-admin scil-admin requested a review from arnaudbore May 19, 2022 20:58
@scil-admin
Copy link

Build passed ! Good Job 🍻 !

@scil-admin
Copy link

@frheault
Copy link
Member Author

@arnaudbore The import inside the function is a circular dependency, everything crash if I put it at the top.

@scil-admin
Copy link

Build passed ! Good Job 🍻 !

@scil-admin
Copy link

Build passed ! Good Job 🍻 !

@scil-admin
Copy link

Build passed ! Good Job 🍻 !

@arnaudbore
Copy link
Contributor

@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

Copy link
Contributor

@arnaudbore arnaudbore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help is missing - no npz saved anymore.

scripts/scil_compute_bundle_voxel_label_map.py Outdated Show resolved Hide resolved
@arnaudbore arnaudbore self-requested a review October 5, 2022 16:01
@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

@arnaudbore arnaudbore merged commit 0911369 into scilus:master Nov 2, 2022
@frheault frheault deleted the new_labels_map branch February 28, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants