Download a chest CT volume saved as a directory of DICOM files. The volume is part of a data set containing three CT volumes. The size of the entire data set is approximately 81 MB.
Run this code to download the data set from the MathWorks® website, then unzip the folder.
Specify the directory of the DICOM files for the first CT volume in the data set. Create a medical volume object that contains the image and spatial metadata for the CT volume.
The VolumeGeometry property contains a medicalref3d object that specifies the spatial referencing for the volume. Extract the medicalref3d object for the chest CT.
R =
medicalref3d with properties:
VolumeSize: [512 512 88]
Position: [88×3 double]
VoxelDistances: {[88×3 double] [88×3 double] [88×3 double]}
PatientCoordinateSystem: "LPS+"
PixelSpacing: [88×2 double]
IsAffine: 1
IsAxesAligned: 1
IsMixed: 0
The PatientCoordinateSystem property of the medicalref3d object specifies the mapping between the patient coordinate system axes and the anatomical directions within the patient. The initial value, based on the DICOM file metadata, is LPS+. An LPS+ value indicates that the positive x-, y-, and z-axes point in the left, posterior, and superior directions, respectively.
Update the patient coordinate system convention to RAS+, which indicates that the positive x-, y-, and z-axes point in the right, anterior, and superior directions, respectively. The updatePatientCoordinateSystem object function returns a new medicalref3d object, orientR. In addition to the PatientCoordinateSystem property, the Position and VoxelDistances property values reflect the new spatial mapping of orientR.
orientR =
medicalref3d with properties:
VolumeSize: [512 512 88]
Position: [88×3 double]
VoxelDistances: {[-0.7285 0 0] [0 -0.7285 0] [0 0 2.5000]}
PatientCoordinateSystem: "RAS+"
PixelSpacing: [0.7285 0.7285]
IsAffine: 1
IsAxesAligned: 1
IsMixed: 0