Learn R Programming

oro.dicom (version 0.3.1)

Create: Create Arrays from DICOM Headers/Images

Description

A DICOM list structure is used to produce a multi-dimensional array representing a single acquisition of medical imaging data.

Usage

create3D(dcm, mode = "integer", transpose = TRUE, pixelData = TRUE,
         mosaic = FALSE, mosaicXY = NULL, sequence = FALSE)
create4D(dcm, mode = "integer", transpose = TRUE, pixelData = TRUE,
         mosaic = FALSE, mosaicXY = NULL, nslices = NULL,
         ntimes = NULL, instance = TRUE, sequence = FALSE)

Arguments

dcm
is the DICOM list structure (if pixelData = TRUE) or the DICOM header information (if pixelData = FALSE).
mode
is a valid character string for storage.mode.
transpose
is necessary to switch the definition of rows and columns from DICOM to R.
pixelData
is a logical variable (default = TRUE) that is associated with the DICOM image data being pre-loaded.
mosaic
is a logical variable (default = FALSE) to denote storage of the data in Siemens Mosaic format.
mosaicXY
is a vector of length two that provides the (x,y) dimensions of the individual images. Default behavior is to use the AcquisitonMatrix to determine the (x,y) values.
sequence
is a logical variable (default = FALSE) on whether to look in SequenceItem entries for DICOM header information.
nslices
is the third dimension of the array. Attempts are made to determine this number from the DICOM data.
ntimes
is the fourth dimension of the array. Attempts are made to determine this number from the DICOM data.
instance
is a logical variable (default = TRUE) that determines whether or not to access the InstanceNumber field in the DICOM header to help order the slices.

Value

  • Multi-dimensional array of medical imaging data.

References

Digital Imaging and Communications in Medicine (DICOM) http://medical.nema.org

See Also

array, dicomInfo, storage.mode

Examples

Run this code
## pixelData = TRUE
## The DICOM image data are read from dicomSeparate()
dcmList <- dicomSeparate(system.file("hk-40", package="oro.dicom"))
dcmImage <- create3D(dcmList)
image(dcmImage[,,1], col=grey(0:64/64), axes=FALSE, xlab="", ylab="")
imagePositionPatient <- attributes(dcmImage)$ipp
dSL <- abs(diff(imagePositionPatient[,3]))
plot(dSL, ylim=range(range(dSL) * 1.5, 0, 10), xlab="Image", ylab="mm",
     main="Difference in Slice Location")

## pixelData = FALSE
## The DICOM image data are read from create3D()
## This may save on memory for large batches of DICOM data
dcmList <- dicomSeparate(system.file("hk-40", package="oro.dicom"),
                         pixelData=FALSE)
dcmImage <- create3D(dcmList, pixelData=FALSE)
image(dcmImage[,,1], col=grey(0:64/64), axes=FALSE, xlab="", ylab="")

## mosaic = TRUE
dcm <- dicomInfo(system.file("dcm/MR-sonata-3D-as-Tile.dcm",
                             package="oro.dicom"))
dcmImage <- create3D(dcm, mode="integer", mosaic=TRUE)
image(dcmImage[,,dim(dcmImage)[3]/2], col=grey(0:64/64), axes=FALSE,
      xlab="", ylab="")

Run the code above in your browser using DataLab