sliceCorners
Extract coordinates of corner voxels for one slice of medical volume
Since R2022b
Description
extracts the xyz-coordinates of the four corner voxels for one slice,
xyzCorners
= sliceCorners(medVol
,slice
,direction
)slice
, in the specified direction direction
of
the medicalVolume
object medVol
. The function returns the corner coordinates in the
patient coordinate system.
Examples
Extract Corner Coordinates for One Slice of Medical Volume
Extract corner coordinates for a slice of a medical volume created using a chest CT volume saved as a directory of DICOM files. The CT 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)
The dataFolder
folder contains the downloaded CT volume.
dataFolder = fullfile(filepath,"MedicalVolumeDICOMData","LungCT01");
Create a medical volume object for the CT volume.
medVol = medicalVolume(dataFolder);
Extract the xyz-coordinates, in millimeters, of the corner voxels for the second slice in the coronal direction.
xyzCorners = sliceCorners(medVol,2,"coronal")
xyzCorners = 4×3
-186.5000 -185.7715 -281.2500
-186.5000 -185.7715 -63.7500
185.7717 -185.7715 -63.7500
185.7717 -185.7715 -281.2500
Input Arguments
medVol
— Medical volume
medicalVolume
object
Medical volume, specified as a medicalVolume
object.
slice
— Slice index
positive integer scalar in range [1, numSlices]
Slice index, specified as a positive integer scalar in the range [1,
numSlices], where numSlices is the number of
slices in the volume along the direction specified by
direction
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
direction
— Direction along which to extract slice limits
"coronal"
| "sagittal"
| "transverse"
Direction along which to extract the slice limits, specified as
"coronal"
, "sagittal"
, or
"transverse"
.
Data Types: char
| string
Output Arguments
xyzCorners
— Coordinates of four corner voxels in patient coordinate system
4-by-3 numeric matrix
Coordinates of the four corner voxels in the patient coordinate system, returned as a 4-by-3 numeric matrix. Each row contains the xyz-coordinates for one corner, returned in clockwise order from the upper-left corner.
Version History
Introduced in R2022b
See Also
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)