Iterates over a registry and converts all sessions from DICOM to NIfTI.
Examples
reg <- validate_registry(
system.file("extdata", "example_registry.csv", package = "scimagR")
)
#> ✔ Registry validation passed.
# A session that cannot be converted (here: its DICOM folder is missing)
# gets status "error" and a warning; the batch carries on.
convert_batch(reg[1, ],
dicom_root = file.path(tempdir(), "dicom"),
nifti_root = file.path(tempdir(), "nifti")
)
#> Warning: Conversion failed for SCI001/ses-01: DICOM directory not found:
#> /tmp/Rtmp5ydOUY/dicom/SCI001/ses-01
#> Batch conversion: 0 succeeded, 1 failed.
#> # A tibble: 1 × 4
#> pat_id session status n_files
#> <chr> <chr> <chr> <int>
#> 1 SCI001 ses-01 error 0
if (FALSE) { # \dontrun{
# Not run: needs DICOM files and the external 'dcm2niix' converter.
convert_batch(reg, "data/raw/dicom", "data/nifti")
} # }