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

Multi-session with single anat produces error #85

Open
arovai opened this issue Nov 1, 2024 · 4 comments
Open

Multi-session with single anat produces error #85

arovai opened this issue Nov 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@arovai
Copy link

arovai commented Nov 1, 2024

What happened?

fmripost-aroma produced the following error:

ValueError: Transforms to the following requested spaces not found: MNI152NLin6Asym.

Data consist of two sessions (ses-1 and ses-2), each session having a restingstate recoding, but only session 1 has an anatomical image.
fMRIPrep call was:

fmriprep /data /data/derivatives/fmriprep participant --output-spaces MNI152NLin2009cAsym MNI152NLin6Asym:res-02  --fs-license-file /licenses/.license

This produced the expected fMRIPrep outputs (no error).

Interestingly, I could trick fmripost-aroma by doing the following hack: I copied fMRIPrep output for ses-1/anat into ses-2/anat and renamed the content of ses-2/anat by replacing ses-1 by ses-2. I did this only to pin-point the issue in fmripost-aroma and indeed, it runs without error in that case.

Totally unrelated note: in this issue template (bug description), there is a string that should be adapted from fmriprep, namely:

What command did you use?

If you're using fmriprep-docker, please include the RUNNING: ... line that is printed first.
This helps us replicate the problem. This will be automatically formatted into code, so no need for backticks.

What command did you use?

fmripost-aroma /data /data/derivatives/fmripost-aroma participant --denoising-method nonaggr -d fmriprep=/data/derivatives/fmriprep

What version of fMRIPost-AROMA are you running?

0.1.dev1+g5d5b065

How are you running fMRIPost-AROMA?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

2024-11-01 20:46:56,537 [IMPORTANT] BOLD series will be slice-timing corrected to an offset of 1.47s.
Not all requested output spaces were found. We will try to find transforms to these spaces and apply them to the BOLD data.
Process Process-2:
Traceback (most recent call last):
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/site-packages/fmripost_aroma/cli/workflow.py", line 115, in build_workflow
    retval['workflow'] = init_fmripost_aroma_wf()
                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/site-packages/fmripost_aroma/workflows/base.py", line 71, in init_fmripost_aroma_wf
    single_subject_wf = init_single_subject_wf(subject_id)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/site-packages/fmripost_aroma/workflows/base.py", line 280, in init_single_subject_wf
    single_run_wf = init_single_run_wf(bold_file)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/site-packages/fmripost_aroma/workflows/base.py", line 321, in init_single_run_wf
    collect_derivatives(
  File "/opt/conda/envs/fmripost_aroma/lib/python3.11/site-packages/fmripost_aroma/utils/bids.py", line 214, in collect_derivatives
    raise ValueError(
ValueError: Transforms to the following requested spaces not found: MNI152NLin6Asym.

Additional information / screenshots

No response

@arovai arovai added the bug Something isn't working label Nov 1, 2024
@tsalo
Copy link
Collaborator

tsalo commented Nov 1, 2024

In your original fMRIPrep outputs, are the anatomical data in the subject directory (e.g., fmriprep/sub-01/anat) or in the first session's directory (fmriprep/sub-01/ses-01/anat)? The former is something that I would expect fMRIPost-AROMA to handle. The latter would be a little strange, because I'm not sure how you could get that output from fMRIPrep.

Totally unrelated note: in this issue template (bug description), there is a string that should be adapted from fmriprep

I do have an issue about that (#71) but haven't gotten around to it yet. I definitely want to fix it at some point though!

@arovai
Copy link
Author

arovai commented Nov 1, 2024

It is in ses-1 directory:

sub-01/ses-1/anat
sub-01/ses-1/func
sub-01/ses-2/func

(This is, by the way, consistent with the way my rawdata are organized.)

Do I understand correctly that if, from an experimental point of view, anat is supposed to be valid for both sessions, then it should be in sub-01/anat'? In that case this isn't an issue with fmripost-aroma but rather with my original BIDS data.

@tsalo
Copy link
Collaborator

tsalo commented Nov 1, 2024

It's not actually a problem with your raw BIDS data. In fact, you have that organized correctly, and putting the anatomical data under sub-01 would be invalid. However, fMRIPrep automatically collects all of the available anatomical scans and averages them, then uses that for all of the sessions. I haven't processed data with your specific design before, but I think fMRIPrep should write out the preprocessed anatomical data to the subject folder.

In any case, fMRIPost-AROMA should be made to work with your file structure, so I will try to fix this soon. I haven't had much time for the fMRIPost workflows lately, so it might be a little while.

In the meantime, would you be willing to try copying your sub-01/ses-01/anat folder to sub-01 and removing the ses-01 entity from the anatomical files in that folder? Just to see if fMRIPost-AROMA can handle that organization?

@arovai
Copy link
Author

arovai commented Nov 12, 2024

I confirm that putting the anat data as you describe works.

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