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

Nifti not a 4D volume #51

Closed
srithetree opened this issue Jun 16, 2022 · 2 comments · Fixed by #52
Closed

Nifti not a 4D volume #51

srithetree opened this issue Jun 16, 2022 · 2 comments · Fixed by #52

Comments

@srithetree
Copy link

Input parameter is a 4D BOLD functional nifti file but it does not recognize it as 4 dimensional.

Expected Behavior

One would expect it to recognize it as 4D and continue to regression.

Actual Behavior

It stops and provides the error: "ValueError: Provided functional file /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz is not a 4D file!"

Full error output:
phys2cvr -i /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz -o /home/sri/CVR/sri/test -m /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-brain_mask.nii.gz -co2 /home/sri/CVR/sri/scd026_co2.csv -pk /home/sri/CVR/sri/scd026_co2_pidx.csv -fr 95.051 -tlen 19.78 -ntrial 5
INFO Currently running phys2cvr version 0.15.0
INFO Input file is /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz
WARNING Changing type of variable trial_len from <class 'float'> to int
INFO Loading /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz
WARNING /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz has more than 3 dimensions. Removing D > 3.
Traceback (most recent call last):
File "/net/rc-fs-nfs.tch.harvard.edu/ifs/RC-FS-PROD/Data/Shares/FNNDSC-e2/neuro/labs/grantlab/research/CVR/venv/bin/phys2cvr", line 8, in
sys.exit(_main())
File "/net/rc-fs-nfs.tch.harvard.edu/ifs/RC-FS-PROD/Data/Shares/FNNDSC-e2/neuro/labs/grantlab/research/CVR/venv/lib/python3.8/site-packages/phys2cvr/phys2cvr.py", line 606, in _main
phys2cvr(**vars(options))
File "/net/rc-fs-nfs.tch.harvard.edu/ifs/RC-FS-PROD/Data/Shares/FNNDSC-e2/neuro/labs/grantlab/research/CVR/venv/lib/python3.8/site-packages/phys2cvr/phys2cvr.py", line 278, in phys2cvr
raise ValueError(f'Provided functional file {fname_func} is not a 4D file!')
ValueError: Provided functional file /home/sri/CVR/derivatives/fmriprep/sub-scd026/ses-02/func/sub-scd026_ses-02_task-cvr_desc-preproc_bold.nii.gz is not a 4D file!

Steps to Reproduce the Problem

1. Give it this path and run the command
2.
3.

Specifications

- Python version: 
- phys2bids version:
- Platform:

Possible solution

@dittothat
Copy link

dittothat commented Jun 16, 2022

Hi Stefano,
Sri is a medical student intern working with me this summer. I looked at this with him a bit, and on first glance at the underlying code don't know why this line

func, dmask, img = io.load_nifti_get_mask(fname_func)
is left to the default of dim=3. I am probably reading the code incorrectly.
Thanks, Jeff

@smoia
Copy link
Owner

smoia commented Jun 24, 2022

Hey there @srithetree @dittothat this should be fixed now - thank you for the hint on where to check.
If it still doesn't work, would you be able to send me the file to make some trials?

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 a pull request may close this issue.

3 participants