From fc3971f37a6e67f2510bcd827a6c2beeba4a68b9 Mon Sep 17 00:00:00 2001 From: Michelle Wang Date: Fri, 14 Jun 2024 17:39:22 -0400 Subject: [PATCH] [ENH] Add default tracker config files for fMRIPrep and FreeSurfer, and update default invocation files (#265) * move Nipoppy-specific default values from descriptors to invocation files * use a single descriptor file for Heudiconv * fix descriptors not having CLI entrypoints... * add default tracker config files for fMRIPrep * add default tracker config files for Freesurfer * fix failing tests after merge * add output_spaces to fMRIPrep invocations * rename dcm2bids descriptors * add `converter` field to heudiconv convert invocation (dcm2niix, default) --- ...3.1.0-convert.json => dcm2bids-3.1.0.json} | 14 +- ...repare.json => dcm2bids_helper-3.1.0.json} | 8 +- .../data/descriptors/fmriprep-20.2.7.json | 25 +- .../data/descriptors/fmriprep-23.1.3.json | 25 +- .../descriptors/heudiconv-0.12.2-prepare.json | 254 ------------------ ...2.2-convert.json => heudiconv-0.12.2.json} | 14 +- .../data/descriptors/mriqc-23.1.0.json | 25 +- .../sample_global_config-all_pipelines.json | 26 +- ...sample_global_config-latest_pipelines.json | 13 +- .../dcm2bids-3.1.0-convert.json | 8 +- .../dcm2bids-3.1.0-prepare.json | 7 +- .../sample_invocations/fmriprep-20.2.7.json | 24 +- .../sample_invocations/fmriprep-23.1.3.json | 23 +- .../heudiconv-0.12.2-convert.json | 5 + .../heudiconv-0.12.2-prepare.json | 6 + .../sample_invocations/mriqc-23.1.0.json | 13 +- .../fmriprep-20.2.7.json | 15 ++ .../fmriprep-23.1.3.json | 15 ++ .../freesurfer-6.0.1.json | 27 ++ .../freesurfer-7.3.2.json | 27 ++ nipoppy_cli/tests/test_default_config.py | 30 ++- 21 files changed, 249 insertions(+), 355 deletions(-) rename nipoppy_cli/nipoppy/data/descriptors/{dcm2bids-3.1.0-convert.json => dcm2bids-3.1.0.json} (90%) rename nipoppy_cli/nipoppy/data/descriptors/{dcm2bids-3.1.0-prepare.json => dcm2bids_helper-3.1.0.json} (89%) delete mode 100644 nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-prepare.json rename nipoppy_cli/nipoppy/data/descriptors/{heudiconv-0.12.2-convert.json => heudiconv-0.12.2.json} (93%) create mode 100644 nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-20.2.7.json create mode 100644 nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-23.1.3.json create mode 100644 nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-6.0.1.json create mode 100644 nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-7.3.2.json diff --git a/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-convert.json b/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0.json similarity index 90% rename from nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-convert.json rename to nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0.json index 92c7e7eb..a20a5234 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-convert.json +++ b/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0.json @@ -13,10 +13,7 @@ "list": true, "optional": false, "command-line-flag": "-d", - "value-key": "[DICOM_DIR]", - "default-value": [ - "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]" - ] + "value-key": "[DICOM_DIR]" }, { "name": "participant", @@ -25,8 +22,7 @@ "type": "String", "optional": false, "command-line-flag": "-p", - "value-key": "[PARTICIPANT]", - "default-value": "[[NIPOPPY_PARTICIPANT_ID]]" + "value-key": "[PARTICIPANT]" }, { "name": "session", @@ -35,8 +31,7 @@ "type": "String", "optional": true, "command-line-flag": "-s", - "value-key": "[SESSION]", - "default-value": "[[NIPOPPY_SESSION_ID]]" + "value-key": "[SESSION]" }, { "name": "config", @@ -54,8 +49,7 @@ "type": "String", "optional": true, "command-line-flag": "-o", - "value-key": "[OUTPUT_DIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" + "value-key": "[OUTPUT_DIR]" }, { "name": "auto_extract_entities", diff --git a/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-prepare.json b/nipoppy_cli/nipoppy/data/descriptors/dcm2bids_helper-3.1.0.json similarity index 89% rename from nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-prepare.json rename to nipoppy_cli/nipoppy/data/descriptors/dcm2bids_helper-3.1.0.json index 615ab9ec..947b5928 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/dcm2bids-3.1.0-prepare.json +++ b/nipoppy_cli/nipoppy/data/descriptors/dcm2bids_helper-3.1.0.json @@ -13,10 +13,7 @@ "list": true, "optional": false, "command-line-flag": "-d", - "value-key": "[DICOM_DIR]", - "default-value": [ - "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]" - ] + "value-key": "[DICOM_DIR]" }, { "name": "output_dir", @@ -25,8 +22,7 @@ "type": "String", "optional": true, "command-line-flag": "-o", - "value-key": "[OUTPUT_DIR]", - "default-value": "[[NIPOPPY_DPATH_SCRATCH]]/dcm2bids_helper" + "value-key": "[OUTPUT_DIR]" }, { "name": "nest", diff --git a/nipoppy_cli/nipoppy/data/descriptors/fmriprep-20.2.7.json b/nipoppy_cli/nipoppy/data/descriptors/fmriprep-20.2.7.json index 79257e78..9dff5cbe 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/fmriprep-20.2.7.json +++ b/nipoppy_cli/nipoppy/data/descriptors/fmriprep-20.2.7.json @@ -3,7 +3,7 @@ "description": "fmriprep", "tool-version": "20.2.7", "schema-version": "0.5", - "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [VERSION] [SKIP_BIDS_VALIDATION] [PARTICIPANT_LABEL] [TASK_ID] [ECHO_IDX] [BIDS_FILTERS] [ANAT_DERIVATIVES] [BIDS_DATABASE_DIR] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [LOW_MEM] [USE_PLUGIN] [ANAT_ONLY] [BOILERPLATE_ONLY] [MD_ONLY_BOILERPLATE] [AROMA_ERR_ON_WARN] [VERBOSE_COUNT] [IGNORE] [LONGITUDINAL] [OUTPUT_SPACES] [BOLD2T1W_INIT] [BOLD2T1W_DOF] [USE_BBR] [MEDIAL_SURFACE_NAN] [SLICE_TIME_REF] [DUMMY_SCANS] [_RANDOM_SEED] [USE_AROMA] [AROMA_MELODIC_DIM] [REGRESSORS_ALL_COMPS] [REGRESSORS_FD_TH] [REGRESSORS_DVARS_TH] [SKULL_STRIP_TEMPLATE] [SKULL_STRIP_FIXED_SEED] [SKULL_STRIP_T1W] [FMAP_BSPLINE] [FMAP_NO_DEMEAN] [USE_SYN_SDC] [FORCE_SYN] [FS_LICENSE_FILE] [FS_SUBJECTS_DIR] [HIRES] [CIFTI_OUTPUT] [RUN_RECONALL] [OUTPUT_LAYOUT] [WORK_DIR] [CLEAN_WORKDIR] [RESOURCE_MONITOR] [REPORTS_ONLY] [CONFIG_FILE] [WRITE_GRAPH] [STOP_ON_FIRST_CRASH] [NOTRACK] [DEBUG] [SLOPPY]", + "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] fmriprep [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [VERSION] [SKIP_BIDS_VALIDATION] [PARTICIPANT_LABEL] [TASK_ID] [ECHO_IDX] [BIDS_FILTERS] [ANAT_DERIVATIVES] [BIDS_DATABASE_DIR] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [LOW_MEM] [USE_PLUGIN] [ANAT_ONLY] [BOILERPLATE_ONLY] [MD_ONLY_BOILERPLATE] [AROMA_ERR_ON_WARN] [VERBOSE_COUNT] [IGNORE] [LONGITUDINAL] [OUTPUT_SPACES] [BOLD2T1W_INIT] [BOLD2T1W_DOF] [USE_BBR] [MEDIAL_SURFACE_NAN] [SLICE_TIME_REF] [DUMMY_SCANS] [_RANDOM_SEED] [USE_AROMA] [AROMA_MELODIC_DIM] [REGRESSORS_ALL_COMPS] [REGRESSORS_FD_TH] [REGRESSORS_DVARS_TH] [SKULL_STRIP_TEMPLATE] [SKULL_STRIP_FIXED_SEED] [SKULL_STRIP_T1W] [FMAP_BSPLINE] [FMAP_NO_DEMEAN] [USE_SYN_SDC] [FORCE_SYN] [FS_LICENSE_FILE] [FS_SUBJECTS_DIR] [HIRES] [CIFTI_OUTPUT] [RUN_RECONALL] [OUTPUT_LAYOUT] [WORK_DIR] [CLEAN_WORKDIR] [RESOURCE_MONITOR] [REPORTS_ONLY] [CONFIG_FILE] [WRITE_GRAPH] [STOP_ON_FIRST_CRASH] [NOTRACK] [DEBUG] [SLOPPY]", "inputs": [ { "id": "bids_dir", @@ -11,8 +11,7 @@ "description": "the root folder of a BIDS valid dataset (sub-XXXXX folders should be found at the top level in this folder).", "optional": false, "type": "String", - "value-key": "[BIDS_DIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" + "value-key": "[BIDS_DIR]" }, { "id": "output_dir", @@ -20,8 +19,7 @@ "description": "the output path for the outcomes of preprocessing and visual reports", "optional": false, "type": "String", - "value-key": "[OUTPUT_DIR]", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]" + "value-key": "[OUTPUT_DIR]" }, { "id": "analysis_level", @@ -32,8 +30,7 @@ "value-key": "[ANALYSIS_LEVEL]", "value-choices": [ "participant" - ], - "default-value": "participant" + ] }, { "id": "version", @@ -61,10 +58,7 @@ "type": "String", "value-key": "[PARTICIPANT_LABEL]", "list": true, - "command-line-flag": "--participant-label", - "default-value": [ - "[[NIPOPPY_PARTICIPANT_ID]]" - ] + "command-line-flag": "--participant-label" }, { "id": "task_id", @@ -109,8 +103,7 @@ "optional": true, "type": "String", "value-key": "[BIDS_DATABASE_DIR]", - "command-line-flag": "--bids-database-dir", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]" + "command-line-flag": "--bids-database-dir" }, { "id": "nprocs", @@ -450,8 +443,7 @@ "optional": true, "type": "String", "value-key": "[FS_SUBJECTS_DIR]", - "command-line-flag": "--fs-subjects-dir", - "default-value": "[[NIPOPPY_DPATH_DERIVATIVES]]/freesurfer/6.0.1/output/[[NIPOPPY_BIDS_SESSION]]" + "command-line-flag": "--fs-subjects-dir" }, { "id": "hires", @@ -505,8 +497,7 @@ "optional": true, "type": "String", "value-key": "[WORK_DIR]", - "command-line-flag": "-w", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_WORK]]" + "command-line-flag": "-w" }, { "id": "clean_workdir", diff --git a/nipoppy_cli/nipoppy/data/descriptors/fmriprep-23.1.3.json b/nipoppy_cli/nipoppy/data/descriptors/fmriprep-23.1.3.json index 95c57a95..481e8b0e 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/fmriprep-23.1.3.json +++ b/nipoppy_cli/nipoppy/data/descriptors/fmriprep-23.1.3.json @@ -3,7 +3,7 @@ "description": "fmriprep", "tool-version": "23.1.3", "schema-version": "0.5", - "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [SKIP_BIDS_VALIDATION] [PARTICIPANT_LABEL] [TASK_ID] [ECHO_IDX] [BIDS_FILTERS] [ANAT_DERIVATIVES] [BIDS_DATABASE_DIR] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [LOW_MEM] [USE_PLUGIN] [SLOPPY] [ANAT_ONLY] [BOILERPLATE_ONLY] [REPORTS_ONLY] [IGNORE] [OUTPUT_SPACES] [LONGITUDINAL] [BOLD2T1W_INIT] [BOLD2T1W_DOF] [USE_BBR] [SLICE_TIME_REF] [DUMMY_SCANS] [_RANDOM_SEED] [ME_T2S_FIT_METHOD] [OUTPUT_LAYOUT] [ME_OUTPUT_ECHOS] [MEDIAL_SURFACE_NAN] [PROJECT_GOODVOXELS] [MD_ONLY_BOILERPLATE] [CIFTI_OUTPUT] [USE_AROMA] [AROMA_MELODIC_DIM] [AROMA_ERR_ON_WARN] [REGRESSORS_ALL_COMPS] [REGRESSORS_FD_TH] [REGRESSORS_DVARS_TH] [SKULL_STRIP_TEMPLATE] [SKULL_STRIP_FIXED_SEED] [SKULL_STRIP_T1W] [FMAP_BSPLINE] [FMAP_NO_DEMEAN] [USE_SYN_SDC] [FORCE_SYN] [FS_LICENSE_FILE] [FS_SUBJECTS_DIR] [HIRES] [RUN_RECONALL] [TRACK_CARBON] [COUNTRY_CODE] [VERSION] [VERBOSE_COUNT] [WORK_DIR] [CLEAN_WORKDIR] [RESOURCE_MONITOR] [CONFIG_FILE] [WRITE_GRAPH] [STOP_ON_FIRST_CRASH] [NOTRACK] [DEBUG]", + "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] fmriprep [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [SKIP_BIDS_VALIDATION] [PARTICIPANT_LABEL] [TASK_ID] [ECHO_IDX] [BIDS_FILTERS] [ANAT_DERIVATIVES] [BIDS_DATABASE_DIR] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [LOW_MEM] [USE_PLUGIN] [SLOPPY] [ANAT_ONLY] [BOILERPLATE_ONLY] [REPORTS_ONLY] [IGNORE] [OUTPUT_SPACES] [LONGITUDINAL] [BOLD2T1W_INIT] [BOLD2T1W_DOF] [USE_BBR] [SLICE_TIME_REF] [DUMMY_SCANS] [_RANDOM_SEED] [ME_T2S_FIT_METHOD] [OUTPUT_LAYOUT] [ME_OUTPUT_ECHOS] [MEDIAL_SURFACE_NAN] [PROJECT_GOODVOXELS] [MD_ONLY_BOILERPLATE] [CIFTI_OUTPUT] [USE_AROMA] [AROMA_MELODIC_DIM] [AROMA_ERR_ON_WARN] [REGRESSORS_ALL_COMPS] [REGRESSORS_FD_TH] [REGRESSORS_DVARS_TH] [SKULL_STRIP_TEMPLATE] [SKULL_STRIP_FIXED_SEED] [SKULL_STRIP_T1W] [FMAP_BSPLINE] [FMAP_NO_DEMEAN] [USE_SYN_SDC] [FORCE_SYN] [FS_LICENSE_FILE] [FS_SUBJECTS_DIR] [HIRES] [RUN_RECONALL] [TRACK_CARBON] [COUNTRY_CODE] [VERSION] [VERBOSE_COUNT] [WORK_DIR] [CLEAN_WORKDIR] [RESOURCE_MONITOR] [CONFIG_FILE] [WRITE_GRAPH] [STOP_ON_FIRST_CRASH] [NOTRACK] [DEBUG]", "inputs": [ { "id": "bids_dir", @@ -11,8 +11,7 @@ "description": "The root folder of a BIDS valid dataset (sub-XXXXX folders should be found at the top level in this folder).", "optional": false, "type": "String", - "value-key": "[BIDS_DIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" + "value-key": "[BIDS_DIR]" }, { "id": "output_dir", @@ -20,8 +19,7 @@ "description": "The output path for the outcomes of preprocessing and visual reports", "optional": false, "type": "String", - "value-key": "[OUTPUT_DIR]", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]" + "value-key": "[OUTPUT_DIR]" }, { "id": "analysis_level", @@ -32,8 +30,7 @@ "value-key": "[ANALYSIS_LEVEL]", "value-choices": [ "participant" - ], - "default-value": "participant" + ] }, { "id": "skip_bids_validation", @@ -52,10 +49,7 @@ "type": "String", "value-key": "[PARTICIPANT_LABEL]", "list": true, - "command-line-flag": "--participant-label", - "default-value": [ - "[[NIPOPPY_PARTICIPANT_ID]]" - ] + "command-line-flag": "--participant-label" }, { "id": "task_id", @@ -100,8 +94,7 @@ "optional": true, "type": "String", "value-key": "[BIDS_DATABASE_DIR]", - "command-line-flag": "--bids-database-dir", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]" + "command-line-flag": "--bids-database-dir" }, { "id": "nprocs", @@ -508,8 +501,7 @@ "optional": true, "type": "String", "value-key": "[FS_SUBJECTS_DIR]", - "command-line-flag": "--fs-subjects-dir", - "default-value": "[[NIPOPPY_DPATH_DERIVATIVES]]/freesurfer/7.3.2/output/[[NIPOPPY_BIDS_SESSION]]" + "command-line-flag": "--fs-subjects-dir" }, { "id": "hires", @@ -578,8 +570,7 @@ "optional": true, "type": "String", "value-key": "[WORK_DIR]", - "command-line-flag": "-w", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_WORK]]" + "command-line-flag": "-w" }, { "id": "clean_workdir", diff --git a/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-prepare.json b/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-prepare.json deleted file mode 100644 index d0f32e40..00000000 --- a/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-prepare.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "name": "heudiconv", - "description": "heudiconv", - "tool-version": "0.12.2", - "schema-version": "0.5", - "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] [VERSION] [DICOM_DIR_TEMPLATE] [FILES] [SUBJS] [CONVERTER] [OUTDIR] [LOCATOR] [CONV_OUTDIR] [ANON_CMD] [HEURISTIC] [WITH_PROV] [SESSION] [BIDS_OPTIONS] [OVERWRITE] [DATALAD] [DEBUG] [COMMAND] [GROUPING] [MINMETA] [RANDOM_SEED] [DCMCONFIG] [QUEUE] [QUEUE_ARGS]", - "inputs": [ - { - "name": "version", - "id": "version", - "description": "show program's version number and exit", - "type": "String", - "optional": true, - "command-line-flag": "--version", - "value-key": "[VERSION]" - }, - { - "name": "dicom_dir_template", - "id": "dicom_dir_template", - "description": "Location of dicomdir that can be indexed with subject id {subject} and session {session}. Tarballs (can be compressed) are supported in addition to directory. All matching tarballs for a subject are extracted and their content processed in a single pass. If multiple tarballs are found, each is assumed to be a separate session and the --ses argument is ignored. Note that you might need to surround the value with quotes to avoid {...} being considered by shell", - "type": "String", - "optional": true, - "command-line-flag": "-d", - "value-key": "[DICOM_DIR_TEMPLATE]", - "default-value": "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]/*" - }, - { - "name": "files", - "id": "files", - "description": "Files (tarballs, dicoms) or directories containing files to process. Cannot be provided if using --dicom_dir_template.", - "type": "String", - "optional": true, - "command-line-flag": "--files", - "value-key": "[FILES]" - }, - { - "name": "subjs", - "id": "subjs", - "description": "List of subjects - required for dicom template. If not provided, DICOMS would first be \"sorted\" and subject IDs deduced by the heuristic.", - "type": "String", - "optional": true, - "command-line-flag": "-s", - "value-key": "[SUBJS]", - "default-value": "[[NIPOPPY_PARTICIPANT_ID]]" - }, - { - "name": "converter", - "id": "converter", - "description": "Tool to use for DICOM conversion. Setting to \"none\" disables the actual conversion step -- useful for testing heuristics.", - "type": "String", - "optional": true, - "command-line-flag": "-c", - "value-key": "[CONVERTER]", - "value-choices": [ - "dcm2niix", - "none" - ], - "default-value": "none" - }, - { - "name": "outdir", - "id": "outdir", - "description": "Output directory for conversion setup (for further customization and future reference. This directory will refer to non-anonymized subject IDs.", - "type": "String", - "optional": true, - "command-line-flag": "-o", - "value-key": "[OUTDIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" - }, - { - "name": "locator", - "id": "locator", - "description": "Study path under outdir. If provided, it overloads the value provided by the heuristic. If --datalad is enabled, every directory within locator becomes a super-dataset thus establishing a hierarchy. Setting to \"unknown\" will skip that dataset.", - "type": "String", - "optional": true, - "command-line-flag": "-l", - "value-key": "[LOCATOR]" - }, - { - "name": "conv_outdir", - "id": "conv_outdir", - "description": "Output directory for converted files. By default this is identical to --outdir. This option is most useful in combination with --anon-cmd.", - "type": "String", - "optional": true, - "command-line-flag": "-a", - "value-key": "[CONV_OUTDIR]" - }, - { - "name": "anon_cmd", - "id": "anon_cmd", - "description": "Command to run to convert subject IDs used for DICOMs to anonymized IDs. Such command must take a single argument and return a single anonymized ID. Also see --conv-outdir.", - "type": "String", - "optional": true, - "command-line-flag": "--anon-cmd", - "value-key": "[ANON_CMD]" - }, - { - "name": "heuristic", - "id": "heuristic", - "description": "Name of a known heuristic or path to the Python script containing heuristic.", - "type": "String", - "optional": true, - "command-line-flag": "-f", - "value-key": "[HEURISTIC]", - "default-value": "convertall" - }, - { - "name": "with_prov", - "id": "with_prov", - "description": "Store additional provenance information. Requires python-rdflib.", - "type": "Flag", - "optional": true, - "command-line-flag": "-p", - "value-key": "[WITH_PROV]" - }, - { - "name": "session", - "id": "session", - "description": "Session for longitudinal study_sessions. Default is None.", - "type": "String", - "optional": true, - "command-line-flag": "-ss", - "value-key": "[SESSION]", - "default-value": "[[NIPOPPY_BIDS_SESSION]]" - }, - { - "name": "bids_options", - "id": "bids_options", - "description": "Flag for output into BIDS structure. Can also take BIDS-specific options, e.g., --bids notop. The only currently supported options is \"notop\", which skips creation of top-level BIDS files. This is useful when running in batch mode to prevent possible race conditions.", - "type": "String", - "optional": true, - "command-line-flag": "-b", - "value-key": "[BIDS_OPTIONS]", - "value-choices": [ - "notop" - ] - }, - { - "name": "overwrite", - "id": "overwrite", - "description": "Overwrite existing converted files.", - "type": "Flag", - "optional": true, - "command-line-flag": "--overwrite", - "value-key": "[OVERWRITE]" - }, - { - "name": "datalad", - "id": "datalad", - "description": "Store the entire collection as DataLad dataset(s). Small files will be committed directly to git, while large to annex. New version (6) of annex repositories will be used in a \"thin\" mode so it would look to mortals as just any other regular directory (i.e. no symlinks to under .git/annex). For now just for BIDS mode.", - "type": "Flag", - "optional": true, - "command-line-flag": "--datalad", - "value-key": "[DATALAD]" - }, - { - "name": "debug", - "id": "debug", - "description": "Do not catch exceptions and show exception traceback.", - "type": "Flag", - "optional": true, - "command-line-flag": "--dbg", - "value-key": "[DEBUG]" - }, - { - "name": "command", - "id": "command", - "description": "Custom action to be performed on provided files instead of regular operation.", - "type": "String", - "optional": true, - "command-line-flag": "--command", - "value-key": "[COMMAND]", - "value-choices": [ - "heuristics", - "heuristic-info", - "ls", - "populate-templates", - "sanitize-jsons", - "treat-jsons", - "populate-intended-for" - ] - }, - { - "name": "grouping", - "id": "grouping", - "description": "How to group dicoms (default: by studyUID).", - "type": "String", - "optional": true, - "default-value": "studyUID", - "command-line-flag": "-g", - "value-key": "[GROUPING]", - "value-choices": [ - "studyUID", - "accession_number", - "all", - "custom" - ] - }, - { - "name": "minmeta", - "id": "minmeta", - "description": "Exclude dcmstack meta information in sidecar jsons.", - "type": "Flag", - "optional": true, - "command-line-flag": "--minmeta", - "value-key": "[MINMETA]" - }, - { - "name": "random_seed", - "id": "random_seed", - "description": "Random seed to initialize RNG.", - "type": "Number", - "optional": true, - "command-line-flag": "--random-seed", - "value-key": "[RANDOM_SEED]" - }, - { - "name": "dcmconfig", - "id": "dcmconfig", - "description": "JSON file for additional dcm2niix configuration.", - "type": "String", - "optional": true, - "command-line-flag": "--dcmconfig", - "value-key": "[DCMCONFIG]" - }, - { - "name": "queue", - "id": "queue", - "description": "Batch system to submit jobs in parallel.", - "type": "String", - "optional": true, - "command-line-flag": "-q", - "value-key": "[QUEUE]", - "value-choices": [ - "SLURM" - ] - }, - { - "name": "queue_args", - "id": "queue_args", - "description": "Additional queue arguments passed as a single string of space-separated Argument=Value pairs.", - "type": "String", - "optional": true, - "command-line-flag": "--queue-args", - "value-key": "[QUEUE_ARGS]" - } - ], - "tags": {}, - "suggested-resources": { - "cpu-cores": 1, - "ram": 1, - "walltime-estimate": 60 - } -} diff --git a/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-convert.json b/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2.json similarity index 93% rename from nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-convert.json rename to nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2.json index c73e7d65..a658878b 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2-convert.json +++ b/nipoppy_cli/nipoppy/data/descriptors/heudiconv-0.12.2.json @@ -3,7 +3,7 @@ "description": "heudiconv", "tool-version": "0.12.2", "schema-version": "0.5", - "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] [VERSION] [DICOM_DIR_TEMPLATE] [FILES] [SUBJS] [CONVERTER] [OUTDIR] [LOCATOR] [CONV_OUTDIR] [ANON_CMD] [HEURISTIC] [WITH_PROV] [SESSION] [BIDS_OPTIONS] [OVERWRITE] [DATALAD] [DEBUG] [COMMAND] [GROUPING] [MINMETA] [RANDOM_SEED] [DCMCONFIG] [QUEUE] [QUEUE_ARGS]", + "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] heudiconv [VERSION] [DICOM_DIR_TEMPLATE] [FILES] [SUBJS] [CONVERTER] [OUTDIR] [LOCATOR] [CONV_OUTDIR] [ANON_CMD] [HEURISTIC] [WITH_PROV] [SESSION] [BIDS_OPTIONS] [OVERWRITE] [DATALAD] [DEBUG] [COMMAND] [GROUPING] [MINMETA] [RANDOM_SEED] [DCMCONFIG] [QUEUE] [QUEUE_ARGS]", "inputs": [ { "name": "version", @@ -21,8 +21,7 @@ "type": "String", "optional": true, "command-line-flag": "-d", - "value-key": "[DICOM_DIR_TEMPLATE]", - "default-value": "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]/*" + "value-key": "[DICOM_DIR_TEMPLATE]" }, { "name": "files", @@ -40,8 +39,7 @@ "type": "String", "optional": true, "command-line-flag": "-s", - "value-key": "[SUBJS]", - "default-value": "[[NIPOPPY_PARTICIPANT_ID]]" + "value-key": "[SUBJS]" }, { "name": "converter", @@ -64,8 +62,7 @@ "type": "String", "optional": true, "command-line-flag": "-o", - "value-key": "[OUTDIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" + "value-key": "[OUTDIR]" }, { "name": "locator", @@ -119,8 +116,7 @@ "type": "String", "optional": true, "command-line-flag": "-ss", - "value-key": "[SESSION]", - "default-value": "[[NIPOPPY_BIDS_SESSION]]" + "value-key": "[SESSION]" }, { "name": "bids_options", diff --git a/nipoppy_cli/nipoppy/data/descriptors/mriqc-23.1.0.json b/nipoppy_cli/nipoppy/data/descriptors/mriqc-23.1.0.json index 37d5b27f..52f8c69d 100644 --- a/nipoppy_cli/nipoppy/data/descriptors/mriqc-23.1.0.json +++ b/nipoppy_cli/nipoppy/data/descriptors/mriqc-23.1.0.json @@ -3,7 +3,7 @@ "description": "mriqc", "tool-version": "23.1.0", "schema-version": "0.5", - "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [VERSION] [VERBOSE_COUNT] [SPECIES] [PARTICIPANT_LABEL] [SESSION_ID] [RUN_ID] [TASK_ID] [MODALITIES] [DSNAME] [BIDS_DATABASE_DIR] [BIDS_DATABASE_WIPE] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [DEBUG] [FLOAT32] [PDB] [WORK_DIR] [VERBOSE_REPORTS] [REPORTS_ONLY] [WRITE_GRAPH] [DRY_RUN] [RESOURCE_MONITOR] [USE_PLUGIN] [NO_SUB] [EMAIL] [WEBAPI_URL] [WEBAPI_PORT] [UPLOAD_STRICT] [NOTRACK] [ANTS_FLOAT] [ANTS_SETTINGS] [FFT_SPIKES_DETECTOR] [FD_THRES] [DEOBLIQUE] [DESPIKE] [START_IDX] [STOP_IDX]", + "command-line": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]] mriqc [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [VERSION] [VERBOSE_COUNT] [SPECIES] [PARTICIPANT_LABEL] [SESSION_ID] [RUN_ID] [TASK_ID] [MODALITIES] [DSNAME] [BIDS_DATABASE_DIR] [BIDS_DATABASE_WIPE] [NPROCS] [OMP_NTHREADS] [MEMORY_GB] [DEBUG] [FLOAT32] [PDB] [WORK_DIR] [VERBOSE_REPORTS] [REPORTS_ONLY] [WRITE_GRAPH] [DRY_RUN] [RESOURCE_MONITOR] [USE_PLUGIN] [NO_SUB] [EMAIL] [WEBAPI_URL] [WEBAPI_PORT] [UPLOAD_STRICT] [NOTRACK] [ANTS_FLOAT] [ANTS_SETTINGS] [FFT_SPIKES_DETECTOR] [FD_THRES] [DEOBLIQUE] [DESPIKE] [START_IDX] [STOP_IDX]", "inputs": [ { "id": "bids_dir", @@ -11,8 +11,7 @@ "description": "The root folder of a BIDS valid dataset (sub-XXXXX folders should be found at the top level in this folder).", "optional": false, "type": "String", - "value-key": "[BIDS_DIR]", - "default-value": "[[NIPOPPY_DPATH_BIDS]]" + "value-key": "[BIDS_DIR]" }, { "id": "output_dir", @@ -20,8 +19,7 @@ "description": "The directory where the output files should be stored. If you are running group level analysis this folder should be prepopulated with the results of the participant level analysis.", "optional": false, "type": "String", - "value-key": "[OUTPUT_DIR]", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]" + "value-key": "[OUTPUT_DIR]" }, { "id": "analysis_level", @@ -33,8 +31,7 @@ "value-choices": [ "participant", "group" - ], - "default-value": "participant" + ] }, { "id": "version", @@ -80,10 +77,7 @@ "type": "String", "value-key": "[PARTICIPANT_LABEL]", "list": true, - "command-line-flag": "--participant-label", - "default-value": [ - "[[NIPOPPY_PARTICIPANT_ID]]" - ] + "command-line-flag": "--participant-label" }, { "id": "session_id", @@ -92,8 +86,7 @@ "optional": true, "type": "String", "value-key": "[SESSION_ID]", - "command-line-flag": "--session-id", - "default-value": "[[NIPOPPY_SESSION_ID]]" + "command-line-flag": "--session-id" }, { "id": "run_id", @@ -151,8 +144,7 @@ "optional": true, "type": "String", "value-key": "[BIDS_DATABASE_DIR]", - "command-line-flag": "--bids-database-dir", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]" + "command-line-flag": "--bids-database-dir" }, { "id": "bids_database_wipe", @@ -225,8 +217,7 @@ "optional": true, "type": "String", "value-key": "[WORK_DIR]", - "command-line-flag": "-w", - "default-value": "[[NIPOPPY_DPATH_PIPELINE_WORK]]" + "command-line-flag": "-w" }, { "id": "verbose_reports", diff --git a/nipoppy_cli/nipoppy/data/examples/sample_global_config-all_pipelines.json b/nipoppy_cli/nipoppy/data/examples/sample_global_config-all_pipelines.json index 1d94b209..fc94f7f8 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_global_config-all_pipelines.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_global_config-all_pipelines.json @@ -33,12 +33,12 @@ { "NAME": "prepare", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json" + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "convert", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json", "CONTAINER_CONFIG": { "ARGS": [ "--bind", @@ -59,12 +59,12 @@ { "NAME": "prepare", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json" + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/dcm2bids_helper-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "convert", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/dcm2bids-[[NIPOPPY_PIPELINE_VERSION]].json", "CONTAINER_CONFIG": { "ARGS": [ "--bind", @@ -99,7 +99,8 @@ "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json", "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" } - ] + ], + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "fmriprep", @@ -124,7 +125,20 @@ "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json", "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" } - ] + ], + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" + }, + { + "NAME": "freesurfer", + "VERSION": "7.3.2", + "DESCRIPTION": "Freesurfer version associated with fMRIPrep 23.1.3", + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" + }, + { + "NAME": "freesurfer", + "VERSION": "6.0.1", + "DESCRIPTION": "Freesurfer version associated with fMRIPrep 20.2.7", + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "mriqc", diff --git a/nipoppy_cli/nipoppy/data/examples/sample_global_config-latest_pipelines.json b/nipoppy_cli/nipoppy/data/examples/sample_global_config-latest_pipelines.json index 84913130..ffea28ab 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_global_config-latest_pipelines.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_global_config-latest_pipelines.json @@ -33,12 +33,12 @@ { "NAME": "prepare", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-prepare.json" + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "convert", "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", - "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]]-convert.json", + "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json", "CONTAINER_CONFIG": { "ARGS": [ "--bind", @@ -99,7 +99,14 @@ "INVOCATION_FILE": "[[NIPOPPY_DPATH_INVOCATIONS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json", "DESCRIPTOR_FILE": "[[NIPOPPY_DPATH_DESCRIPTORS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" } - ] + ], + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" + }, + { + "NAME": "freesurfer", + "VERSION": "7.3.2", + "DESCRIPTION": "Freesurfer version associated with fMRIPrep 23.1.3", + "TRACKER_CONFIG_FILE": "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]/[[NIPOPPY_PIPELINE_NAME]]-[[NIPOPPY_PIPELINE_VERSION]].json" }, { "NAME": "mriqc", diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-convert.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-convert.json index 27f76062..11aa8db2 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-convert.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-convert.json @@ -1,3 +1,9 @@ { - "config": "[[DCM2BIDS_CONFIG_FILE]]" + "dicom_dir": [ + "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]" + ], + "participant": "[[NIPOPPY_PARTICIPANT_ID]]", + "session": "[[NIPOPPY_SESSION_ID]]", + "config": "[[DCM2BIDS_CONFIG_FILE]]", + "output_dir": "[[NIPOPPY_DPATH_BIDS]]" } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-prepare.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-prepare.json index 0967ef42..d0f71301 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-prepare.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/dcm2bids-3.1.0-prepare.json @@ -1 +1,6 @@ -{} +{ + "dicom_dir": [ + "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]" + ], + "output_dir": "[[NIPOPPY_DPATH_SCRATCH]]/dcm2bids_helper" +} diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-20.2.7.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-20.2.7.json index a0f5b1cd..4fa285ca 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-20.2.7.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-20.2.7.json @@ -1,12 +1,24 @@ { - "anat_only": true, - "fs_license_file": "[[FREESURFER_LICENSE_FILE]]", + "bids_dir": "[[NIPOPPY_DPATH_BIDS]]", + "output_dir": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]", + "analysis_level": "participant", "skip_bids_validation": true, - "regressors_all_comps": true, - "write_graph": true, - "notrack": true, + "participant_label": [ + "[[NIPOPPY_PARTICIPANT_ID]]" + ], + "bids_database_dir": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]", "nprocs": "8", "omp_nthreads": "4", "memory_gb": "4G", - "verbose_count": "-v" + "anat_only": true, + "verbose_count": "-v", + "output_spaces": [ + "MNI152NLin2009cAsym" + ], + "regressors_all_comps": true, + "fs_license_file": "[[FREESURFER_LICENSE_FILE]]", + "fs_subjects_dir": "[[NIPOPPY_DPATH_DERIVATIVES]]/freesurfer/6.0.1/output/[[NIPOPPY_BIDS_SESSION]]", + "work_dir": "[[NIPOPPY_DPATH_PIPELINE_WORK]]", + "write_graph": true, + "notrack": true } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-23.1.3.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-23.1.3.json index 7e0a5939..4cfa810e 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-23.1.3.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/fmriprep-23.1.3.json @@ -1,11 +1,24 @@ { - "fs_license_file": "[[FREESURFER_LICENSE_FILE]]", + "bids_dir": "[[NIPOPPY_DPATH_BIDS]]", + "output_dir": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]", + "analysis_level": "participant", "skip_bids_validation": true, - "regressors_all_comps": true, - "write_graph": true, - "notrack": true, + "participant_label": [ + "[[NIPOPPY_PARTICIPANT_ID]]" + ], + "bids_database_dir": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]", "nprocs": "8", "omp_nthreads": "4", "memory_gb": "4G", - "verbose_count": "-v" + "anat_only": true, + "output_spaces": [ + "MNI152NLin2009cAsym" + ], + "regressors_all_comps": true, + "fs_license_file": "[[FREESURFER_LICENSE_FILE]]", + "fs_subjects_dir": "[[NIPOPPY_DPATH_DERIVATIVES]]/freesurfer/7.3.2/output/[[NIPOPPY_BIDS_SESSION]]", + "verbose_count": "-v", + "work_dir": "[[NIPOPPY_DPATH_PIPELINE_WORK]]", + "write_graph": true, + "notrack": true } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-convert.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-convert.json index 105ac6e0..b20ab352 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-convert.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-convert.json @@ -1,5 +1,10 @@ { + "dicom_dir_template": "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]/*", + "subjs": "[[NIPOPPY_PARTICIPANT_ID]]", + "converter": "dcm2niix", + "outdir": "[[NIPOPPY_DPATH_BIDS]]", "heuristic": "[[HEUDICONV_HEURISTIC_FILE]]", + "session": "[[NIPOPPY_BIDS_SESSION]]", "overwrite": true, "minmeta": true } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-prepare.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-prepare.json index 43a96354..407b9b8f 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-prepare.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/heudiconv-0.12.2-prepare.json @@ -1,3 +1,9 @@ { + "dicom_dir_template": "[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT_ID]]/[[NIPOPPY_BIDS_SESSION]]/*", + "subjs": "[[NIPOPPY_PARTICIPANT_ID]]", + "converter": "none", + "outdir": "[[NIPOPPY_DPATH_BIDS]]", + "heuristic": "convertall", + "session": "[[NIPOPPY_BIDS_SESSION]]", "overwrite": true } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_invocations/mriqc-23.1.0.json b/nipoppy_cli/nipoppy/data/examples/sample_invocations/mriqc-23.1.0.json index 45671bdf..81a8b676 100644 --- a/nipoppy_cli/nipoppy/data/examples/sample_invocations/mriqc-23.1.0.json +++ b/nipoppy_cli/nipoppy/data/examples/sample_invocations/mriqc-23.1.0.json @@ -1,8 +1,17 @@ { + "bids_dir": "[[NIPOPPY_DPATH_BIDS]]", + "output_dir": "[[NIPOPPY_DPATH_PIPELINE_OUTPUT]]", + "analysis_level": "participant", + "participant_label": [ + "[[NIPOPPY_PARTICIPANT_ID]]" + ], + "session_id": "[[NIPOPPY_SESSION_ID]]", "modalities": [ "T1w", "T2w" ], - "no_sub": true, - "nprocs": "4" + "bids_database_dir": "[[NIPOPPY_DPATH_PIPELINE_BIDS_DB]]", + "nprocs": "4", + "work_dir": "[[NIPOPPY_DPATH_PIPELINE_WORK]]", + "no_sub": true } diff --git a/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-20.2.7.json b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-20.2.7.json new file mode 100644 index 00000000..8622106f --- /dev/null +++ b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-20.2.7.json @@ -0,0 +1,15 @@ +[ + { + "NAME": "pipeline_complete", + "PATHS": [ + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-preproc_T1w.json", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-preproc_T1w.nii.gz", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-brain_mask.json", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-brain_mask.nii.gz", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_dseg.nii.gz", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-CSF_probseg.nii.gz", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-GM_probseg.nii.gz", + "fmriprep/[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-WM_probseg.nii.gz" + ] + } +] diff --git a/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-23.1.3.json b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-23.1.3.json new file mode 100644 index 00000000..71ff4a20 --- /dev/null +++ b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/fmriprep-23.1.3.json @@ -0,0 +1,15 @@ +[ + { + "NAME": "pipeline_complete", + "PATHS": [ + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-preproc_T1w.json", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-preproc_T1w.nii.gz", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-brain_mask.json", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_desc-brain_mask.nii.gz", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_dseg.nii.gz", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-CSF_probseg.nii.gz", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-GM_probseg.nii.gz", + "[[NIPOPPY_BIDS_PARTICIPANT]]/[[NIPOPPY_BIDS_SESSION]]/anat/[[NIPOPPY_BIDS_PARTICIPANT]]_[[NIPOPPY_BIDS_SESSION]]*_label-WM_probseg.nii.gz" + ] + } +] diff --git a/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-6.0.1.json b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-6.0.1.json new file mode 100644 index 00000000..eda11b0c --- /dev/null +++ b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-6.0.1.json @@ -0,0 +1,27 @@ +[ + { + "NAME": "pipeline_complete", + "PATHS": [ + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/mri/aparc+aseg.mgz", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/mri/aparc.a2009s+aseg.mgz", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/lh.aparc.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/rh.aparc.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/lh.aparc.a2009s.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/rh.aparc.a2009s.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.curv", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.area", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.thickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.sulc", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.midthickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.curv", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.area", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.thickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.sulc", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.midthickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/lh.aparc.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/rh.aparc.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/lh.aparc.a2009s.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/rh.aparc.a2009s.stats" + ] + } +] diff --git a/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-7.3.2.json b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-7.3.2.json new file mode 100644 index 00000000..eda11b0c --- /dev/null +++ b/nipoppy_cli/nipoppy/data/examples/sample_tracker_configs/freesurfer-7.3.2.json @@ -0,0 +1,27 @@ +[ + { + "NAME": "pipeline_complete", + "PATHS": [ + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/mri/aparc+aseg.mgz", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/mri/aparc.a2009s+aseg.mgz", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/lh.aparc.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/rh.aparc.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/lh.aparc.a2009s.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/label/rh.aparc.a2009s.annot", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.curv", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.area", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.thickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.sulc", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/lh.midthickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.curv", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.area", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.thickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.sulc", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/surf/rh.midthickness", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/lh.aparc.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/rh.aparc.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/lh.aparc.a2009s.stats", + "[[NIPOPPY_BIDS_SESSION]]/[[NIPOPPY_BIDS_PARTICIPANT]]/stats/rh.aparc.a2009s.stats" + ] + } +] diff --git a/nipoppy_cli/tests/test_default_config.py b/nipoppy_cli/tests/test_default_config.py index a709172a..62c99308 100644 --- a/nipoppy_cli/tests/test_default_config.py +++ b/nipoppy_cli/tests/test_default_config.py @@ -1,5 +1,6 @@ """Test that all supported pipelines can run successfully in simulate mode.""" +import warnings from pathlib import Path import pytest @@ -11,10 +12,11 @@ from nipoppy.utils import ( DPATH_DESCRIPTORS, DPATH_INVOCATIONS, + DPATH_TRACKER_CONFIGS, FPATH_SAMPLE_CONFIG_FULL, TEMPLATE_REPLACE_PATTERN, ) -from nipoppy.workflows import BidsConversionRunner, PipelineRunner +from nipoppy.workflows import BidsConversionRunner, PipelineRunner, PipelineTracker from .conftest import create_empty_dataset, prepare_dataset @@ -28,6 +30,7 @@ def single_subject_dataset( session_id = "01" container_command = "apptainer" substitutions = { + "[[NIPOPPY_DPATH_TRACKER_CONFIGS]]": str(DPATH_TRACKER_CONFIGS), "[[NIPOPPY_DPATH_DESCRIPTORS]]": str(DPATH_DESCRIPTORS), "[[NIPOPPY_DPATH_INVOCATIONS]]": str(DPATH_INVOCATIONS), "[[NIPOPPY_DPATH_CONTAINERS]]": "[[NIPOPPY_DPATH_CONTAINERS]]", @@ -136,3 +139,28 @@ def test_bids_conversion_runner( assert TEMPLATE_REPLACE_PATTERN.search(invocation_str) is None assert TEMPLATE_REPLACE_PATTERN.search(descriptor_str) is None + + +@pytest.mark.parametrize( + "pipeline_name,pipeline_version", + [ + ("fmriprep", "20.2.7"), + ("fmriprep", "23.1.3"), + ("freesurfer", "6.0.1"), + ("freesurfer", "7.3.2"), + ("mriqc", "23.1.0"), + ], +) +def test_tracker(pipeline_name, pipeline_version, single_subject_dataset): + layout, participant_id, session_id = single_subject_dataset + layout: DatasetLayout + tracker = PipelineTracker( + dpath_root=layout.dpath_root, + pipeline_name=pipeline_name, + pipeline_version=pipeline_version, + ) + + # make sure all template strings are replaced + with warnings.catch_warnings(): + warnings.simplefilter("error") + tracker.run_single(participant_id=participant_id, session_id=session_id)