mrsiprep 2.2.1__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/PKG-INFO +1 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/cli/parser.py +294 -250
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/settings.py +23 -3
- mrsiprep-2.2.2/mrsiprep/interfaces/command_builder_app.py +1798 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/bids.py +72 -6
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/preproc_overview.py +8 -4
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/mrsi.py +218 -41
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/nipype_engine/build.py +16 -11
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/nipype_engine/nodes.py +97 -33
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/nipype_engine/run.py +3 -2
- mrsiprep-2.2.2/mrsiprep/workflows/nipype_engine/steps_registry.py +182 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/participant.py +24 -6
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/steps.py +79 -50
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/PKG-INFO +1 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/SOURCES.txt +2 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/pyproject.toml +1 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_bids_layout_units.py +80 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_cli.py +14 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_extension_points_units.py +2 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_workflow_orientation_units.py +27 -18
- mrsiprep-2.2.2/tests/test_mrsi_workflow_t1_correction_units.py +96 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsinmrs.py +49 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_nipype_engine.py +21 -7
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_nipype_engine_nodes.py +134 -50
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_nipype_engine_run.py +1 -1
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_participant_steps_units.py +100 -60
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_participant_workflow.py +21 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_settings_validation.py +17 -0
- mrsiprep-2.2.2/tests/test_steps_registry.py +129 -0
- mrsiprep-2.2.1/mrsiprep/interfaces/command_builder_app.py +0 -482
- mrsiprep-2.2.1/tests/test_mrsi_workflow_t1_correction_units.py +0 -91
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/LICENSE +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/README.md +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/cli/run.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/chimera_schemes.json +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/chimera_schemes.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/defaults.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/nuclei.json +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/nuclei.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/presets/imaging-neurosci-2026.json +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/presets/nature-comms-2025.json +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/t1_literature.json +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/t1_values.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/config/templates.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/connectivity/connectivity.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/connectivity/edges.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/connectivity/export.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/connectivity/nodes.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/README.md +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHIFIS_scale2/chimera-LFMIHIFIS_scale2.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHIFIS_scale2/chimera-LFMIHIFIS_scale2.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHIFIS_scale3/chimera-LFMIHIFIS_scale3.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHIFIS_scale3/chimera-LFMIHIFIS_scale3.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHISIFF_scale3/chimera-LFMIHISIFF_scale3.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-LFMIHISIFF_scale3/chimera-LFMIHISIFF_scale3.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-MFMIHIFIS_197/chimera-MFMIHIFIS_197.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-MFMIHIFIS_197/chimera-MFMIHIFIS_197.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-SFMIHIFIS_200/chimera-SFMIHIFIS_200.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/chimera-SFMIHIFIS_200/chimera-SFMIHIFIS_200.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/gm_mesh_12mm/gm_mesh_12mm.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/atlas/gm_mesh_12mm/gm_mesh_12mm.tsv +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/masks/README.md +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/data/masks/mni_gm_mask.nii.gz +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/ants.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/bids_import.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/bids_import_gui.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/chimera.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/freesurfer.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/interfaces/fsl.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/derivatives.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/loaders.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/mrsinmrs.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/naming.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/io/validators.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/filtering.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/masks.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/orientation.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/pvc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/quality.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/quantification_tools.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/reference.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/resampling.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/mrsi/t1_correction.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/atlas_registry.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/base.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/chimera_native.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/cubic.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/extraction.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/labels.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/metprofiles.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/mni_atlas.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/parcellation/synthseg.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/qc/__init__.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/qc/ventricles.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/registration/mrsi_to_t1.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/registration/subject_template.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/registration/t1_to_mni.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/registration/transforms.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/connectivity_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/html.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/leakage_qc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/mrsi_preproc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/mrsi_pvc_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/mrsi_raw_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/parcel_figures.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/parcel_qc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/parcellation_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/registration_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/runtime_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/slices.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/t1_correction.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/tissue.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/reports/ventricle_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/tissue/fractions.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/tissue/synthseg_fast.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/banner.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/debug.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/images.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/logging.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/misc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/provenance.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/runtime_metrics.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/subprocess_utils.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/tables.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/utils/version.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/anatomical.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/base.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/connectivity.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/nipype_engine/__init__.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/nipype_engine/adapters.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/parcellation.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/preflight.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/registration.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/reports.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep/workflows/tissue.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/dependency_links.txt +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/entry_points.txt +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/requires.txt +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/mrsiprep.egg-info/top_level.txt +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/setup.cfg +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_anatomical_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_ants_interface.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_atlas_registry_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_bids_inputs.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_chimera_interface.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_chimera_native_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_cli_run.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_connectivity.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_cubic_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_debug_timing.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_debug_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_derivative_names.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_filtering.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_filtering_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_freesurfer_interface.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_fsl_apply_transforms.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_fsl_fnirt.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_fsl_registration.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_html_report.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_html_report_helpers.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_html_report_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_leakage_qc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mni_atlas_preproc_overview_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_pvc_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_quality_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_raw_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_raw_overview_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_reference_masks_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_resampling_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_mrsi_to_t1_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_nipype_engine_run_status.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_nuclei_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_orientation_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_parcel_figures.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_parcel_figures_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_parcellation_extraction_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_parcellation_labels_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_participant_preflight.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_processing_modes.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_provenance_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_pvc.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_qc_reports.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_qc_ventricles.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_quantification_tools.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_registration_workflow_runtime_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_report_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_runtime_metrics.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_runtime_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_runtime_overview_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_slices_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_subject_template_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_subprocess_utils_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_synthmrsi_project_e2e.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_synthseg_fast.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_synthseg_fast_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_synthseg_parcellation_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_t1_correction.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_t1_correction_report.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_t1_to_mni_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_templates_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_tissue_fractions_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_validators_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_ventricle_overview.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_ventricle_overview_units.py +0 -0
- {mrsiprep-2.2.1 → mrsiprep-2.2.2}/tests/test_workflow_dispatch_units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mrsiprep
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: BIDS-like preprocessing pipeline for quantified whole-brain MRSI derivatives
|
|
5
5
|
Author-email: Federico Lucchetti <federico.lucchetti@unil.ch>
|
|
6
6
|
License: CHUV academic non-commercial research license
|
|
@@ -28,7 +28,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
28
28
|
help="Processing stage to be run, only 'participant' in the case of MRSIPrep (see BIDS-Apps specification).",
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
selection = parser.add_argument_group("
|
|
31
|
+
selection = parser.add_argument_group("Prepare: input selection")
|
|
32
32
|
selection.add_argument(
|
|
33
33
|
"--participant-label",
|
|
34
34
|
nargs="+",
|
|
@@ -58,13 +58,85 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
58
58
|
type=Path,
|
|
59
59
|
default=None,
|
|
60
60
|
help="Custom acquisition metadata JSON file. Defaults to "
|
|
61
|
-
"<bids_dir>/derivatives/mrsi-orig/mrsinmrs.json. A valid, nonempty
|
|
62
|
-
"is required; processing and --validate-only fail if it is missing. "
|
|
61
|
+
"<mrsi-input-dir or bids_dir>/derivatives/mrsi-orig/mrsinmrs.json. A valid, nonempty "
|
|
62
|
+
"metadata file is required; processing and --validate-only fail if it is missing. "
|
|
63
63
|
"With mrsiprep-docker, provide a host path; the wrapper mounts the file read-only.",
|
|
64
64
|
)
|
|
65
|
+
selection.add_argument(
|
|
66
|
+
"--mrsi-input-dir",
|
|
67
|
+
type=Path,
|
|
68
|
+
default=None,
|
|
69
|
+
help="Root folder containing the raw MRSI derivatives (derivatives/mrsi-<space>/sub-*/ses-*/...). "
|
|
70
|
+
"Defaults to --bids-dir, i.e. the MRSI data is expected under <bids_dir>/derivatives/... like the "
|
|
71
|
+
"anatomical (T1w) data. Set this only when the MRSI derivatives live in a separate tree from the "
|
|
72
|
+
"BIDS root used for anatomicals. With mrsiprep-docker, provide a host path; the wrapper mounts it.",
|
|
73
|
+
)
|
|
74
|
+
selection.add_argument(
|
|
75
|
+
"--t1",
|
|
76
|
+
dest="t1_pattern",
|
|
77
|
+
default="desc-brain_T1w",
|
|
78
|
+
help="BIDS entity/suffix pattern used to locate the skull-stripped T1w derivative for each "
|
|
79
|
+
"recording (e.g. 'desc-brain_T1w', or 'acq-mprage_T1w' to select among multiple raw T1w "
|
|
80
|
+
"acquisitions -- see --bids-filter-file for finer-grained disambiguation). Also determines what "
|
|
81
|
+
"the anatprep and registration steps operate on.",
|
|
82
|
+
)
|
|
83
|
+
selection.add_argument(
|
|
84
|
+
"--metabolites",
|
|
85
|
+
type=_parse_comma_list,
|
|
86
|
+
required=True,
|
|
87
|
+
help="Comma-separated metabolite names to process, e.g. 'CrPCr,GluGln,GPCPCh,NAANAAG,Ins'. Selects "
|
|
88
|
+
"which metabolite maps are loaded from the BIDS layout at all; every later step only ever sees "
|
|
89
|
+
"these metabolites.",
|
|
90
|
+
)
|
|
65
91
|
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+
processing = parser.add_argument_group("Workflow: step selection")
|
|
93
|
+
processing.add_argument(
|
|
94
|
+
"--steps",
|
|
95
|
+
type=_parse_comma_list,
|
|
96
|
+
default=None,
|
|
97
|
+
help="Comma-separated, ordered list of pipeline steps to run (default: the full pipeline, in its "
|
|
98
|
+
"normal order). An explicit list means exactly these steps, in this order -- omitting a step also "
|
|
99
|
+
"skips it, and any step that reads another step's output must list that step earlier; dependency "
|
|
100
|
+
"steps are never inserted automatically. Any order the steps' real data dependencies allow is "
|
|
101
|
+
"accepted; an order that is not is rejected before the run starts, naming the missing step. Steps, "
|
|
102
|
+
"in their normal order: prepare, tissue_seg, anatprep, mrsi_load, spike_filter, t1_saturation_correction, "
|
|
103
|
+
"mrsi_reference, mrsi_quality, registration, tissue_probmaps, tissue_qc, pvc, resampling, leakage_qc, "
|
|
104
|
+
"anat_parcellation_qc, mrsi_parcellation, regional, connectivity, metprofiles, reports.",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
tissue_seg = parser.add_argument_group("Anatomical branch: tissue segmentation")
|
|
108
|
+
tissue_seg.add_argument(
|
|
109
|
+
"--tissue-backend",
|
|
110
|
+
choices=["synthseg-fast", "existing", "none"],
|
|
111
|
+
default="synthseg-fast",
|
|
112
|
+
help="Tissue segmentation backend for PVC. 'none' disables tissue segmentation and PVC entirely. "
|
|
113
|
+
"Also selects which tissue-probability maps the tissue_probmaps step resamples onto the MRSI grid.",
|
|
114
|
+
)
|
|
115
|
+
tissue_seg.add_argument("--overwrite-seg", action="store_true", help="Force recompute of tissue segmentation (SynthSeg brain extraction + dseg/probseg), even if cached outputs exist.")
|
|
116
|
+
|
|
117
|
+
anatprep = parser.add_argument_group("Anatomical branch: anatomical preparation")
|
|
118
|
+
anatprep.add_argument(
|
|
119
|
+
"--registration-t1-target",
|
|
120
|
+
choices=["brain-csf", "brain", "raw"],
|
|
121
|
+
default=None,
|
|
122
|
+
help="Which T1w image registration targets. 'brain' registers directly to the skull-stripped T1w "
|
|
123
|
+
"(default when --parcellation-mode synthseg). 'brain-csf' re-adds the CSF compartment to the "
|
|
124
|
+
"skull-stripped image before registering, so CSF-adjacent MRSI signal isn't clipped at the "
|
|
125
|
+
"brain-only boundary (default when --parcellation-mode chimera or atlas; requires a CAT12 p3 CSF "
|
|
126
|
+
"map). 'raw' registers to the original, non-skull-stripped T1w with no fixed mask. The target "
|
|
127
|
+
"image this builds is consumed by the registration step.",
|
|
128
|
+
)
|
|
129
|
+
anatprep.add_argument(
|
|
130
|
+
"--csf-pv-threshold",
|
|
131
|
+
type=float,
|
|
132
|
+
default=0.95,
|
|
133
|
+
help="CSF partial-volume probability threshold used when building the 'brain-csf' registration "
|
|
134
|
+
"target: voxels with CAT12 p3 CSF probability at or above this value are added back to the "
|
|
135
|
+
"skull-stripped brain image.",
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
mrsi_load = parser.add_argument_group("MRSI branch: loading")
|
|
139
|
+
mrsi_load.add_argument(
|
|
68
140
|
"--correct-mrsi-orientation",
|
|
69
141
|
dest="correct_mrsi_orientation",
|
|
70
142
|
action="store_true",
|
|
@@ -76,6 +148,166 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
76
148
|
"other metabolite/CRLB/SNR/FWHM map and the brainmask, in place, at native MRSI resolution. Uses "
|
|
77
149
|
"--registration-backend (ANTs Rigid, or FLIRT dof=6 for fsl).",
|
|
78
150
|
)
|
|
151
|
+
mrsi_load.add_argument(
|
|
152
|
+
"--ref-met",
|
|
153
|
+
required=True,
|
|
154
|
+
help="Reference metabolite map used to build the MRSI registration target, e.g. 'CrPCr'. Also "
|
|
155
|
+
"used by the mrsi_reference step.",
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
spike_filter = parser.add_argument_group("MRSI branch: spike filtering")
|
|
159
|
+
spike_filter.add_argument("--no-filter", action="store_true", help="Disable biharmonic spike filtering (enabled by default).")
|
|
160
|
+
spike_filter.add_argument(
|
|
161
|
+
"--filter-fwhm-mm",
|
|
162
|
+
type=float,
|
|
163
|
+
default=None,
|
|
164
|
+
help="Smoothing FWHM (mm) used when splicing repaired biharmonic-filter voxels back in. "
|
|
165
|
+
"Default: derived from the native MRSI voxel size (mean voxel dimension x sqrt(2)).",
|
|
166
|
+
)
|
|
167
|
+
spike_filter.add_argument(
|
|
168
|
+
"--spikepc",
|
|
169
|
+
type=float,
|
|
170
|
+
default=99.0,
|
|
171
|
+
help="Percentile threshold (0-100) above which a voxel is flagged as a spike for biharmonic "
|
|
172
|
+
"filtering/repair. Ignored when --no-filter is set.",
|
|
173
|
+
)
|
|
174
|
+
spike_filter.add_argument(
|
|
175
|
+
"--spike-max-cluster-voxels",
|
|
176
|
+
type=int,
|
|
177
|
+
default=None,
|
|
178
|
+
help="A connected cluster of spike-thresholded voxels larger than this is treated as real focal "
|
|
179
|
+
"signal (e.g. a genuine metabolic abnormality) and left unfiltered, rather than median-repaired/"
|
|
180
|
+
"biharmonic-inpainted like an isolated noise spike. Default: derived from the native MRSI voxel "
|
|
181
|
+
"size (6 voxels at ~5.0mm/3T-like resolution, 9 voxels at ~3.4mm/7T-like resolution, empirically "
|
|
182
|
+
"the 90th-percentile spike-cluster size measured on real acquisitions at each resolution). Set to "
|
|
183
|
+
"a very large number to disable cluster-size filtering (every above-threshold voxel is filtered "
|
|
184
|
+
"regardless of cluster size, matching pre-existing behavior).",
|
|
185
|
+
)
|
|
186
|
+
spike_filter.add_argument(
|
|
187
|
+
"--spike-extreme-zscore",
|
|
188
|
+
type=float,
|
|
189
|
+
default=4.0,
|
|
190
|
+
help="Safety net on top of --spike-max-cluster-voxels: a cluster larger than the size cap is still "
|
|
191
|
+
"repaired (rather than exempted as real focal signal) if its mean intensity is an implausible "
|
|
192
|
+
"outlier -- a z-score (against the map's own inside-brain mean/std) above this value. On real data, "
|
|
193
|
+
"large spike clusters are just as likely as small ones to be extreme intensity outliers (acquisition "
|
|
194
|
+
"artifacts, typically near the FOV/slab edge), which the size cap alone would otherwise leave "
|
|
195
|
+
"unfiltered and visibly distort the report's display scale. Default 4.0. Set to a very large number "
|
|
196
|
+
"or a negative value has no safety effect (nothing exceeds it); pass a value close to 0 to make the "
|
|
197
|
+
"safety net dominate the size cap entirely.",
|
|
198
|
+
)
|
|
199
|
+
spike_filter.add_argument(
|
|
200
|
+
"--overwrite-filt",
|
|
201
|
+
action="store_true",
|
|
202
|
+
help="Force recompute of biharmonic spike filtering, even if cached filtered maps exist.",
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
t1_correction = parser.add_argument_group("MRSI branch: T1 saturation correction")
|
|
206
|
+
t1_correction.add_argument(
|
|
207
|
+
"--t1-correction",
|
|
208
|
+
choices=["none", "literature", "voxelwise"],
|
|
209
|
+
default="none",
|
|
210
|
+
help="Correct metabolite maps for incomplete T1 relaxation recovery (T1 saturation) using the "
|
|
211
|
+
"steady-state spoiled-gradient-echo signal equation (default: 'none', no correction applied). "
|
|
212
|
+
"'literature' applies a single scalar correction factor per metabolite, derived from the "
|
|
213
|
+
"acquisition's nominal TR/flip angle (read from mrsinmrs.json) and a curated literature T1 value "
|
|
214
|
+
"per metabolite per field strength (see mrsiprep/config/t1_literature.json). 'voxelwise' applies "
|
|
215
|
+
"a per-voxel correction factor per metabolite instead, using a measured flip-angle (B1+) map "
|
|
216
|
+
"(desc-b1map in the MRSI input layout, same grid as the metabolite maps) in place of the nominal "
|
|
217
|
+
"flip angle -- TR and the literature T1 value are still scalar; requires that map to be present, "
|
|
218
|
+
"there is no fallback to 'literature' mode. Both modes require acquisition metadata "
|
|
219
|
+
"(the default mrsinmrs.json or --mrsinmrs-file) with "
|
|
220
|
+
"unambiguous TR/FlipAngle/MagneticFieldStrength entries -- fails loudly, per-recording, if these "
|
|
221
|
+
"or a requested metabolite's T1 value are missing, rather than silently skipping or substituting.",
|
|
222
|
+
)
|
|
223
|
+
t1_correction.add_argument(
|
|
224
|
+
"--t1-correction-water-status",
|
|
225
|
+
choices=["uncorrected", "corrected", "unknown"],
|
|
226
|
+
default="unknown",
|
|
227
|
+
help="Whether the input metabolite maps are already water-referenced/water-T1-corrected upstream "
|
|
228
|
+
"(e.g. by the quantification pipeline's own internal water-scaling step). 'unknown' (default, "
|
|
229
|
+
"conservative) applies the metabolite-T1-only correction and flags the ambiguity in the QC/"
|
|
230
|
+
"provenance output. Ignored when --t1-correction none.",
|
|
231
|
+
)
|
|
232
|
+
t1_correction.add_argument(
|
|
233
|
+
"--overwrite-t1corr",
|
|
234
|
+
action="store_true",
|
|
235
|
+
help="Force recomputation of T1-corrected maps even if cached outputs exist.",
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
mrsi_quality = parser.add_argument_group("MRSI branch: quality masking")
|
|
239
|
+
mrsi_quality.add_argument(
|
|
240
|
+
"--quantification-tool",
|
|
241
|
+
choices=list(SUPPORTED_QUANTIFICATION_TOOLS),
|
|
242
|
+
default=None,
|
|
243
|
+
help="Upstream spectral-fitting tool that produced the CRLB/SNR/linewidth maps. Required: pass this "
|
|
244
|
+
"explicitly, or add \"QuantificationTool\" to CommonMetadata in mrsinmrs.json. MRSIPrep's quality "
|
|
245
|
+
"thresholds assume LCModel's convention (CRLB as %%, SNR via peak height over residual noise SD, "
|
|
246
|
+
"linewidth in Hz); 'lcmodel', 'fsl-mrs', and 'osprey' (LCModel-wrapper mode only) are verified to "
|
|
247
|
+
"already match it, so no rescaling is applied. Use 'custom' for any other tool (including TARQUIN, "
|
|
248
|
+
"jMRUI, or Osprey's native fitting engine, whose conventions were not verified as equivalent) -- "
|
|
249
|
+
"MRSIPrep performs no rescaling for 'custom', and you are solely responsible for ensuring your maps "
|
|
250
|
+
"already match the expected convention before running MRSIPrep.",
|
|
251
|
+
)
|
|
252
|
+
mrsi_quality.add_argument(
|
|
253
|
+
"--linewidth-unit",
|
|
254
|
+
choices=list(SUPPORTED_LINEWIDTH_UNITS),
|
|
255
|
+
default=None,
|
|
256
|
+
help="Unit the upstream tool's linewidth/FWHM map is stored in. Required: pass this explicitly, or "
|
|
257
|
+
"add \"LinewidthUnit\" to CommonMetadata in mrsinmrs.json. --linewidth-max is defined in Hz; 'ppm' "
|
|
258
|
+
"values are converted to Hz using CommonMetadata's MagneticFieldStrength before thresholding.",
|
|
259
|
+
)
|
|
260
|
+
mrsi_quality.add_argument(
|
|
261
|
+
"--crlb-unit",
|
|
262
|
+
choices=list(SUPPORTED_CRLB_UNITS),
|
|
263
|
+
default=None,
|
|
264
|
+
help="Unit the upstream tool's CRLB map is stored in. Required: pass this explicitly, or add "
|
|
265
|
+
"\"CRLBUnit\" to CommonMetadata in mrsinmrs.json. --crlb-max is defined as a percentage.",
|
|
266
|
+
)
|
|
267
|
+
mrsi_quality.add_argument(
|
|
268
|
+
"--nucleus",
|
|
269
|
+
default=None,
|
|
270
|
+
help="Acquired nucleus, e.g. "
|
|
271
|
+
+ "/".join(available_nuclei())
|
|
272
|
+
+ " (aliases such as 'proton' or 'phosphorus' are accepted). Selects the curated voxel-quality "
|
|
273
|
+
"defaults and metabolite alias spellings for that nucleus. Falls back to the 'Nucleus' field of "
|
|
274
|
+
"the selected acquisition metadata file, then to 1H. Nuclei other than 1H ship no curated quality "
|
|
275
|
+
"thresholds, so pass --snr-min/--linewidth-max/--crlb-max explicitly for them; see "
|
|
276
|
+
"mrsiprep/config/nuclei.json to contribute values.",
|
|
277
|
+
)
|
|
278
|
+
mrsi_quality.add_argument(
|
|
279
|
+
"--quality-metrics",
|
|
280
|
+
nargs="+",
|
|
281
|
+
default=["snr", "linewidth", "crlb"],
|
|
282
|
+
choices=["snr", "linewidth", "crlb"],
|
|
283
|
+
help="Which per-voxel quality maps are required inputs (any of 'snr', 'linewidth', 'crlb'); a "
|
|
284
|
+
"recording missing one of the listed maps fails preflight validation. Default: all three. Maps "
|
|
285
|
+
"that are present are always applied as voxel-inclusion thresholds regardless of this flag (see "
|
|
286
|
+
"--snr-min/--linewidth-max/--crlb-max); this flag only controls whether their absence is an error.",
|
|
287
|
+
)
|
|
288
|
+
mrsi_quality.add_argument(
|
|
289
|
+
"--snr-min",
|
|
290
|
+
type=float,
|
|
291
|
+
default=None,
|
|
292
|
+
help=f"Minimum per-voxel SNR to include a voxel, when 'snr' is in --quality-metrics. "
|
|
293
|
+
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['snr_min']} for 1H).",
|
|
294
|
+
)
|
|
295
|
+
mrsi_quality.add_argument(
|
|
296
|
+
"--linewidth-max",
|
|
297
|
+
type=float,
|
|
298
|
+
default=None,
|
|
299
|
+
help=f"Maximum per-voxel linewidth (FWHM) to include a voxel, when 'linewidth' is in --quality-metrics. "
|
|
300
|
+
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['linewidth_max']} for 1H).",
|
|
301
|
+
)
|
|
302
|
+
mrsi_quality.add_argument(
|
|
303
|
+
"--crlb-max",
|
|
304
|
+
type=float,
|
|
305
|
+
default=None,
|
|
306
|
+
help=f"Maximum per-voxel Cramér-Rao lower bound (%%) to include a voxel, when 'crlb' is in --quality-metrics. "
|
|
307
|
+
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['crlb_max']} for 1H).",
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
registration = parser.add_argument_group("Shared: registration")
|
|
79
311
|
registration.add_argument(
|
|
80
312
|
"--registration-backend",
|
|
81
313
|
choices=["ants", "fsl", "flirt-fnirt", "flirt_fnirt", "flirt/fnirt"],
|
|
@@ -86,7 +318,8 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
86
318
|
"'fsl' uses FLIRT, with an FNIRT deformable stage added by default for MRSI-to-T1w (FNIRT is FSL's "
|
|
87
319
|
"own deformable-registration tool, not a separate backend here -- see --fsl-deformable/"
|
|
88
320
|
"--no-fsl-deformable to control it). See the registration benchmark for the evaluated "
|
|
89
|
-
"configurations and metrics."
|
|
321
|
+
"configurations and metrics. Also used by the mrsi_load step's optional orientation-correction "
|
|
322
|
+
"sub-step.",
|
|
90
323
|
)
|
|
91
324
|
registration.add_argument(
|
|
92
325
|
"--ants-mrsi-to-t1-transform",
|
|
@@ -130,7 +363,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
130
363
|
default="corratio",
|
|
131
364
|
help="FLIRT cost function for FSL registrations. Default changed from FLIRT's own 'mutualinfo' default to "
|
|
132
365
|
"'corratio': mutualinfo was found to diverge on the small, low-contrast MRSI reference maps used for "
|
|
133
|
-
"MRSI-to-T1w registration.",
|
|
366
|
+
"MRSI-to-T1w registration. Also used by the mrsi_load step's optional orientation-correction sub-step.",
|
|
134
367
|
)
|
|
135
368
|
registration.add_argument(
|
|
136
369
|
"--fsl-deformable",
|
|
@@ -177,6 +410,39 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
177
410
|
"reuses a previously computed T1w-to-MNI transform and fails if none is found.",
|
|
178
411
|
)
|
|
179
412
|
registration.add_argument(
|
|
413
|
+
"--longitudinal",
|
|
414
|
+
action="store_true",
|
|
415
|
+
help="Build one unbiased ANTs template across a subject's sessions and register it to MNI once, "
|
|
416
|
+
"composing (session-to-template)+(template-to-MNI) instead of registering each session directly to MNI. "
|
|
417
|
+
"No-op for subjects with a single session. Requires --registration-backend ants.",
|
|
418
|
+
)
|
|
419
|
+
registration.add_argument(
|
|
420
|
+
"--overwrite-t1-reg",
|
|
421
|
+
action="store_true",
|
|
422
|
+
help="Force recompute of MRSI-to-T1w registration, even if a cached transform exists. Also forces "
|
|
423
|
+
"recompute of the anatprep step's brain-CSF registration target, when used.",
|
|
424
|
+
)
|
|
425
|
+
registration.add_argument(
|
|
426
|
+
"--overwrite-template-reg",
|
|
427
|
+
action="store_true",
|
|
428
|
+
help="Force recompute of T1w-to-MNI registration, even if a cached transform exists.",
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
tissue_probmaps = parser.add_argument_group("Shared: tissue probability maps and PVC")
|
|
432
|
+
tissue_probmaps.add_argument(
|
|
433
|
+
"--no-pvc",
|
|
434
|
+
action="store_true",
|
|
435
|
+
help="Skip partial-volume correction (PETPVC) entirely. Equivalent to --tissue-backend none, "
|
|
436
|
+
"except tissue segmentation itself still runs (its maps are just not used for PVC).",
|
|
437
|
+
)
|
|
438
|
+
tissue_probmaps.add_argument(
|
|
439
|
+
"--overwrite-pve",
|
|
440
|
+
action="store_true",
|
|
441
|
+
help="Force recompute of partial-volume correction (PETPVC), even if cached corrected maps exist.",
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
resampling = parser.add_argument_group("Outputs: resampling")
|
|
445
|
+
resampling.add_argument(
|
|
180
446
|
"--output-spaces",
|
|
181
447
|
nargs="+",
|
|
182
448
|
default=["MNI152NLin2009cAsym"],
|
|
@@ -187,52 +453,23 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
187
453
|
"modifier takes an integer millimetre value ('res-2'), 'res-origres' (MRSI native -- the default, "
|
|
188
454
|
"since it avoids implying spatial precision the acquisition never had) or 'res-t1wres' (T1w "
|
|
189
455
|
"native). Qualifying each space individually replaces the old global --mni-resolution flag, which "
|
|
190
|
-
"could not express different resolutions for different spaces. See docs/usage_normalization.md."
|
|
456
|
+
"could not express different resolutions for different spaces. See docs/usage_normalization.md. "
|
|
457
|
+
"Also read by the registration step, to decide whether the T1w-to-MNI stage needs to run at all.",
|
|
191
458
|
)
|
|
192
|
-
|
|
459
|
+
resampling.add_argument(
|
|
193
460
|
"--output-mrsi-t1w",
|
|
194
461
|
action="store_true",
|
|
195
462
|
help="Also resample all metabolite (and CRLB/SNR/FWHM/spikemask) maps into T1w space as permanent "
|
|
196
463
|
"derivatives (mrsi-t1w/). Off by default; the registration-overview report generates its own single "
|
|
197
464
|
"reference-metabolite T1w map in the work directory regardless of this flag.",
|
|
198
465
|
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
default=None,
|
|
203
|
-
help="Which T1w image registration targets. 'brain' registers directly to the skull-stripped T1w "
|
|
204
|
-
"(default when --parcellation-mode synthseg). 'brain-csf' re-adds the CSF compartment to the "
|
|
205
|
-
"skull-stripped image before registering, so CSF-adjacent MRSI signal isn't clipped at the "
|
|
206
|
-
"brain-only boundary (default when --parcellation-mode chimera or atlas; requires a CAT12 p3 CSF "
|
|
207
|
-
"map). 'raw' registers to the original, non-skull-stripped T1w with no fixed mask.",
|
|
208
|
-
)
|
|
209
|
-
registration.add_argument(
|
|
210
|
-
"--csf-pv-threshold",
|
|
211
|
-
type=float,
|
|
212
|
-
default=0.95,
|
|
213
|
-
help="CSF partial-volume probability threshold used when building the 'brain-csf' registration "
|
|
214
|
-
"target: voxels with CAT12 p3 CSF probability at or above this value are added back to the "
|
|
215
|
-
"skull-stripped brain image.",
|
|
216
|
-
)
|
|
217
|
-
registration.add_argument(
|
|
218
|
-
"--ref-met",
|
|
219
|
-
required=True,
|
|
220
|
-
help="Reference metabolite map used to build the MRSI registration target, e.g. 'CrPCr'.",
|
|
221
|
-
)
|
|
222
|
-
registration.add_argument(
|
|
223
|
-
"--t1",
|
|
224
|
-
dest="t1_pattern",
|
|
225
|
-
default="desc-brain_T1w",
|
|
226
|
-
help="BIDS entity/suffix pattern used to locate the skull-stripped T1w derivative for each "
|
|
227
|
-
"recording (e.g. 'desc-brain_T1w', or 'acq-mprage_T1w' to select among multiple raw T1w "
|
|
228
|
-
"acquisitions -- see --bids-filter-file for finer-grained disambiguation).",
|
|
229
|
-
)
|
|
230
|
-
registration.add_argument(
|
|
231
|
-
"--longitudinal",
|
|
466
|
+
resampling.add_argument("--transform-spikemask", action="store_true", help="Also transform per-metabolite spike masks into T1w/MNI space.")
|
|
467
|
+
resampling.add_argument(
|
|
468
|
+
"--overwrite-transform",
|
|
232
469
|
action="store_true",
|
|
233
|
-
help="
|
|
234
|
-
"
|
|
235
|
-
"
|
|
470
|
+
help="Force recompute of resampling MRSI maps through existing transforms into output spaces, even "
|
|
471
|
+
"if cached resampled maps exist. Does not itself force-recompute the transforms -- see "
|
|
472
|
+
"--overwrite-t1-reg/--overwrite-template-reg.",
|
|
236
473
|
)
|
|
237
474
|
|
|
238
475
|
parcellation = parser.add_argument_group("parcellation")
|
|
@@ -346,8 +583,17 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
346
583
|
help="FreeSurfer SUBJECTS_DIR to reuse pre-existing recon-all output from, instead of running "
|
|
347
584
|
"recon-all inside MRSIPrep. Only relevant with --parcellation-mode chimera.",
|
|
348
585
|
)
|
|
586
|
+
parcellation.add_argument("--overwrite-chimera", action="store_true", help="Force re-run Chimera parcellation even if the output dseg file already exists.")
|
|
349
587
|
|
|
350
|
-
connectivity = parser.add_argument_group("connectivity")
|
|
588
|
+
connectivity = parser.add_argument_group("Outputs: regional profiles and connectivity")
|
|
589
|
+
connectivity.add_argument(
|
|
590
|
+
"--regional-summary",
|
|
591
|
+
choices=["mean", "median", "weighted_mean"],
|
|
592
|
+
default="mean",
|
|
593
|
+
help="How each parcel's per-voxel metabolite values are summarized into a single regional value: "
|
|
594
|
+
"'mean', 'median', or 'weighted_mean' (SNR-weighted average; falls back to an unweighted mean if no "
|
|
595
|
+
"SNR map is available for that recording).",
|
|
596
|
+
)
|
|
351
597
|
connectivity.add_argument(
|
|
352
598
|
"--write-connectivity",
|
|
353
599
|
action="store_true",
|
|
@@ -383,184 +629,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
383
629
|
default=None,
|
|
384
630
|
help="Exclude parcels whose label/ID is greater than or equal to this value from the connectivity matrix.",
|
|
385
631
|
)
|
|
386
|
-
connectivity.add_argument(
|
|
387
|
-
"--regional-summary",
|
|
388
|
-
choices=["mean", "median", "weighted_mean"],
|
|
389
|
-
default="mean",
|
|
390
|
-
help="How each parcel's per-voxel metabolite values are summarized into a single regional value: "
|
|
391
|
-
"'mean', 'median', or 'weighted_mean' (SNR-weighted average; falls back to an unweighted mean if no "
|
|
392
|
-
"SNR map is available for that recording).",
|
|
393
|
-
)
|
|
394
|
-
|
|
395
|
-
quality = parser.add_argument_group("quality thresholds")
|
|
396
|
-
quality.add_argument(
|
|
397
|
-
"--quantification-tool",
|
|
398
|
-
choices=list(SUPPORTED_QUANTIFICATION_TOOLS),
|
|
399
|
-
default=None,
|
|
400
|
-
help="Upstream spectral-fitting tool that produced the CRLB/SNR/linewidth maps. Required: pass this "
|
|
401
|
-
"explicitly, or add \"QuantificationTool\" to CommonMetadata in mrsinmrs.json. MRSIPrep's quality "
|
|
402
|
-
"thresholds assume LCModel's convention (CRLB as %%, SNR via peak height over residual noise SD, "
|
|
403
|
-
"linewidth in Hz); 'lcmodel', 'fsl-mrs', and 'osprey' (LCModel-wrapper mode only) are verified to "
|
|
404
|
-
"already match it, so no rescaling is applied. Use 'custom' for any other tool (including TARQUIN, "
|
|
405
|
-
"jMRUI, or Osprey's native fitting engine, whose conventions were not verified as equivalent) -- "
|
|
406
|
-
"MRSIPrep performs no rescaling for 'custom', and you are solely responsible for ensuring your maps "
|
|
407
|
-
"already match the expected convention before running MRSIPrep.",
|
|
408
|
-
)
|
|
409
|
-
quality.add_argument(
|
|
410
|
-
"--linewidth-unit",
|
|
411
|
-
choices=list(SUPPORTED_LINEWIDTH_UNITS),
|
|
412
|
-
default=None,
|
|
413
|
-
help="Unit the upstream tool's linewidth/FWHM map is stored in. Required: pass this explicitly, or "
|
|
414
|
-
"add \"LinewidthUnit\" to CommonMetadata in mrsinmrs.json. --linewidth-max is defined in Hz; 'ppm' "
|
|
415
|
-
"values are converted to Hz using CommonMetadata's MagneticFieldStrength before thresholding.",
|
|
416
|
-
)
|
|
417
|
-
quality.add_argument(
|
|
418
|
-
"--crlb-unit",
|
|
419
|
-
choices=list(SUPPORTED_CRLB_UNITS),
|
|
420
|
-
default=None,
|
|
421
|
-
help="Unit the upstream tool's CRLB map is stored in. Required: pass this explicitly, or add "
|
|
422
|
-
"\"CRLBUnit\" to CommonMetadata in mrsinmrs.json. --crlb-max is defined as a percentage.",
|
|
423
|
-
)
|
|
424
|
-
quality.add_argument(
|
|
425
|
-
"--metabolites",
|
|
426
|
-
type=_parse_comma_list,
|
|
427
|
-
required=True,
|
|
428
|
-
help="Comma-separated metabolite names to process, e.g. 'CrPCr,GluGln,GPCPCh,NAANAAG,Ins'.",
|
|
429
|
-
)
|
|
430
|
-
quality.add_argument(
|
|
431
|
-
"--nucleus",
|
|
432
|
-
default=None,
|
|
433
|
-
help="Acquired nucleus, e.g. "
|
|
434
|
-
+ "/".join(available_nuclei())
|
|
435
|
-
+ " (aliases such as 'proton' or 'phosphorus' are accepted). Selects the curated voxel-quality "
|
|
436
|
-
"defaults and metabolite alias spellings for that nucleus. Falls back to the 'Nucleus' field of "
|
|
437
|
-
"the selected acquisition metadata file, then to 1H. Nuclei other than 1H ship no curated quality "
|
|
438
|
-
"thresholds, so pass --snr-min/--linewidth-max/--crlb-max explicitly for them; see "
|
|
439
|
-
"mrsiprep/config/nuclei.json to contribute values.",
|
|
440
|
-
)
|
|
441
|
-
quality.add_argument(
|
|
442
|
-
"--quality-metrics",
|
|
443
|
-
nargs="+",
|
|
444
|
-
default=["snr", "linewidth", "crlb"],
|
|
445
|
-
choices=["snr", "linewidth", "crlb"],
|
|
446
|
-
help="Which per-voxel quality maps are required inputs (any of 'snr', 'linewidth', 'crlb'); a "
|
|
447
|
-
"recording missing one of the listed maps fails preflight validation. Default: all three. Maps "
|
|
448
|
-
"that are present are always applied as voxel-inclusion thresholds regardless of this flag (see "
|
|
449
|
-
"--snr-min/--linewidth-max/--crlb-max); this flag only controls whether their absence is an error.",
|
|
450
|
-
)
|
|
451
|
-
quality.add_argument(
|
|
452
|
-
"--snr-min",
|
|
453
|
-
type=float,
|
|
454
|
-
default=None,
|
|
455
|
-
help=f"Minimum per-voxel SNR to include a voxel, when 'snr' is in --quality-metrics. "
|
|
456
|
-
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['snr_min']} for 1H).",
|
|
457
|
-
)
|
|
458
|
-
quality.add_argument(
|
|
459
|
-
"--linewidth-max",
|
|
460
|
-
type=float,
|
|
461
|
-
default=None,
|
|
462
|
-
help=f"Maximum per-voxel linewidth (FWHM) to include a voxel, when 'linewidth' is in --quality-metrics. "
|
|
463
|
-
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['linewidth_max']} for 1H).",
|
|
464
|
-
)
|
|
465
|
-
quality.add_argument(
|
|
466
|
-
"--crlb-max",
|
|
467
|
-
type=float,
|
|
468
|
-
default=None,
|
|
469
|
-
help=f"Maximum per-voxel Cramér-Rao lower bound (%%) to include a voxel, when 'crlb' is in --quality-metrics. "
|
|
470
|
-
f"Defaults to the acquired nucleus's curated value (--nucleus; {QUALITY_DEFAULTS['crlb_max']} for 1H).",
|
|
471
|
-
)
|
|
472
|
-
|
|
473
|
-
t1_correction = parser.add_argument_group("T1 saturation correction")
|
|
474
|
-
t1_correction.add_argument(
|
|
475
|
-
"--t1-correction",
|
|
476
|
-
choices=["none", "literature", "voxelwise"],
|
|
477
|
-
default="none",
|
|
478
|
-
help="Correct metabolite maps for incomplete T1 relaxation recovery (T1 saturation) using the "
|
|
479
|
-
"steady-state spoiled-gradient-echo signal equation (default: 'none', no correction applied). "
|
|
480
|
-
"'literature' applies a single scalar correction factor per metabolite, derived from the "
|
|
481
|
-
"acquisition's nominal TR/flip angle (read from mrsinmrs.json) and a curated literature T1 value "
|
|
482
|
-
"per metabolite per field strength (see mrsiprep/config/t1_literature.json). 'voxelwise' applies "
|
|
483
|
-
"a per-voxel correction factor per metabolite instead, using a measured flip-angle (B1+) map "
|
|
484
|
-
"(desc-b1map in the MRSI input layout, same grid as the metabolite maps) in place of the nominal "
|
|
485
|
-
"flip angle -- TR and the literature T1 value are still scalar; requires that map to be present, "
|
|
486
|
-
"there is no fallback to 'literature' mode. Both modes require acquisition metadata "
|
|
487
|
-
"(the default mrsinmrs.json or --mrsinmrs-file) with "
|
|
488
|
-
"unambiguous TR/FlipAngle/MagneticFieldStrength entries -- fails loudly, per-recording, if these "
|
|
489
|
-
"or a requested metabolite's T1 value are missing, rather than silently skipping or substituting.",
|
|
490
|
-
)
|
|
491
|
-
t1_correction.add_argument(
|
|
492
|
-
"--t1-correction-water-status",
|
|
493
|
-
choices=["uncorrected", "corrected", "unknown"],
|
|
494
|
-
default="unknown",
|
|
495
|
-
help="Whether the input metabolite maps are already water-referenced/water-T1-corrected upstream "
|
|
496
|
-
"(e.g. by the quantification pipeline's own internal water-scaling step). 'unknown' (default, "
|
|
497
|
-
"conservative) applies the metabolite-T1-only correction and flags the ambiguity in the QC/"
|
|
498
|
-
"provenance output. Ignored when --t1-correction none.",
|
|
499
|
-
)
|
|
500
|
-
t1_correction.add_argument(
|
|
501
|
-
"--overwrite-t1corr",
|
|
502
|
-
action="store_true",
|
|
503
|
-
help="Force recomputation of T1-corrected maps even if cached outputs exist.",
|
|
504
|
-
)
|
|
505
|
-
|
|
506
|
-
processing = parser.add_argument_group("Options for performing only a subset of the workflow")
|
|
507
|
-
processing.add_argument(
|
|
508
|
-
"--tissue-backend",
|
|
509
|
-
choices=["synthseg-fast", "existing", "none"],
|
|
510
|
-
default="synthseg-fast",
|
|
511
|
-
help="Tissue segmentation backend for PVC. 'none' disables tissue segmentation and PVC entirely.",
|
|
512
|
-
)
|
|
513
|
-
|
|
514
632
|
|
|
515
633
|
processing_control = parser.add_argument_group("Workflow configuration")
|
|
516
634
|
processing_control.add_argument("--transform", default="", help="Legacy output transform override; prefer --output-spaces.")
|
|
517
|
-
processing_control.add_argument("--no-filter", action="store_true", help="Disable biharmonic spike filtering (enabled by default).")
|
|
518
|
-
processing_control.add_argument(
|
|
519
|
-
"--filter-fwhm-mm",
|
|
520
|
-
type=float,
|
|
521
|
-
default=None,
|
|
522
|
-
help="Smoothing FWHM (mm) used when splicing repaired biharmonic-filter voxels back in. "
|
|
523
|
-
"Default: derived from the native MRSI voxel size (mean voxel dimension x sqrt(2)).",
|
|
524
|
-
)
|
|
525
|
-
processing_control.add_argument(
|
|
526
|
-
"--spikepc",
|
|
527
|
-
type=float,
|
|
528
|
-
default=99.0,
|
|
529
|
-
help="Percentile threshold (0-100) above which a voxel is flagged as a spike for biharmonic "
|
|
530
|
-
"filtering/repair. Ignored when --no-filter is set.",
|
|
531
|
-
)
|
|
532
|
-
processing_control.add_argument(
|
|
533
|
-
"--spike-max-cluster-voxels",
|
|
534
|
-
type=int,
|
|
535
|
-
default=None,
|
|
536
|
-
help="A connected cluster of spike-thresholded voxels larger than this is treated as real focal "
|
|
537
|
-
"signal (e.g. a genuine metabolic abnormality) and left unfiltered, rather than median-repaired/"
|
|
538
|
-
"biharmonic-inpainted like an isolated noise spike. Default: derived from the native MRSI voxel "
|
|
539
|
-
"size (6 voxels at ~5.0mm/3T-like resolution, 9 voxels at ~3.4mm/7T-like resolution, empirically "
|
|
540
|
-
"the 90th-percentile spike-cluster size measured on real acquisitions at each resolution). Set to "
|
|
541
|
-
"a very large number to disable cluster-size filtering (every above-threshold voxel is filtered "
|
|
542
|
-
"regardless of cluster size, matching pre-existing behavior).",
|
|
543
|
-
)
|
|
544
|
-
processing_control.add_argument(
|
|
545
|
-
"--spike-extreme-zscore",
|
|
546
|
-
type=float,
|
|
547
|
-
default=4.0,
|
|
548
|
-
help="Safety net on top of --spike-max-cluster-voxels: a cluster larger than the size cap is still "
|
|
549
|
-
"repaired (rather than exempted as real focal signal) if its mean intensity is an implausible "
|
|
550
|
-
"outlier -- a z-score (against the map's own inside-brain mean/std) above this value. On real data, "
|
|
551
|
-
"large spike clusters are just as likely as small ones to be extreme intensity outliers (acquisition "
|
|
552
|
-
"artifacts, typically near the FOV/slab edge), which the size cap alone would otherwise leave "
|
|
553
|
-
"unfiltered and visibly distort the report's display scale. Default 4.0. Set to a very large number "
|
|
554
|
-
"or a negative value has no safety effect (nothing exceeds it); pass a value close to 0 to make the "
|
|
555
|
-
"safety net dominate the size cap entirely.",
|
|
556
|
-
)
|
|
557
|
-
processing_control.add_argument(
|
|
558
|
-
"--no-pvc",
|
|
559
|
-
action="store_true",
|
|
560
|
-
help="Skip partial-volume correction (PETPVC) entirely. Equivalent to --tissue-backend none, "
|
|
561
|
-
"except tissue segmentation itself still runs (its maps are just not used for PVC).",
|
|
562
|
-
)
|
|
563
|
-
processing_control.add_argument("--transform-spikemask", action="store_true", help="Also transform per-metabolite spike masks into T1w/MNI space.")
|
|
564
635
|
processing_control.add_argument("--nthreads", type=int, default=16, help="ANTs/ITK thread count per subject/session process.")
|
|
565
636
|
processing_control.add_argument(
|
|
566
637
|
"--nproc",
|
|
@@ -587,35 +658,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
587
658
|
help="Force recompute of every cached step for selected recordings, ignoring the Nipype node cache "
|
|
588
659
|
"entirely. Equivalent to passing all of the --overwrite-* flags below at once.",
|
|
589
660
|
)
|
|
590
|
-
overwrite.add_argument(
|
|
591
|
-
"--overwrite-filt",
|
|
592
|
-
action="store_true",
|
|
593
|
-
help="Force recompute of biharmonic spike filtering, even if cached filtered maps exist.",
|
|
594
|
-
)
|
|
595
|
-
overwrite.add_argument("--overwrite-seg", action="store_true", help="Force recompute of tissue segmentation (SynthSeg brain extraction + dseg/probseg), even if cached outputs exist.")
|
|
596
|
-
overwrite.add_argument(
|
|
597
|
-
"--overwrite-pve",
|
|
598
|
-
action="store_true",
|
|
599
|
-
help="Force recompute of partial-volume correction (PETPVC), even if cached corrected maps exist.",
|
|
600
|
-
)
|
|
601
|
-
overwrite.add_argument(
|
|
602
|
-
"--overwrite-t1-reg",
|
|
603
|
-
action="store_true",
|
|
604
|
-
help="Force recompute of MRSI-to-T1w registration, even if a cached transform exists.",
|
|
605
|
-
)
|
|
606
|
-
overwrite.add_argument(
|
|
607
|
-
"--overwrite-template-reg",
|
|
608
|
-
action="store_true",
|
|
609
|
-
help="Force recompute of T1w-to-MNI registration, even if a cached transform exists.",
|
|
610
|
-
)
|
|
611
|
-
overwrite.add_argument(
|
|
612
|
-
"--overwrite-transform",
|
|
613
|
-
action="store_true",
|
|
614
|
-
help="Force recompute of resampling MRSI maps through existing transforms into output spaces, even "
|
|
615
|
-
"if cached resampled maps exist. Does not itself force-recompute the transforms -- see "
|
|
616
|
-
"--overwrite-t1-reg/--overwrite-template-reg.",
|
|
617
|
-
)
|
|
618
|
-
overwrite.add_argument("--overwrite-chimera", action="store_true", help="Force re-run Chimera parcellation even if the output dseg file already exists.")
|
|
619
661
|
|
|
620
662
|
runtime = parser.add_argument_group("Other options")
|
|
621
663
|
runtime.add_argument(
|
|
@@ -745,10 +787,12 @@ def parse_args(argv: list[str] | None = None) -> MRSIPrepConfig:
|
|
|
745
787
|
participants_file=args.participants,
|
|
746
788
|
bids_filter_file=args.bids_filter_file,
|
|
747
789
|
mrsinmrs_file=args.mrsinmrs_file,
|
|
790
|
+
mrsi_input_dir=args.mrsi_input_dir,
|
|
748
791
|
quantification_tool=args.quantification_tool,
|
|
749
792
|
linewidth_unit=args.linewidth_unit,
|
|
750
793
|
crlb_unit=args.crlb_unit,
|
|
751
794
|
metabolites=args.metabolites,
|
|
795
|
+
steps=args.steps,
|
|
752
796
|
quality_metrics=args.quality_metrics,
|
|
753
797
|
nucleus=args.nucleus,
|
|
754
798
|
snr_min=args.snr_min,
|