sliceLimits
Description
Examples
Get Limits for One Slice of Medical Volume
Get the limits for one 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)
Specify the directory of DICOM files for the first CT volume in the data set.
dataFolder = fullfile(filepath,"MedicalVolumeDICOMData","LungCT01");
Create a medical volume object for the CT volume.
medVol = medicalVolume(dataFolder);
Extract the x-, y-, and z-axis limits, in millimeters, of the second slice in the coronal direction.
[XLim,YLim,ZLim] = sliceLimits(medVol,2,"coronal")
XLim = 1×2
-186.5000 185.7717
YLim = 1×2
-185.7715 -185.7715
ZLim = 1×2
-281.2500 -63.7500
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
XLim
— Limits of volume in x-dimension of patient coordinate system
2-element numeric vector
Limits of the volume in the x-dimension of the patient coordinate
system, returned as a 2-element numeric vector of the form [xMin
xMax]
. The limits are in the units specified by the
SpatialUnits
property of medVol
.
YLim
— Limits of volume in y-dimension of patient coordinate system
2-element numeric vector
Limits of the volume in the y-dimension of the patient coordinate
system, returned as a 2-element numeric vector of the form [yMin
yMax]
. The limits are in the units specified by the
SpatialUnits
property of medVol
.
ZLim
— Limits of volume in z-dimension of patient coordinate system
2-element numeric vector
Limits of the volume in the z-dimension of the patient coordinate
system, returned as a 2-element numeric vector of the form [zMin
zMax]
. The limits are in the units specified by the
SpatialUnits
property of medVol
.
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)