sliceCorners
Description
extracts the xyz-coordinates of the four corner voxels for one slice of
an image volume.xyzCorners = sliceCorners(R,slice)
Examples
Extract the corner coordinates for one slice of the medical spatial referencing object of 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;
Extract the xyz-coordinates, in millimeters, of the corner voxels for the first slice along the third dimension of the volume.
xyzCorners = sliceCorners(R,1)
xyzCorners = 4×3
-186.5000 -186.5000 -281.2500
-186.5000 185.7717 -281.2500
185.7717 185.7717 -281.2500
185.7717 -186.5000 -281.2500
Input Arguments
Spatial referencing information, specified as a medicalref3d
object.
Slice index, specified as a positive integer scalar in the range [1, p], where p is the number of slices in the image volume along the third dimension.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Output Arguments
Coordinates of the four corner voxels in the patient coordinate system, returned as a 4-by-3 numeric matrix. Each row contains xyz-coordinates for one corner of the slice, returned in clockwise order:
Pixel in the first row and first column of the data array.
Pixel in the first row and last column of the data array.
Pixel in the last row and last column of the data array.
Pixel in the last row and first column of the data array.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)