PennLINC / xcpEngine

Official public repository for the XCP Engine. This tool is deprecated in favor of XCP-D and ASLPrep.
MIT License
66 stars 42 forks source link

confound naming issue in confounds module #447

Closed bdeck8317 closed 2 years ago

bdeck8317 commented 3 years ago

Describe the bug What were you trying to do when the crash happened?

Hi @a3sha2 ,

There seems to be an issue with extracting the confounds from the newest version of fmriprep. I am running xcp using 36p-despike (no edits, pulled from your github repo) I think the error is the following

looking for confounds_regressors.tsv and confounds_regressors.json

Current processing step:
getting data from fmriprep directory
····································································
cp: cannot stat '/data/fmriprep_out/fmriprep/sub-LFNpilot/ses-PrismPilotTest/func/sub-LFNpilot_ses-PrismPilotTest_task-rest_run-1_desc-confounds_regressors.tsv': No such file or directory
cp: cannot stat '/data/fmriprep_out/fmriprep/sub-LFNpilot/ses-PrismPilotTest/func/sub-LFNpilot_ses-PrismPilotTest_task-rest_run-1_desc-confounds_regressors.json': No such file or directory

However, fmriprep now uses the following naming conventions:

sub-LFNpilot_ses-PrismPilotTest_task-rest_run-1_desc-confounds_timeseries.json
sub-LFNpilot_ses-PrismPilotTest_task-rest_run-1_desc-confounds_timeseries.tsv

Cohort file Paste cohort file between the triple backticks


id0,id1,run,img
sub-LFNpilot,ses-PrismPilotTest,run-1,fmriprep_out/fmriprep/sub-LFNpilot/ses-PrismPilotTest/func/sub-LFNpilot_ses-PrismPilotTest_task-rest_run-1_space-T1w_desc-preproc_bold.nii.gz

Error message incorrect_name.txt

Runtime Information

screen docker run -it -m 150g --cpus='16' \
    -v /Users/neurouser1/Documents/PRISM_pilot/xcp/:/data \
    -v /Users/neurouser1/Documents/PRISM_pilot/scratch/:/tmp \
    -v /Users/neurouser1/Documents/DP5/xcp/:/git_repo \
    pennbbl/xcpengine:latest \
    -c /data/cohorts/test/PRISM_restTest_cohort.csv \
    -d /git_repo/xcp_git_repo/xcpEngine/designs/fc-36p_despike.dsn \
    -o /data/xcpOut/ \
    -i /tmp/ \
    -r /data/

Additional context I think this is just a naming convention issue from newer versions of fmriprep. should be fast fix.

a3sha2 commented 3 years ago

it will work for either confounds_timeseries or confounds_regressors except if your bold is in native space.

bdeck8317 commented 3 years ago

@a3sha2 , okay that makes sense.

I am then getting this error in the confounds module

###################################################################
#  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  #
#                                                                 #
#  ·                   CONFOUND MODEL MODULE                   ·  #
#                                                                 #
#  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  #
###################################################################

[I][/data/xcpOut/sub-LFNpilot/ses-PrismPilotTest/sub-LFNpilot_ses-PrismPilotTest.nii.gz]
[O][/data/xcpOut/sub-LFNpilot/ses-PrismPilotTest/confound2]

Current processing step:
Generating confound matrix
····································································
· Generating temporal mask
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "i" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "i" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
Error in getopt_options(object, args) : 
  Error in getopt(spec = spec, opt = args) : flag "i" requires an argument
Calls: parse_args -> parse_options -> getopt_options
Execution halted
· [Computing framewise displacement]
Error in file(file, "rt") : cannot open the connection
Calls: unname -> as.matrix -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file '/data/xcpOut/sub-LFNpilot/ses-PrismPilotTest/confound2/mc/sub-LFNpilot_ses-PrismPilotTest_realignment.1D': No such file or directory
Execution halted
· [Computing DVARS]

Is this potentially a volume binding issue?

a3sha2 commented 3 years ago

are you using singularity image?

bdeck8317 commented 3 years ago

@a3sha2 no, docker.

bdeck8317 commented 3 years ago

@a3sha2,

Just letting you know that I re-ran fmriprep using version 20.1.3 (a couple versions behind the most recent) and now used the latest docker image of XCP and it runs completely fine.

There must be an update to fmriprep that makes it incompatible with something in XCP.

You can close this issue but I really don't know what it is. Maybe how fmriprep handles confound matrices?