Learn R Programming

tractor.base (version 1.6.0)

sortDicomDirectory: Sort a directory of DICOM files into series

Description

This function sorts a directory containing DICOM files into subdirectories by series number, DICOM tag (0x0020,0x0011). Each unique series number, together with its description, DICOM tag (0x0008,0x103e), will be used as the name for a new subdirectory of the specified top-level directory, and all relevant files will be copied into that subdirectory. Duplicate file names are disambiguated if necessary.

Usage

sortDicomDirectory(directory, deleteOriginals = FALSE)

Arguments

directory
A length-1 character vector giving the directory to search for DICOM files. Subdirectories will also be searched.
deleteOriginals
A single logical value. If TRUE, then the source files will be deleted after being copied to their new locations, making the operation a move rather than a copy. Nothing will be deleted if the copy fails.

Value

  • This function is called for its side effect.

See Also

newMriImageFromDicom for reading DICOM files into an MriImage object.