ciftify icon indicating copy to clipboard operation
ciftify copied to clipboard

unable to run ciftify using docker

Open crchinfatt opened this issue 5 years ago • 8 comments

I am trying to run the anatomical pipeline in ciftify using docker. I already have freesurfer output, but I am unable to get the code to run.

My folder structure is as follows:

  • Raw data found under folder called raw (e.g. subject: /raw/sub-participantiD)
  • Freesurfer data found under output (e.g., /output/sub-participantID; have tried to put the freesurfer data within a folder called freesurfer, i.e., /output/freesurfer/participantID)

Code that I have run: docker run -ti --rm -v /Users/ccf/Documents/Analyses/raw:/bids_in:ro -v /Users/ccf/Documents/Analyses/output:/derivatives tigrlab/fmriprep_ciftify:latest /bids_in /derivaties participant --anat_only

Do you have any suggestions on what I might be doing incorrectly?

Thank you.

crchinfatt avatar Sep 25 '19 15:09 crchinfatt

From what you describe - I think you need:

for the freesurfer - it looks like the other option you where mentioning should have worked.. The freesurfer data should be in /output/freesurfer/sub-<participantID>.

docker run -ti --rm -v /Users/ccf/Documents/Analyses/raw:/bids_in:ro -v /Users/ccf/Documents/Analyses/output:/derivatives tigrlab/fmriprep_ciftify:latest /bids_in /derivaties participant --anat_only

dunno if that helps.

You can also try checking that a bids validator is finding the correct number of subjects. (you can run docker with a combined --debug --dry-run flags to get an idea if it is finding the correct files...

edickie avatar Oct 04 '19 13:10 edickie

Hi All, I'm having similar struggles with ciftify and docker. I have freesurfer and fmriprep output from fmriprep 151. I am on a mac pro 10.14.6 and running docker 2.1.0.2. Docker has 32 GB of RAM allocated and 8 cpus.

Any thoughts on what is happening?

Thanks!

docker run --rm -it -v /Users/dpat/license.txt:/opt/freesurfer/license.txt:ro -v ${PWD}:/data -v ${PWD}/derivatives:/out tigrlab/fmriprep_ciftify:latest --debug /data /out participant --participant_label=1012

Running: bids-validator /data 1: [WARN] Tabular file contains custom columns not described in a data dictionary (code: 82 - CUSTOM_COLUMN_WITHOUT_DESCRIPTION) ./sub-1012/func/sub-1012_task-rest_events.tsv Evidence: Columns: TODO -- fill in rows and add more tab-separated columns if desired not defined, please define in: /task-rest_events.json, /events.json,/sub-1012/sub-1012_task-rest_events.json,/sub-1012/sub-1012_events.json,/sub-1012/func/sub-1012_task-rest_events.json,/sub-1012/func/sub-1012_events.json ./sub-1012/sub-1012_scans.tsv Evidence: Columns: operator, randstr not defined, please define in: /scans.json, /sub-1012/sub-1012_scans.json

    Summary:                  Available Tasks:        Available Modalities:
    4305 Files, 3.31GB        rest                    FLAIR
    1 - Subject                                       T1w
    1 - Session                                       defacemask
                                                      bold
                                                      events
                                                      scans
                                                      fieldmap
                                                      fieldmap

2019-11-04 18:22:46.996675 : Starting ciftify participant

Found freesurfer outputs for sub-1012 Running: ciftify_recon_all --n_cpus 1 --ciftify-work-dir /out/ciftify --fs-subjects-dir /out/freesurfer --surf-reg MSMSulc sub-1012 Traceback (most recent call last): File "/home/code/ciftify/ciftify/bidsapp/fmriprep_ciftify.py", line 531, in main() File "/home/code/ciftify/ciftify/bidsapp/fmriprep_ciftify.py", line 525, in main ret = run_participant_workflow(settings) File "/home/code/ciftify/ciftify/bidsapp/fmriprep_ciftify.py", line 229, in run_participant_workflow run_one_participant(settings, participant_label) File "/home/code/ciftify/ciftify/bidsapp/fmriprep_ciftify.py", line 238, in run_one_participant run_ciftify_recon_all(settings, participant_label) File "/home/code/ciftify/ciftify/bidsapp/fmriprep_ciftify.py", line 308, in run_ciftify_recon_all run(run_cmd, dryrun = DRYRUN, env={'FS_LICENSE': settings.fs_license}) File "/home/code/ciftify/ciftify/utils.py", line 400, in run merged_env.update(env) File "/usr/local/miniconda/lib/python3.7/_collections_abc.py", line 841, in update self[key] = other[key] File "/usr/local/miniconda/lib/python3.7/os.py", line 683, in setitem value = self.encodevalue(value) File "/usr/local/miniconda/lib/python3.7/os.py", line 753, in encode raise TypeError("str expected, not %s" % type(value).name) TypeError: str expected, not NoneType

dkp avatar Nov 04 '19 18:11 dkp

From the error message - it looks like it is failing (in a not very user friendly way - sorry about that) when it failing to find a freesurfer license file...ciftify (like fMRIPREP) asks users to get their own freesurfer license and mount it into the container (it just makes the FreeSurfer people happier with us).

You can get a freesurfer license just by adding you acedemic address to their mailing list (https://surfer.nmr.mgh.harvard.edu/registration.html, this is free and should be pretty fast). Instructions on setting up and mounting the license and indicating where it is mounted to with the"--fs-license" flag.. A better explanation of how to do this is here https://fmriprep.readthedocs.io/en/stable/installation.html#the-freesurfer-license

edickie avatar Nov 04 '19 18:11 edickie

Thank you for your quick response! I AM pointing to my own copy of the freesurfer license, in exactly the way that works with fmriprep: -v /Users/dpat/license.txt:/opt/freesurfer/license.txt:ro

(I also ran fmriprep-ciftify the other night with that freesurfer license binding and it did the anatomical processing (or most of it) and produced a freesurfer directory before something caused it to crash: see dir structure below from the crash.)

So, I remain confused (or dense...sorry). As far as I can tell the freesurfer license sitting in my home area is being correctly passed to Docker. What am I missing?

dpat@Saci-7:/Volumes/Main/working/ciftify_derivatives1_crash% tree -L 3 . |-- Screendump_crash.txt |-- fmriprep | |-- dataset_description.json | |-- desc-aparcaseg_dseg.tsv | |-- desc-aseg_dseg.tsv | |-- logs | | |-- CITATION.bib | | |-- CITATION.html | | |-- CITATION.md | | -- CITATION.tex | |-- sub-1012 | | |-- anat | | -- figures | -- sub-1012.html -- freesurfer |-- fsaverage | |-- label | |-- mri | |-- mri.2mm | |-- scripts | |-- surf | -- xhemi -- sub-1012 |-- label |-- mri |-- scripts |-- stats |-- surf |-- tmp |-- touch `-- trash

dkp avatar Nov 04 '19 20:11 dkp

Hi together, I also get a error while running ciftify with docker:

When running: docker run -ti --rm -v $HOME/myinputpath:/data:ro -v $HOME/myoutputpath/hcp:/out tigrlab/fmriprep_ciftify:latest /data /out/out participant --anat_only

I'll get the following error: "bids-validator /data Failed with returncode 1 Could not parse <bids_dir> /data"

Did I miss something? Thank you for your help!

Best Leon

leon-k-martin avatar Feb 03 '21 17:02 leon-k-martin

Weird - sounds like it is having trouble reading the input data. Do the content of $HOME/myinputpath pass the bids validator? https://bids-standard.github.io/bids-validator/

On Wed, Feb 3, 2021 at 12:02 PM Leon Martin [email protected] wrote:

Hi together, I also get a error while running ciftify with docker:

When running: docker run -ti --rm -v $HOME/myinputpath:/data:ro -v $HOME/myoutputpath/hcp:/out tigrlab/fmriprep_ciftify:latest /data /out/out participant --anat_only

I'll get the following error: "bids-validator /data Failed with returncode 1 Could not parse <bids_dir> /data"

Did I miss something? Thank you for your help!

Best Leon

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/124#issuecomment-772664999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5T6IO7Z6FN3U6IIJUDS5F6S3ANCNFSM4I2ODVBQ .

edickie avatar Feb 07 '21 22:02 edickie

Hi dkp,

could you solve the issue in the meanwhile? I'm having the same problem, tried a lot, but could not solve it yet. I would be very grateful for any advice!

Best Marianna

SchmidtME avatar Mar 02 '22 08:03 SchmidtME

@SchmidtME I've been using fmriprep to generate cifti files now that those are compatible with the HCP. -Dianne

dkp avatar Mar 02 '22 18:03 dkp