[BUG]: Cannot register parcellation with non-continuous values#257
Merged
[BUG]: Cannot register parcellation with non-continuous values#257
Conversation
|
d0e1c83 to
f2b8852
Compare
Member
|
CI passing on juseless. |
fraimondo
approved these changes
Oct 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Is there an existing issue for this?
Current Behavior
I want to register the Glasser parcellation: https://afni.nimh.nih.gov/pub/dist/atlases/MNI_HCP/MNI_Glasser_HCP_2021_v1.0a/
However, I get this error:
This is because so far, junifer expects that parcellation values are continuous. Some parcellations are not, like this one. The values are 1-180 for one hemisphere, and 1001-1180 for the other.
This was a restriction added when merging parcellations, as we have to "shift" the values to merge them, and this is done by adding the number of labels:
junifer/junifer/data/parcellations.py
Lines 1362 to 1364 in 3fd1877
Expected Behavior
Parcellations without continuous numbering should be able to be included in junifer (and merged)
Steps To Reproduce
load_parcellation)Environment
junifer: version: 0.0.3.dev101 python: version: 3.11.3 implementation: CPython dependencies: click: 8.1.3 numpy: 1.23.5 datalad: 0.18.2+59.gc5054cb91 pandas: 1.5.3 nibabel: 4.0.2 nilearn: 0.10.0 sqlalchemy: 1.4.48 ruamel.yaml: 0.17.31 system: platform: Linux-6.1.0-12-amd64-x86_64-with-glibc2.36 environment: LC_CTYPE: en_US.UTF-8 PATH: /home/fraimondo/miniconda3/envs/junifer/bin:/home/fraimondo/miniconda3/condabin:/home/fraimondo/.dotfiles/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/local/games:/usr/gamesRelevant log output
No response
Anything else?
No response