nipoppy.workflows.dicom_reorg.DicomReorgWorkflow¶
- class nipoppy.workflows.dicom_reorg.DicomReorgWorkflow(dpath_root, copy_files=False, check_dicoms=False, fpath_layout=None, verbose=False, dry_run=False)¶
Workflow for organizing raw DICOM files.
- Parameters:
dpath_root (nipoppy.env.StrOrPathLike)
copy_files (bool)
check_dicoms (bool)
fpath_layout (Optional[nipoppy.env.StrOrPathLike])
verbose (bool)
dry_run (bool)
- apply_fname_mapping(fpath_source, participant_id, session_id)¶
Apply a mapping from the original (full) file path to destination file name.
Prepend a short hash of the path to avoid filename collisions across DICOM series, while ensuring short filenames in nested directory structures.
- Parameters:
fpath_source (nipoppy.env.StrOrPathLike)
participant_id (str)
session_id (str)
- Return type:
- get_fpaths_to_reorg(participant_id, session_id)¶
Get file paths to reorganize for a single participant and session.
- Parameters:
- Return type:
- get_participants_sessions_to_run()¶
Return participant-session pairs to reorganize.
- run_cleanup()¶
Clean up after main DICOM reorg part is run.
Specifically: - Write updated curation status file - Log a summary message
- run_main()¶
Reorganize all downloaded DICOM files.
- run_setup()¶
Update the curation status table in case it is not up-to-date.
- run_single(participant_id, session_id)¶
Reorganize downloaded DICOM files for a single participant and session.
- check_dicoms = False¶
- copy_files = False¶
- n_success = 0¶
- n_total = 0¶