MICA-MNI / micapipe

micapipe from the Multimodal imaging and connectome analysis lab (http://mica-mni.github.io) at the Montreal Neurological Institute. Read The Docs documentation below
http://micapipe.readthedocs.io
GNU General Public License v3.0
80 stars 27 forks source link

Running micapipe_cleanup with Docker #43

Closed jinseo0904 closed 1 year ago

jinseo0904 commented 2 years ago

Hello everyone,

I am trying to run micapipe_cleanup using a linux machine with docker. However I keep getting the error that the repository does not exist.

I have been using the following command: docker run -it micalab/micapipe:latest micapipe_cleanup (arguments...) The following command also did not work for me: docker run -it micalab/micapipe:latest /opt/micapipe/functions/micapipe_cleanup (arguments...)

Could anyone help me with constructing a proper Docker command? Thank you in advance!

dkp commented 2 years ago

I'd love to see an example of a proper docker command for the cleanup as well. I've had no success guessing how this should be done.

PeerHerholz commented 2 years ago

Hi @jinseo0904 & @dkp,

sorry for the late reply. Could you maybe share the respective full commands that you tried to run?

Cheers, Peer

dkp commented 2 years ago

@PeerHerholz and @jinseo0904 here's what I tried:

docker run -ti --rm \
    -v ${PWD}/inputs:/bids_dataset:ro \
    -v ${PWD}/outputs:/output_directory \
    -v ${PWD}/working:/tmp \
    -v ${PWD}/inputs/code/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt \
    micalab/micapipe:latest \
    -bids /bids_dataset \
    -out /output_directory \
    -sub 219 -ses itbs \
    /opt/micapipe/functions/micapipe_cleanup -proc_rsfmri
PeerHerholz commented 2 years ago

Hi @dkp,

thx for the information. Hm, not entirely sure tbh. Could you please try the following:

At first, start the container, entering the bash

docker run -ti --rm \
    -v ${PWD}/inputs:/bids_dataset:ro \
    -v ${PWD}/outputs:/output_directory \
    -v ${PWD}/working:/tmp \
    -v ${PWD}/inputs/code/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt \
    --entrypoint /bin/bash \
    micalab/micapipe:latest

and then from within the bash run

micapipe_cleanup \
    -bids /bids_dataset \
    -out /output_directory \
    -sub 219 -ses itbs \
    -proc_rsfmri

Cheers, Peer

dkp commented 2 years ago

Sorry to take so long to get back to you.

The first command correctly put me inside the container...but there, it seems the micapipe_cleanup script cannot be found:

root@3c84af9079b8:/home/mica# micapipe_cleanup -bids /bids_dataset -out /output_directory -sub 219 -ses itbs -proc_rsfmri
bash: micapipe_cleanup: command not found
root@3c84af9079b8:/home/mica# which micapipe_cleanup
root@3c84af9079b8:/home/mica# micapipe_cleanup
bash: micapipe_cleanup: command not found
PeerHerholz commented 2 years ago

Hi there,

sorry for the late reply. Oh, entering via bash might not correctly source paths, etc. . Could you please try to run

bash /neurodocker/startup.sh

after you entered the container via the shell and before you try to run micapipe_cleanup?

Cheers, Peer

dkp commented 2 years ago

@PeerHerholz Thank you for the suggestion, unfortunately running the startup script does not seem to find micapipe_cleanup. I'm happy to try other suggestions and I appreciate your time.

-Dianne

root@6269bc0c63be:/home/mica# bash /neurodocker/startup.sh
Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer-6.0.0
FSFAST_HOME       /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer-6.0.0/subjects
MNI_DIR           /opt/freesurfer-6.0.0/mni
FSL_DIR           /opt/fsl-6.0.0
root@6269bc0c63be:/home/mica#
root@6269bc0c63be:/home/mica# micapipe_cleanup -bids /bids_dataset -out /output_directory -sub 219 -ses itbs -proc_rsfmri
bash: micapipe_cleanup: command not found
root@6269bc0c63be:/home/mica# micapipe_cleanup
bash: micapipe_cleanup: command not found
root@6269bc0c63be:/home/mica#
rcruces commented 1 year ago

Hi, we took this suggestion for our next release v0.1.3 which is being built ATM. With the new release micapipe_cleanup can be call within the main script micapipe to avoid this issues. Please stay tuned for the new container release

rcruces commented 1 year ago

Since the version 0.1.3 and our current version v0.2.0 -cleanup can be called directly from the main script micapipe.

micapipe -cleanup -sub S1 -ses 01 -bids /bids -out -/out

This is an example with the container that will print the help from cleanup:

docker run -ti --rm \
    -v ${bids}:/bids \
    -v ${out}:/out \
    -v ${tmp}:/tmp \
    -v ${surf_dir}:/surf_dir \
    -v ${fs_dir}:/opt/licence.txt \
    micalab/micapipe:v0.2.0 -cleanup -h

In the latest version (v0.2.0) the path to micapipe/functions was added to the container so any function in there is also executable from the docker if you use a /bin/bash entrypoint e.g:

docker run -it --entrypoint /bin/bash \
    -v ${bids}:/bids \
    -v ${out}:/out \
    -v ${tmp}:/tmp \
    -v ${fs_dir}:/opt/licence.txt \
    micalab/micapipe:v0.2.0