These functions extract and replace medical image attributes that go beyond the core metadata associated with the NIfTI-1 file format.

imageAttributes(x)

imageAttributes(x) <- value

Arguments

x

An R object, generally an image object like those returned by readDicom.

value

A list of new image attributes to replace any existing ones.

Value

A list of image attributes, or a modified object with these changed. These are essentially all attributes except those used for basic niftiImage objects by the RNifti package.

Details

The DICOM format can encapsulate copious amounts of metadata about the scan and the patient, which can be useful for more advanced or research-focussed post-processing methods. Some of this information is extracted during the DICOM-to-NIfTI conversion process and stored in additional named attributes; the imageAttributes function returns a list of just these extended attributes. The replacement form allows this metadata to be modified or removed. These functions currently only act on objects inheriting from the niftiImage class.

Note

Attributes may include sensitive or identifiable information such as a patient's name, sex, date of birth, etc., if this was included in the original DICOM files. These functions make no attempt to identify or anonymise this metadata, and so this must be handled by the user if necessary.

References

More information about metadata captured by the BIDS format can be found at https://bids.neuroimaging.io or in the paper cited below.

K.J. Gorgolewski, T. Auer, V.D. Calhoun, et al. The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments (2016). Scientific Data 3:160044. doi:10.1038/sdata.2016.44 .

Author

Jon Clayden code@clayden.org

Examples

path <- system.file("extdata", "raw", package="divest")
images <- readDicom(path, interactive=FALSE)
#> [dcm2niix info] Found 4 DICOM file(s)
#> [dcm2niix WARNING] Unable to determine manufacturer (0008,0070), so conversion is not tuned for vendor.
#> [dcm2niix WARNING] All images appear to be a single slice - please check slice/vector orientation
#> [dcm2niix WARNING] This diffusion series does not have a B0 (reference) volume
#> [dcm2niix info] Convert 2 DICOM as /tmp/RtmpuRGJEg/divest_30478/T0_N_S8 (96x96x1x2)
#> [dcm2niix WARNING] Unable to determine manufacturer (0008,0070), so conversion is not tuned for vendor.
#> [dcm2niix info] Convert 2 DICOM as /tmp/RtmpuRGJEg/divest_30478/T0_N_S9 (224x256x2x1)
imageAttributes(images[[1]])
#> $bValues
#> [1] 2000 2000
#> 
#> $bVectors
#>        [,1]   [,2]   [,3]
#> [1,] 0.5508 0.4258 0.7177
#> [2,] 0.1110 0.2640 0.9581
#> 
#> $modality
#> [1] "MR"
#> 
#> $fieldStrength
#> [1] 1.494
#> 
#> $imagingFrequency
#> [1] 63.68285
#> 
#> $patientPosition
#> [1] "HFS"
#> 
#> $MRAcquisitionType
#> [1] "2D"
#> 
#> $seriesDescription
#> [1] "DTIb3000s5"
#> 
#> $protocolName
#> [1] "DTIb3000s5"
#> 
#> $scanningSequence
#> [1] "SE\\EP"
#> 
#> $sequenceVariant
#> [1] "SK\\SP"
#> 
#> $scanOptions
#> [1] "FS"
#> 
#> $sequenceName
#> [1] "ep_b2000#16"
#> 
#> $imageType
#> [1] "ORIGINAL" "PRIMARY"  "M"        "ND"       "NORM"    
#> 
#> $nonlinearGradientCorrection
#> [1] FALSE
#> 
#> $seriesNumber
#> [1] 8
#> 
#> $acquisitionNumber
#> [1] 1
#> 
#> $sliceThickness
#> [1] 5
#> 
#> $sliceSpacing
#> [1] 5
#> 
#> $SAR
#> [1] 0.0973325
#> 
#> $numberOfAverages
#> [1] 2
#> 
#> $echoTime
#> [1] 112
#> 
#> $repetitionTime
#> [1] 4100
#> 
#> $spoilingState
#> [1] TRUE
#> 
#> $flipAngle
#> [1] 90
#> 
#> $percentPhaseFOV
#> [1] 100
#> 
#> $percentSampling
#> [1] 100
#> 
#> $phaseEncodingSteps
#> [1] 72
#> 
#> $acquisitionMatrixPE
#> [1] 96
#> 
#> $reconMatrixPE
#> [1] 96
#> 
#> $pixelBandwidth
#> [1] 900
#> 
#> $phaseEncodingDirection
#> [1] "j"
#> 
#> $phaseEncodingSign
#> [1] -1
#> 
#> $imageOrientationPatientDICOM
#> [1] 1 0 0 0 1 0
#> 
#> $inPlanePhaseEncodingDirectionDICOM
#> [1] "COL"
#> 
#> $conversionSoftware
#> [1] "dcm2niix"
#> 
#> $conversionSoftwareVersion
#> [1] "v1.0.20241001"
#>