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

Feat: Improve cerebellum atlas #26

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Feat: Improve cerebellum atlas #26

wants to merge 5 commits into from

Conversation

arnaudon
Copy link
Contributor

  • parallelise the computation per lobule for speed up
  • remove pu layer which is not present (no voxels)
  • set has_hemisphere=True
  • implement an optional constraint to align the quaternion with an axis (perp to y)

@arnaudon arnaudon requested a review from mgeplf February 29, 2024 10:19
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 59.25926% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 89.09%. Comparing base (b3880ce) to head (0c3e742).

Files Patch % Lines
atlas_direction_vectors/algorithms/utils.py 47.61% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   90.88%   89.09%   -1.80%     
==========================================
  Files          16       16              
  Lines         472      495      +23     
==========================================
+ Hits          429      441      +12     
- Misses         43       54      +11     
Flag Coverage Δ
pytest 89.09% <59.25%> (-1.80%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@drodarie drodarie left a comment

Choose a reason for hiding this comment

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

The Purkinje layer can be used for specific annotation volumes and its absence does not affect the algorithm, so please consider reverting this change.
Also, the cerebellum is not split in hemispheres like the Isocortex so please do not split the orientation field computation based on hemispheres.

atlas_direction_vectors/cerebellum.py Show resolved Hide resolved
@@ -117,5 +122,5 @@ def cereb_subregion_direction_vectors(
region_to_weight=region_to_weight,
shading_width=4,
expansion_width=8,
has_hemispheres=False,
has_hemispheres=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert this change here too. The cerebellum is not like the isocortex and does not have two hemispheres. Do not get me wrong there are some hemispherical regions but all the vermal regions (e.g. Lingula, Declive, etc.) are at the center of the cerebellum and splitting them does not make sense: there is no separation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is tricky, I have to figure out how to do, as here we do per lobule, and for example Simple Lobule is not near the center, so it has two parts, one in each hemisphere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably this should be done on a subregion basis, I'll play around with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@drodarie , would this this correct?

INFO:atlas_direction_vectors.app.direction_vectors:Subregion Crus 1 has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Crus 2 has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Paramedian lobule has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Copula pyramidis has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Paraflocculus has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Lobule II has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Lobule III has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Nodulus (X) has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Folium-tuber vermis (VII) has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Uvula (IX) has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Declive (VI) has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Lobules IV-V has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Flocculus has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Simple lobule has hemispheres: True
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Lingula (I) has hemispheres: False
INFO:atlas_direction_vectors.app.direction_vectors:Subregion Pyramus (VIII) has hemispheres: False

I detect hemispheres if they have voxel at the halfplane +- 1 voxel.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The has_hemisphere feature was created to prevent an orientation field that is computed on one hemisphere to affect the other one. But this has an effect only when they directly face each other and are very close to each other. This is the case for isocortex but not for the cerebellar cortex because we deal with each subregion individually.
I believe your change would have close to no effect here. More, this means that you need to compute the orientation field twice for each hemispherical subregion.
IMO, there is a lack of a grounded explanation for this change.

@arnaudon
Copy link
Contributor Author

arnaudon commented Mar 8, 2024

part of this is now in #28 , I will reduce it to only the direction vector conversion option

@arnaudon arnaudon marked this pull request as draft March 8, 2024 15:28
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.

3 participants