orient
Description
updates the patient coordinate system convention of the spatial referencing information
orientR
= orient(R
,targetSpace
)R
to the specified convention targetSpace
and
returns an equivalent spatial referencing information object, orientR
,
that uses the specified patient coordinate system convention. Use this function to set or
update the patient coordinate system orientation, such as from LPS+
to
RAS+
.
Examples
Update Orientation of Medical Spatial Referencing Object
Update the orientation of the medical spatial referencing object for 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. Download the data set from the MathWorks® website, then unzip the folder.
zipFile = matlab.internal.examples.downloadSupportFile("medical","MedicalVolumeDICOMData.zip"); filepath = fileparts(zipFile); unzip(zipFile,filepath)
Specify the directory of the DICOM files for the first CT volume in the data set.
dataFolder = fullfile(filepath,"MedicalVolumeDICOMData","LungCT01");
Create a medical volume object that contains the image and spatial metadata for the CT volume.
medVol = medicalVolume(dataFolder);
The VolumeGeometry
property of the medical volume object contains a medicalref3d
object that specifies the spatial referencing for the volume. Extract the medicalref3d
object for the chest CT.
R = medVol.VolumeGeometry
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 patient coordinate system orientation. The initial orientation, based on the DICOM file metadata, is LPS+
. An LPS+
orientation indicates that the positive x-, y-, and z-axes of the patient coordinate system point in the left, posterior, and superior directions, respectively.
R.PatientCoordinateSystem
ans = "LPS+"
Update the patient coordinate system orientation to the RAS+
orientation. An RAS+
orientation indicates that the positive x-, y-, and z-axes of the patient coordinate system point in the right, anterior, and superior directions, respectively. The orient
object function returns a new medicalref3d
object, orientR
. In addition to the PatientCoordinateSystem
property, the Position
and VoxelDistances
property values reflect the new orientation of orientR
.
orientR = orient(R,"RAS+")
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
Input Arguments
R
— Spatial referencing information
medicalref3d
object
Spatial referencing information, specified as a medicalref3d
object.
targetSpace
— Target orientation convention of the patient coordinate system
"LPS+"
| "LAS+"
| "RAS+"
Target orientation convention of the patient coordinate system, specified as
"LPS+"
, "LAS+"
, or "RAS+"
.
The first three characters indicate the positive direction of the x-,
y-, and z-axes of the patient coordinate system,
respectively.
The positive direction of the x-axis points left (
"L"
) or right ("R"
).The positive direction of the y-axis points anterior (
"A"
) or posterior ("P"
).The positive direction of the z-axis points inferior (
"I"
) or superior ("S"
)."+"
indicates that values increase in the stated direction.
For example, "LPS+"
specifies a patient coordinate system with
the x-, y-, and z-axes positive
in the left, posterior, and superior directions, respectively.
Data Types: char
| string
Output Arguments
orientR
— Spatial referencing information with target patient coordinate system convention
medicalref3d
object
Spatial referencing information with the target patient coordinate system
convention, returned as a medicalref3d
object. Which properties of this
object the orient
function updates from R
depends on the PatientCoordinateSystem
property of
R
.
If
PatientCoordinateSystem
is"unknown"
, thenorient
updates only thePatientCoordinateSystem
oforientR
.If
PatientCoordinateSystem
is not"unknown"
, thenorient
updates theVoxelDistances
andPosition
properties oforientR
, in addition to thePatientCoordinateSystem
property, to maintain the correct mapping between the intrinsic and patient coordinate system axes.
Version History
Introduced in R2022b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)