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

[BUG]: Cannot register parcellation with non-continuous values #257

Open
1 task done
fraimondo opened this issue Oct 13, 2023 · 0 comments
Open
1 task done

[BUG]: Cannot register parcellation with non-continuous values #257

fraimondo opened this issue Oct 13, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@fraimondo
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

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:

  File "/home/fraimondo/dev/tbox/junifer/junifer/data/parcellations.py", line 269, in load_parcellation
    raise_error(
  File "/home/fraimondo/dev/tbox/junifer/junifer/utils/logging.py", line 289, in raise_error
    raise klass(msg)
ValueError: Parcellation Glasser must have all the values in the range  [0, 361].

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:

# Increase the values of each ROI to match the labels
t_parc_data[t_parc_data != 0] += len(labels)

Expected Behavior

Parcellations without continuous numbering should be able to be included in junifer (and merged)

Steps To Reproduce

  1. Get junifer latest
  2. Register the Glasser parcellation
  3. Try to compute any marker that uses a parcel (or even 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/games

Relevant log output

No response

Anything else?

No response

@fraimondo fraimondo added bug Something isn't working triage New issues waiting to be reviewed and removed triage New issues waiting to be reviewed labels Oct 13, 2023
@fraimondo fraimondo added this to the 0.0.4 (alpha 3) milestone Oct 13, 2023
@fraimondo fraimondo added the CRITICAL High Priority Issue label Oct 13, 2023
@fraimondo fraimondo removed the CRITICAL High Priority Issue label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants