Xcp_d: error: the following arguments are required: analysis_level

Summary

I ran “xcp_d fmriprep_dir output_dir --cifti --despike --head_radius 40 -w /wkdir --smoothing 6” and it gave me an error stating xcp_d: error: the following arguments are required: analysis_level

Additional details

  • xcp_d version: xcp_d v0.6.1.dev3+geeea98a
  • Docker version: Docker version 24.0.6, build ed223bc

What were you trying to do?

I was trying to run xcp_d fmriprep_dir output_dir --cifti --despike --head_radius 40 -w /wkdir --smoothing 6

What did you expect to happen?

I expected the output to be:

usage: xcp_d [-h] [--version]
             [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
             [-t TASK_ID] [--bids-filter-file FILE] [-m] [-s]
             [--nthreads NTHREADS] [--omp-nthreads OMP_NTHREADS]
             [--mem_gb MEM_GB] [--use-plugin USE_PLUGIN] [-v]
             [--input-type {fmriprep,dcan,hcp,nibabies}]
             [--smoothing SMOOTHING] [--despike]
             [-p {27P,36P,24P,acompcor,aroma,acompcor_gsr,aroma_gsr,custom,none}]
             [-c CUSTOM_CONFOUNDS] [--min_coverage MIN_COVERAGE]
             [--min_time MIN_TIME] [--dummy-scans {{auto,INT}}]
             [--random-seed _RANDOM_SEED] [--disable-bandpass-filter]
             [--lower-bpf LOWER_BPF] [--upper-bpf UPPER_BPF]
             [--bpf-order BPF_ORDER] [--motion-filter-type {lp,notch}]
             [--band-stop-min BPM] [--band-stop-max BPM]
             [--motion-filter-order MOTION_FILTER_ORDER] [-r HEAD_RADIUS]
             [-f FD_THRESH] [--exact-time EXACT_TIME [EXACT_TIME ...]]
             [-w WORK_DIR] [--clean-workdir] [--resource-monitor] [--notrack]
             [--fs-license-file FILE] [--warp-surfaces-native2std] [--dcan-qc]
             fmri_dir output_dir {participant}

What actually happened?

usage: xcp_d [-h] [--version] [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]] [-t TASK_ID] [--bids-filter-file FILE] [-m] [-s]
             [--nthreads NTHREADS] [--omp-nthreads OMP_NTHREADS] [--mem_gb MEM_GB] [--use-plugin USE_PLUGIN] [-v]
             [--input-type {fmriprep,dcan,hcp,nibabies}] [--smoothing SMOOTHING] [--despike]
             [-p {27P,36P,24P,acompcor,aroma,acompcor_gsr,aroma_gsr,custom,none}] [-c CUSTOM_CONFOUNDS] [--min_coverage MIN_COVERAGE]
             [--min_time MIN_TIME] [--dummy-scans {{auto,INT}}] [--random-seed _RANDOM_SEED] [--disable-bandpass-filter] [--lower-bpf LOWER_BPF]
             [--upper-bpf UPPER_BPF] [--bpf-order BPF_ORDER] [--motion-filter-type {lp,notch}] [--band-stop-min BPM] [--band-stop-max BPM]
             [--motion-filter-order MOTION_FILTER_ORDER] [-r HEAD_RADIUS] [-f FD_THRESH] [--exact-time EXACT_TIME [EXACT_TIME ...]] [-w WORK_DIR]
             [--clean-workdir] [--resource-monitor] [--notrack] [--fs-license-file FILE] [--warp-surfaces-native2std] [--dcan-qc]
             fmri_dir output_dir {participant}
xcp_d: error: the following arguments are required: analysis_level

Hi @connectomeclara,

Add participant after output_dir

Best,
Steven

Hello @Steven !
When I added participant it gave me a new error.

Hi @connectomeclara,

I think your troubles are coming from a fundamental lack of understanding about how bash programs (and particularly BIDS apps and containerized applications) work.

You need to change the arguments to match that file system. Arguments like Fmriprep_dir are generic placeholders that you are supposed to replace with the real paths as found in your file system.

I think understanding this is something you should focus on before getting too deep into neuroimaging analysis.

Please take time to review some repevant information here (Executing with Docker - NiPreps). Particular information for xcp_d is found here (Running XCP-D — xcp_d 0.6.1.dev7+gcc57345 documentation). After you’ve reviewed this and made the necessary changes to the command, please report back if it still is not working.

Best,
Steven

Hello @Steven ! I really appreciate your patience and understanding with me as I learn all of this!
I understand so much more now!
However, I do have a new question. When running the following:

docker run --rm -it \
   -v /$HOME/Desktop/fmriprepinput:ro \
   -v /$HOME/Desktop:/work:rw \
   -v /$HOME/Desktop:/output:rw \
   -v /$HOME/Desktop/license.txt \
   pennlinc/xcp_d:latest \
   /fmriprep /out participant \
   --cifti --despike --head_radius 40 -w /work --smoothing 6

What does /fmriprep /out participant \ represent? Is it the location of a file/directory?
By the way I do have folders named work, output, and fmriprepinput.
I apologize for any unknowledgeable questions.

That is explained in the second link I shared.

Also you mounted the same folder as different folders within docker (eg your work, fmriprep, and out directories are all defined by the same folder), highlighted by the quoted text above. That’s not proper. These should be separate drives.

Best,
Steven

Ah okay! I read that but I wasn’t sure if fmri_dir was the same as /fmriprep /out participant \
The following below would make them separate drives as each is in their appropriate directory, correct?

   -v $HOME/Desktop/fmriprepinput:/fmriprep:ro \
   -v $HOME/Desktop/work:/work:rw \
   -v $HOME/Desktop/output:/output:rw \

Yes, that makes them separate.

Hello @Steven ! I made all of the necessary changes to the command (see below), but I am still having issues.

docker run --rm -it \
   -v $HOME/Desktop/fmriprepinput:/fmriprep:ro \
   -v $HOME/Desktop/work:/work:rw \
   -v $HOME/Desktop/output:/output:rw \
   -v /$HOME/Desktop/license.txt \
   pennlinc/xcp_d:latest \
   /fmriprep /out participant \
   --cifti --despike --head_radius 40 -w /work --smoothing 6


I looked at other issues but I haven’t found one like this yet. Is there anything else I can do?
Thank you so much!

What are the contents here? Can you provide the output of ls on this drive? Does it contain fMRIPrep outputs?

This path is not defined in your Docker command (I think you meant to put /output instead).

Also, I think if you are doing --cifti analysis you’ll need to provide the --fs-license-file.

The ls of fmriprepinput is


Since I used https://github.com/PennLINC/xcp_d to download the fMRIPrep output and I saved the file as fmriprepinput it should all be there.
I will make your suggested changes and report back.
Thanks again!

This does not make sense to me. fMRIPrep outputs come from fMRIPrep software. May you please explain what you mean by this?

I mean that in my last issue post @effigies gave me this link to download the outputs of the fMRIPrep software. I did this because I was having a fundamental issue and was not able to solve it.
I hope this clears things up!

What you displayed does not look like fMRIPrep outputs, it looks like a cloned repo of the XCP_D github repository. You will not be able to run XCP_D until you have outputs from fMRIPrep.

Okay! Thank you for informing me. I will return to the fMRIPrep issue.