Checks a project created with sci_create_project() and returns the plan
of processing steps, each with the function that performs it:
DICOM metadata extraction (
extract_dicom_metadata())Anonymization, if requested (
anonymize_dicom())DICOM to NIfTI conversion (
convert_batch())Spinal cord segmentation (
sct_segment_sc())Lesion segmentation with SCIsegV2 (
sct_segment_lesion())Vertebral labeling (
sct_label_vertebrae())Parameter extraction (
sct_analyze_lesion(),sct_process_segmentation())Merge & export (
save_table(),save_rds())
Usage
sci_run_pipeline(
project_dir,
steps = 1:8,
anonymize = FALSE,
overwrite = FALSE,
verbose = TRUE
)Arguments
- project_dir
Character. Path to workflowr project root.
- steps
Integer vector. Which steps to run. Default
1:8.- anonymize
Logical. Run anonymization step. Default
FALSE.- overwrite
Logical. Kept for compatibility; not used while the runner only plans steps. Default
FALSE.- verbose
Logical. Print progress. Default
TRUE.
Value
Tibble with one row per requested step: step, name,
status ("pending" or "skipped") and message (the function to
run, or the reason for skipping).
Details
sci_run_pipeline() does not run the external tools itself: every
requested step is reported as "pending" until you run its function.
Use sci_pipeline_status() to see which outputs already exist.
Examples
proj <- file.path(tempdir(), "pipeline-study")
sci_create_project(proj, open = FALSE)
#>
#> ── Creating SCI project: SCI Imaging Analysis ──────────────────────────────────
#> ✔ Directory structure created.
#> ✔ Templates created.
#> ✔ Project created at /tmp/Rtmp5ydOUY/pipeline-study
#> ℹ Next steps:
#> 1. Place DICOM files in data/raw/dicom/
#> 2. Fill in data/metadata/imaging_registry.csv
#> 3. Fill in data/metadata/clinical_data.csv
#> 4. Plan the processing steps with `sci_run_pipeline()`
sci_run_pipeline(proj, steps = 1:3)
#>
#> ── Step 1: DICOM metadata extraction ──
#>
#> ℹ Run `extract_dicom_metadata()` for this step.
#> Step 2 (Anonymization): skipped (anonymize = FALSE)
#>
#> ── Step 3: DICOM to NIfTI conversion ──
#>
#> ℹ Run `convert_batch()` for this step.
#>
#> ── Pipeline Summary ──
#>
#> 2 pending, 1 skipped
#> # A tibble: 3 × 4
#> step name status message
#> <int> <chr> <chr> <chr>
#> 1 1 DICOM metadata extraction pending run extract_dicom_metadata()
#> 2 2 Anonymization skipped anonymize = FALSE
#> 3 3 DICOM to NIfTI conversion pending run convert_batch()
unlink(proj, recursive = TRUE)