edickie / ciftify

The tools of the Human Connectome Project (HCP) adapted for working with non-HCP datasets
https://edickie.github.io/ciftify/
MIT License
117 stars 157 forks source link

unable to run ciftify using docker #124

Open crchinfatt opened 5 years ago

crchinfatt commented 5 years ago

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:

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.

edickie commented 5 years ago

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...

dkp commented 5 years ago

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

edickie commented 5 years ago

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

dkp commented 5 years ago

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

leon-k-martin commented 3 years ago

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 /data"

Did I miss something? Thank you for your help!

Best Leon

edickie commented 3 years ago

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 notifications@github.com 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 /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 .

SchmidtME commented 2 years ago

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

dkp commented 2 years ago

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