I ran the script and it gave me bash fmriprep_singleSubj.sh.save.save.save.save.save.save.save.save.save TEST, AT LEAST WE KNOW THE SCRIPT MADE IT THIS FAR /usr/local/miniconda/lib/python3.7/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the
config_filename,
ignore,
force_index, and
index_metadataarguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the
indexer argument. warnings.warn("The ability to pass arguments to BIDSLayout that control " You are using fMRIPrep-20.2.0, and a newer version of fMRIPrep is available: 23.1.4. Please check out our documentation about how and when to upgrade: https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading WARNING: Version 20.2.0 of fMRIPrep (current) has been FLAGGED (reason: Functional outputs in standard space can be wrong depending on the original data's orientation headers - see https://github.com/nipreps/fmriprep/issues/2307). That means some severe flaw was found in it and we strongly discourage its usage. usage: fmriprep [-h] [--version] [--skip_bids_validation] [--participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]] [-t TASK_ID] [--echo-idx ECHO_IDX] [--bids-filter-file FILE] [--anat-derivatives PATH] [--bids-database-dir PATH] [--nprocs NPROCS] [--omp-nthreads OMP_NTHREADS] [--mem MEMORY_GB] [--low-mem] [--use-plugin FILE] [--anat-only] [--boilerplate_only] [--md-only-boilerplate] [--error-on-aroma-warnings] [-v] [--ignore {fieldmaps,slicetiming,sbref,t2w,flair} [{fieldmaps,slicetiming,sbref,t2w,flair} ...]] [--longitudinal] [--output-spaces [OUTPUT_SPACES [OUTPUT_SPACES ...]]] [--bold2t1w-init {register,header}] [--bold2t1w-dof {6,9,12}] [--force-bbr] [--force-no-bbr] [--medial-surface-nan] [--dummy-scans DUMMY_SCANS] [--random-seed _RANDOM_SEED] [--use-aroma] [--aroma-melodic-dimensionality AROMA_MELODIC_DIM] [--return-all-components] [--fd-spike-threshold REGRESSORS_FD_TH] [--dvars-spike-threshold REGRESSORS_DVARS_TH] [--skull-strip-template SKULL_STRIP_TEMPLATE] [--skull-strip-fixed-seed] [--skull-strip-t1w {auto,skip,force}] [--fmap-bspline] [--fmap-no-demean] [--use-syn-sdc] [--force-syn] [--fs-license-file FILE] [--fs-subjects-dir PATH] [--no-submm-recon] [--cifti-output [{91k,170k}] | --fs-no-reconall] [-w WORK_DIR] [--clean-workdir] [--resource-monitor] [--reports-only] [--config-file FILE] [--write-graph] [--stop-on-first-crash] [--notrack] [--debug {compcor,all} [{compcor,all} ...]] [--sloppy] bids_dir output_dir {participant} fmriprep: error: Path does not exist: </out/license.txt>.
Are you sure the license file is in the derivatives path you specified? And are you sure you changed it to nipreps/fmriprep
?
Yes, here is the script:
`
#!/bin/bash
# Template provided by Daniel Levitas of Indiana University
# Edits by Andrew Jahn, University of Michigan, 07.22.2020
# User inputs:
bids_root_dir=$HOME/Desktop/Flanker
work_dir="/tmp" # Set to /tmp for the temporary directory
subj=08
nthreads=4
mem=20 # gb
container="docker" # docker or singularity
# Begin:
# Convert virtual memory from gb to mb
mem=`echo "${mem//[!0-9]/}"` # remove gb at end
mem_mb=`echo $(((mem*1000)-5000))` # reduce some memory for buffer space during pre-processing
# export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow
echo "TEST, AT LEAST WE KNOW THE SCRIPT MADE IT THIS FAR"
# Run fmriprep with Docker
docker run --rm \
-v $bids_root_dir:/data:ro \
-v $bids_root_dir/derivatives:/out \
nipreps/fmriprep \
/data /out participant \
--participant-label $subj \
--md-only-boilerplate \
--fs-license-file /out/license.txt \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads $nthreads \
--mem_mb $mem_mb`
Why did you remove the working directory from the command?
Can you change it to nipreps/fmriprep:latest
just to make it more explicit?
What is the working directory? And I will do that now.
The working directory is the place where intermediate files are stored, what is set with the -w
argument of fMRIprep.
Here is the original script:
#!/bin/bash
#Template provided by Daniel Levitas of Indiana University
#Edits by Andrew Jahn, University of Michigan, 07.22.2020
#User inputs:
bids_root_dir=$HOME/Desktop/Flanker
subj=08
nthreads=4
mem=20 #gb
container=docker #docker or singularity
#Begin:
#Convert virtual memory from gb to mb
mem=`echo "${mem//[!0-9]/}"` #remove gb at end
mem_mb=`echo $(((mem*1000)-5000))` #reduce some memory for buffer space during pre-processing
#export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow
export FS_LICENSE=$HOME/Desktop/Flanker/derivatives/license.txt
#Run fmriprep
if [ $container == singularity ]; then
unset PYTHONPATH; singularity run -B $HOME/.cache/templateflow:/opt/templateflow $HOME/fmriprep.simg \
$bids_root_dir $bids_root_dir/derivatives \
participant \
--participant-label $subj \
--skip-bids-validation \
--md-only-boilerplate \
--fs-license-file $HOME/Desktop/Flanker/derivatives/license.txt \
--fs-no-reconall \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads $nthreads \
--stop-on-first-crash \
--mem_mb $mem_mb \
else
fmriprep-docker $bids_root_dir $bids_root_dir/derivatives \
participant \
--participant-label $subj \
--skip-bids-validation \
--md-only-boilerplate \
--fs-license-file $HOME/Desktop/Flanker/derivatives/license.txt \
--fs-no-reconall \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads $nthreads \
--stop-on-first-crash \
--mem_mb $mem_mb
fi
Is #export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow export FS_LICENSE=$HOME/Desktop/Flanker/derivatives/license.txt
the working directory because I removed that as I thought this was the issue.
No, templateflow is a repository that contains a lot of brain atlases that are used within fMRIPrep, the the templateflow home directory dictates where it will be downloaded on your filesystem.
Do I add the “#export” back in? Also is there a way to fix the Path does not exist: </out/license.txt>.
Thank you!
Sure you can add it back in.
You can try moving the license out of the bids directory, and then mounting the license into docker with -v /path/to/license.txt:/license.txt
, and then defining the —fs-license-file /license.txt
.
Thank you I will try that!
Edit: When I type -v /path/to/license.txt:/license.txt
I get --v: command not found
That’s supposed to go in your docker command with the other mounting statements
Is this correct?
#!/bin/bash
# Template provided by Daniel Levitas of Indiana University
# Edits by Andrew Jahn, University of Michigan, 07.22.2020
# User inputs:
bids_root_dir=$HOME/Desktop/Flanker
work_dir="/tmp" # Set to /tmp for the temporary directory
subj=08
nthreads=4
mem=20 # gb
container="docker" # docker or singularity
# Begin:
# Convert virtual memory from gb to mb
mem=`echo "${mem//[!0-9]/}"` # remove gb at end
mem_mb=`echo $(((mem*1000)-5000))` # reduce some memory for buffer space during pre-processing
#export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow
export FS_LICENSE=$HOME/Desktop/Flanker/derivatives/license.txt
-v /Home/Desktop/license.txt:/license.txt
echo "TEST, AT LEAST WE KNOW THE SCRIPT MADE IT THIS FAR"
# Run fmriprep with Docker
docker run --rm \
-v $bids_root_dir:/data:ro \
-v $bids_root_dir/derivatives:/out \
nipreps/fmriprep:latest \
/data /out participant \
--participant-label $subj \
--md-only-boilerplate \
--fs-license-file /Home/Desktop/license.txt \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads $nthreads \
--mem_mb $mem_mb
No, you did not add the code in my last answer in the right place. You should add the -v
statement after the other two -v
statements in your docker command, and then change the —fs-license-file
to /license.txt
When I am back in my computer I can edit the code and return it to you.
Like so?
#!/bin/bash
# Template provided by Daniel Levitas of Indiana University
# Edits by Andrew Jahn, University of Michigan, 07.22.2020
# User inputs:
bids_root_dir=$HOME/Desktop/Flanker
work_dir="/tmp" # Set to /tmp for the temporary directory
subj=08
nthreads=4
mem=20 # gb
container="docker" # docker or singularity
# Begin:
# Convert virtual memory from gb to mb
mem=`echo "${mem//[!0-9]/}"` # remove gb at end
mem_mb=`echo $(((mem*1000)-5000))` # reduce some memory for buffer space during pre-processing
#export TEMPLATEFLOW_HOME=$HOME/.cache/templateflow
export FS_LICENSE=$HOME/Desktop/Flanker/derivatives/license.txt
-v /Home/Desktop/license.txt:/license.txt
echo "TEST, AT LEAST WE KNOW THE SCRIPT MADE IT THIS FAR"
# Run fmriprep with Docker
docker run --rm \
-v $bids_root_dir:/data:ro \
-v $bids_root_dir/derivatives:/out \
-v /Home/Desktop/license.txt:/license.txt
nipreps/fmriprep:latest \
/data /out participant \
--participant-label $subj \
--md-only-boilerplate \
/license.txt /Home/Desktop/license.txt \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads $nthreads \
--mem_mb $mem_mb
I would strongly encourage you to use fmriprep-docker
. Constructing a docker command is a bad use of pretty much anybody’s time. Use fmriprep-docker
like you would a regular program, and it will mount everything you need. Make sure that you have an environment variable FS_LICENSE
pointing to your license file, and you don’t need to pass it manually.
pip install --upgrade fmriprep-docker # Or pick a specific version with fmriprep==23.1.4 for example
fmriprep-docker $HOME/Desktop/Flanker \
$HOME/Desktop/Flanker/derivatives/fmriprep participant \
--participant-label 08 \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads=4 --mem-mb 20000
Once you get it running, you can script it to make sure you’re running the same thing across subjects. Scripting is premature before you know the commands will run at all.
Thank you @effigies ! I used it and this was my output:
clara@LAPTOP-15KUVJH2:~$ pip install --upgrade fmriprep-docker # Or pick a specific version with fmriprep==23.1.4 for example
fmriprep-docker $HOME/Desktop/Flanker \
$HOME/Desktop/Flanker/derivatives/fmriprep participant \
--participant-label 08 \
--output-spaces MNI152NLin2009cAsym:res-2 \
--nthreads=4 --mem-mb 20000
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fmriprep-docker in ./.local/lib/python3.10/site-packages (23.1.4)
Warning: <8GB of RAM is available within your Docker environment.
Some parts of fMRIPrep may fail to complete.
Continue anyway? [y/N]y
RUNNING: docker run --rm -e DOCKER_VERSION_8395080871=24.0.6 -it -v /home/clara/Desktop/Flanker:/data:ro -v /home/clara/Desktop/Flanker/derivatives/fmriprep:/out nipreps/fmriprep:23.1.4 /data /out participant --participant-label 08 --nthreads=4 --mem-mb 20000 --output-spaces MNI152NLin2009cAsym:res-2
Traceback (most recent call last):
File "/opt/conda/envs/fmriprep/bin/fmriprep", line 8, in <module>
sys.exit(main())
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/cli/run.py", line 43, in main
parse_args()
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/cli/parser.py", line 786, in parse_args
config.from_dict({})
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/config.py", line 678, in from_dict
execution.load(settings, init=initialize('execution'), ignore=ignore)
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/config.py", line 232, in load
cls.init()
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/fmriprep/config.py", line 476, in init
cls._layout = BIDSLayout(
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/bids/layout/layout.py", line 135, in __init__
root, description = validate_root(root, validate)
File "/opt/conda/envs/fmriprep/lib/python3.10/site-packages/bids/layout/validation.py", line 75, in validate_root
raise BIDSValidationError(
bids.exceptions.BIDSValidationError: 'dataset_description.json' is missing from project root. Every valid BIDS dataset must have this file.
Example contents of 'dataset_description.json':
{"Name": "Example dataset", "BIDSVersion": "1.0.2"}
fMRIPrep: Please report errors to https://github.com/nipreps/fmriprep/issues
You’re missing a dataset_description.json
file.
bids.exceptions.BIDSValidationError: 'dataset_description.json' is missing from project root. Every valid BIDS dataset must have this file.
Example contents of 'dataset_description.json':
{"Name": "Example dataset", "BIDSVersion": "1.0.2"}
Make sure your dataset validates: https://bids-standard.github.io/bids-validator/
Flanker_errors.txt (65.6 KB)
Hello @effigies ! I downloaded the error file but I am unsure of what my next step is.
There’s one error there saying that a field in Flanker/task-flanker_bold.json
has a CogAtlasID
that is not a URI. It’s not critical. Just delete it, if you can’t fix it.
But it doesn’t say that you’re missing dataset_description.json
, so it doesn’t seem that the same directory is being passed to both tools.