### Run fmriprep-docker Source: https://github.com/nipreps/fmriprep/blob/master/docs/installation.md Example of running fMRIPrep using the fmriprep-docker command-line. ```bash $ fmriprep-docker ``` -------------------------------- ### Install fmriprep-docker wrapper Source: https://github.com/nipreps/fmriprep/blob/master/docs/installation.md Command to install the fmriprep-docker wrapper using pip. ```bash $ python -m pip install fmriprep-docker ``` -------------------------------- ### Install templateflow client Source: https://github.com/nipreps/fmriprep/blob/master/docs/faq.md Command to install the templateflow Python client using pip. ```bash $ python -m pip install -U templateflow ``` -------------------------------- ### Legacy Layout Example Source: https://github.com/nipreps/fmriprep/blob/master/docs/outputs.md Example of the directory structure used prior to fMRIPrep 21.0. ```bash / fmriprep/ freesurfer/ ``` -------------------------------- ### Niworkflows import example Source: https://github.com/nipreps/fmriprep/wiki/Code-conventions Example of importing FSL BET from niworkflows' internal nipype version. ```Python from niworkflows.nipype.interfaces import fsl bet = fsl.BET() ``` -------------------------------- ### Install fMRIPrep (bare-metal) Source: https://github.com/nipreps/fmriprep/blob/master/docs/installation.md Command to install fMRIPrep in a manually prepared environment using pip. ```bash $ python -m pip install fmriprep ``` -------------------------------- ### Example of using --derivatives flag Source: https://github.com/nipreps/fmriprep/blob/master/docs/changes.md Demonstrates how to specify pre-computed derivatives directories. ```bash fMRIPrep --derivatives anat=$SMRIPREP_DIR ``` -------------------------------- ### fMRIPrep Command-Line Structure (Bare-metal) Source: https://github.com/nipreps/fmriprep/blob/master/docs/installation.md The basic command-line structure for fMRIPrep in a bare-metal environment. ```bash $ fmriprep ``` -------------------------------- ### fMRIPrep Configuration Example (TOML) Source: https://github.com/nipreps/fmriprep/blob/master/docs/api.md An example of the TOML configuration file used by fMRIPrep to store settings for each run and subject. ```toml [environment] cpu_count = 8 exec_env = "posix" free_mem = 2.2 overcommit_policy = "heuristic" overcommit_limit = "50%" nipype_version = "1.5.0" templateflow_version = "0.4.2" version = "20.0.1" [execution] bids_dir = "ds000005/" bids_description_hash = "5d42e27751bbc884eca87cb4e62b9a0cca0cd86f8e578747fe89b77e6c5b21e5" boilerplate_only = false fs_license_file = "/opt/freesurfer/license.txt" fs_subjects_dir = "/opt/freesurfer/subjects" log_dir = "/home/oesteban/tmp/fmriprep-ds005/out/fmriprep/logs" log_level = 40 low_mem = false md_only_boilerplate = false notrack = true output_dir = "/tmp" output_spaces = "MNI152NLin2009cAsym:res-2 MNI152NLin2009cAsym:res-native fsaverage:den-10k fsaverage:den-30k" reports_only = false run_uuid = "20200306-105302_d365772b-fd60-4741-a722-372c2f558b50" participant_label = [ "01",] processing_groups = [ "sub-01",] templateflow_home = "~/.cache/templateflow" work_dir = "work/" write_graph = false [workflow] anat_only = false bold2anat_dof = 6 fmap_bspline = false force = [] force_syn = false hires = true ignore = [] medial_surface_nan = false project_goodvoxels = false regressors_all_comps = false regressors_dvars_th = 1.5 regressors_fd_th = 0.5 run_reconall = true skull_strip_fixed_seed = false skull_strip_template = "OASIS30ANTs" subject_anatomical_reference = "first-lex" t2s_coreg = false [nipype] crashfile_format = "txt" get_linked_libs = false memory_gb = 32 nprocs = 8 omp_nthreads = 8 plugin = "MultiProc" resource_monitor = false stop_on_first_crash = false [nipype.plugin_args] maxtasksperchild = 1 raise_insufficient = false [execution.bids_filters.t1w] reconstruction = "" [execution.bids_filters.t2w] reconstruction = "" ``` -------------------------------- ### Recon-all error message example Source: https://github.com/nipreps/fmriprep/blob/master/docs/faq.md Example of the error message when recon-all appears to be running, including details about the IsRunning file. ```default RuntimeError: Command: recon-all -autorecon2-volonly -openmp 8 -subjid sub-020 -sd /outputs/freesurfer -nogcareg -nocanorm -nocareg -nonormalization2 -nomaskbfs -nosegmentation -nofill Standard output: Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a INFO: SUBJECTS_DIR is /outputs/freesurfer Actual FREESURFER_HOME /opt/freesurfer -rw-rw-r-- 1 11239 users 207798 Apr 1 16:19 /outputs/freesurfer/sub-020/scripts/recon-all.log Linux 62324c0da859 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux ERROR: it appears that recon-all is already running for sub-020 based on the presence of /outputs/freesurfer/sub-020/scripts/IsRunning.lh+rh. It could also be that recon-all was running at one point but died in an unexpected way. If it is the case that there is a process running, you can kill it and start over or just let it run. If the process has died, you should type: rm /outputs/freesurfer/sub-020/scripts/IsRunning.lh+rh and re-run. Or you can add -no-isrunning to the recon-all command-line. The contents of this file are: ---------------------------------------------------------- ------------------------------ SUBJECT sub-020 HEMI lh rh DATE Fri Mar 22 20:33:09 UTC 2019 USER root HOST 622795a21a5f PROCESSID 55530 PROCESSOR x86_64 OS Linux Linux 622795a21a5f 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $Id: recon-all,v 1.580.2.16 2017/01/18 14:11:24 oesteban Exp $ ---------------------------------------------------------- Standard error: Return code: 1 ``` -------------------------------- ### Check fMRIPrep installation Source: https://github.com/nipreps/fmriprep/blob/master/docs/installation.md Command to verify the fMRIPrep installation by checking its version. ```bash $ fmriprep --version ``` -------------------------------- ### Usage Example Source: https://github.com/nipreps/fmriprep/blob/master/docs/api.md Demonstrates how to use the configuration system to save and load settings, and how to integrate it with workflow execution. ```Python from fmriprep import config config_file = config.execution.work_dir / '.fmriprep.toml' config.to_filename(config_file) # Call build_workflow(config_file, retval) in a subprocess with Manager() as mgr: from .workflow import build_workflow retval = mgr.dict() p = Process(target=build_workflow, args=(str(config_file), retval)) p.start() p.join() config.load(config_file) # Access configs from any code section as: value = config.section.setting ``` -------------------------------- ### Check Docker Installation Source: https://github.com/nipreps/fmriprep/blob/master/wrapper/README.rst Command to check if Docker is installed and running. ```bash docker info ``` -------------------------------- ### Confounds Metadata Example Source: https://github.com/nipreps/fmriprep/blob/master/docs/outputs.md Example JSON metadata file for confound regressors, detailing CompCor components. ```json { "a_comp_cor_00": { "CumulativeVarianceExplained": 0.1081970825, "Mask": "combined", "Method": "aCompCor", "Retained": true, "SingularValue": 25.8270209974, "VarianceExplained": 0.1081970825 }, "dropped_0": { "CumulativeVarianceExplained": 0.5965809597, "Mask": "combined", "Method": "aCompCor", "Retained": false, "SingularValue": 20.7955177198, "VarianceExplained": 0.0701465624 } } ``` -------------------------------- ### Basic fMRIPrep execution command Source: https://github.com/nipreps/fmriprep/blob/master/docs/usage.md An example of the basic command to run fMRIPrep, specifying input data, output directory, processing level, and working directory. ```default fmriprep data/bids_root/ out/ participant -w work/ ``` -------------------------------- ### Initialize local niworkflows with package information Source: https://github.com/nipreps/fmriprep/wiki/Mounting-niworkflows-for-development Commands to initialize a local copy of niworkflows with the necessary egg-info directory for fmriprep to import it. ```bash ~/projects/niworkflows $ docker run --rm -it --entrypoint=bash -v ~/projects/niworkflows:/root/src/src/niworkflows fmriprep root@ad2c3ca4037e:~# cd /root/src/src/niworkflows/ root@ad2c3ca4037e:~/src/src/niworkflows# pip install -e . ``` -------------------------------- ### Example confounds time series table Source: https://github.com/nipreps/fmriprep/blob/master/docs/outputs.md An example of the tabular data found in the confounds time series TSV file. ```text csf white_matter global_signal std_dvars dvars framewise_displacement t_comp_cor_00 t_comp_cor_01 t_comp_cor_02 t_comp_cor_03 t_comp_cor_04 t_comp_cor_05 a_comp_cor_00 a_comp_cor_01 a_comp_cor_02 a_comp_cor_03 a_comp_cor_04 a_comp_cor_05 non_steady_state_outlier00 trans_x trans_y trans_z rot_x rot_y rot_z 682.75275 0.0 491.64752000000004 n/a n/a n/a 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 -0.00017029 -0.0 0.0 669.14166 0.0 489.4421 1.168398 17.575331 0.07211929999999998 -0.4506846719 0.1191909139 -0.0945884724 0.1542023065 -0.2302324641 0.0838194238 -0.032426848599999995 0.4284323184 -0.5809158299 0.1382414008 -0.1203486637 0.3783661265 0.0 0.0 0.0207752 0.0463124 -0.000270924 -0.0 0.0 665.3969 0.0 488.03 1.085204 16.323903999999995 0.0348966 0.010819676200000001 0.0651895837 -0.09556632150000001 -0.033148835 -0.4768871111 0.20641088559999998 0.2818768463 0.4303863764 0.41323714850000004 -0.2115232212 -0.0037154909000000004 0.10636180070000001 0.0 0.0 0.0 0.0457372 0.0 -0.0 0.0 662.82715 0.0 487.37302 1.01591 15.281561 0.0333937 0.3328022893 -0.2220965269 -0.0912891436 0.2326688125 0.279138129 -0.111878887 0.16901660629999998 0.0550480212 0.1798747037 -0.25383302620000003 0.1646403629 0.3953613889 0.0 0.010164 -0.0103568 0.0424513 0.0 -0.0 0.00019174 ``` -------------------------------- ### fmriprep-docker with FS_LICENSE environment variable Source: https://github.com/nipreps/fmriprep/blob/master/docs/usage.md Example showing fmriprep-docker automatically using the FS_LICENSE environment variable. ```default $ export FS_LICENSE=$HOME/.licenses/freesurfer/license.txt $ fmriprep-docker /path/to/data/dir /path/to/output/dir participant RUNNING: docker run --rm -it -v /path/to/data/dir:/data:ro \ -v /home/user/.licenses/freesurfer/license.txt:/opt/freesurfer/license.txt \ -v /path/to_output/dir:/out nipreps/fmriprep:1.0.0 \ /data /out participant ... ``` -------------------------------- ### fMRIPrep 21.0.1 - TOPUP runtime control Source: https://github.com/nipreps/fmriprep/blob/master/docs/changes.md Example of how to control the TOPUP runtime by specifying the maximum number of volumes to use. ```bash fMRIPrep --topup-max-vols ... ```