Python isn’t going to recognize unicode dashes.
I’m using Ubuntu, not Python.
Apologies for being unclear. fMRIPrep is written in Python. If you pass it arguments that it cannot understand, it will not work.
I’m seeing some things confused here, so at the risk of over-explaining, let me lay out the design:
- fMRIPrep is a Python program, run with the form
fmriprep <INPUT> <OUTPUT> participant <FLAGS>
. - We recommend using a Docker container to ensure all dependencies are present. For this, the form becomes
docker run --rm -it <MOUNTS> nipreps/fmriprep:<version> <INPUT> <OUTPUT> participant <FLAGS>
. The mounts are of the form-v <OUTSIDE>:<INSIDE>
and may require changes to the location of INPUT/OUTPUT and some FLAGS. - Because this can be tough to get going on,
fmriprep-docker
provides an interface that will convert fromfmriprep-docker <INPUT> <OUTPUT> participant <FLAGS>
to an adjusteddocker run --rm -it <MOUNTS> nipreps/fmriprep:<version> <INPUT> <OUTPUT> participant <FLAGS>
that allows you to act as if you’re running fMRIPrep directly. So you SHOULD NOT manually add-v
flags.fmriprep-docker
will attempt to pass them tofmriprep
, not Docker.
@effigies, thank you so much for such a thorough explanation as to how fMRIPrep works
However, I removed -v flags (in my earlier posts) and put the code in one line but cannot figure out what I’m missing in my code atm.
Can you copy-paste the full command and outputs? Screenshots are very difficult to work with.
My apologies. Thank you for your help.
Here is my code:
fmriprep-docker /home/rubina/BIDS/ /home/rubina/derivatives participant – –participant–label sub–C0120061 – –fs–license–file /home/rubina/fs-license/license.txt – –low–mem
The output is as follows:
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=20.10.7 -it -v /home/rubina/BIDS/sub-C0120061:/data:ro -v /home/rubina/derivatives:/out nipreps/fmriprep:20.2.2 /data /out participant ––participant–label sub-C0120061 ––fs–license–file /home/rubina/fs-license/license.txt ––low–mem
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_MB] [–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] [–output-layout {bids,legacy}]
[-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: unrecognized arguments: – –participant–label sub-C0120061 – –fs–license–file /home/rubina/fs-license/license.txt – –low–mem
fMRIPrep: Please report errors to Issues · nipreps/fmriprep · GitHub
Here the dashes and spaces are definitely going to cause problems. Can you try copy-pasting the following?
fmriprep-docker /home/rubina/BIDS/ /home/rubina/derivatives participant --participant-label C0120061 --fs-license-file /home/rubina/fs-license/license.txt --low-mem
As suggested, I tried the code:
fmriprep-docker /home/rubina/BIDS/ /home/rubina/derivatives participant --participant-label C0120061 --fs-license-file /home/rubina/fs-license/license.txt --low-mem
I get this error message:
usage: fmriprep-docker [-h] [–version] [-i IMG] [-w WORK_DIR] [–output-spaces [OUTPUT_SPACES [OUTPUT_SPACES …]]]
[–fs-license-file PATH] [–fs-subjects-dir PATH] [–config-file PATH]
[–anat-derivatives PATH] [–use-plugin PATH] [–bids-database-dir PATH]
[–patch PACKAGE=PATH [PACKAGE=PATH …]] [–shell] [–config PATH] [-e ENV_VAR value]
[-u USER] [–network NETWORK] [–no-tty]
[bids_dir] [output_dir] [{participant}]
fmriprep-docker: error: Path should point to a file (or symlink of file): </home/rubina/fs-license/license.txt>.
Does this file exist, if you type ls /home/rubina/fs-license/license.txt
?
It does exists but when I type that command it says:
rubina@DESKTOP-QRBPHG4:~$ ls /home/rubina/fs-license/license.txt
ls: cannot access ‘/home/rubina/fs-license/license.txt’: No such file or directory
It seems it does not exist there, at any rate. What’s its location in Windows?
I’m not sure if this is what you mean:
C:\Users\rubin\fs-license
You should have a license.txt
from FreeSurfer (License - Free Surfer Wiki). Wherever you save that, you should point to it with --fs-license-file
.
Thank you all for your help and explanations @effigies, @jsein, and @Steven
I finally figured what the problem was and why when I typed “ls” in Ubuntu (20.04), it generated a message saying “No such file or directory”.
I’m using Windows, running the fMRIPrep-docker command on Ubuntu and needed to mount file systems in Linux for this to be identified.
Here’s my final code and hope it helps anyone who is or will be facing a similar problem or who reaches the end of this thread:
hi effigies,
following the installation instruction, I tried to run the comment “fmriprep-docker”, and the errors showed like this: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filters=%7B%22reference%22%3A%7B%22nipreps%2Ffmriprep%3A21.0.2%22%3Atrue%7D%7D”: dial unix /var/run/docker.sock: connect: permission denied
Downloading. This may take a while…
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create”: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.
Could not detect memory capacity of Docker container.
Do you have permission to run docker?
then I tried with “sudo fmriprep-docker” the error came with “command not found”;
following your advice, i tried with the comments: find ~/.local -name fmriprep-docker, and it printed as here:
/home/shin/.local/bin/fmriprep-docker
how can I solve these problems? do you know which step went wrong? thx a lot in advance
Did you go through the Docker installation docs? It sounds like you probably skipped Post-installation steps for Linux | Docker Documentation
thx a lot!! I finished the post-installation steps then it worked!
Hello @effigies
I had a problem with the directory of my docker
therefore I tried to change the directory of my docker.
Unfortunately, I didnt do it in the right way and when I wanted to run the fmriprep-docker for one subject faced this error;
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create”: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.
I tried to remove docker to install it again but I wasn’t successful
the codes that I used;
docker system prune -a
docker images -a
docker rmi Image Image
faced the same error;
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create”: dial unix /var/run/docker.sock: connect: permission denied.
I tried theses codes;
sudo apt-get purge docker-engine
sudo apt-get autoremove --purge docker-engine
rm -rf /var/lib/docker
wasnn’t able to remove the docker.
Actually I have 2 question;
1- How can I completely remove the current docker?
2- How can I install Docker in the path I want?
Because all my problems started when docker was installed in a predefined path that didn’t have enough storage space
I am appreciative of your time and help
It appears that your user doesn’t have permissions in docker. I would probably suggest seeking help on the Docker forums if Post-installation steps for Linux | Docker Documentation does not help.
Thank you for your reply.
Best,
Roya