getAxesHandles
Get handles to axes in Orthoslice Viewer
Description
returns the axes containing each of the views of the image volume in the
[hXY hYZ hXZ]
= getAxesHandles(s
)orthosliceViewer
object s
.
Examples
Create GIF of MRI Data Slices using Orthoslice Viewer
Load MRI data and view it in the Orthoslice Viewer.
load(fullfile(toolboxdir('images'),'imdata','BrainMRILabeled','images','vol_001.mat')); s = orthosliceViewer(vol);
Get the handle of the axes that contains the slice.
[hXYAxes, hYZAxes, hXZAxes] = getAxesHandles(s);
Turn off crosshair for better visibility.
set(s,'CrosshairEnable','off');
Specify the name of the GIF file.
filename = 'animatedYZSlice.gif';
Create an array of slice numbers in the required direction. Consider the YZ direction.
sliceNums = 1:240;
Loop through and create an image at the specified slice position.
for idx = sliceNums % Update X slice number to get YZ Slice. s.SliceNumbers(1) = idx; % Use getframe to capture image. I = getframe(hYZAxes); [indI,cm] = rgb2ind(I.cdata,256); % Write frame to the GIF File. if idx == 1 imwrite(indI,cm,filename,'gif','Loopcount',inf,'DelayTime',0.05); else imwrite(indI,cm,filename,'gif','WriteMode','append','DelayTime',0.05); end end
View the animated GIF.
Input Arguments
s
— Orthoslice Viewer
orthosliceViewer
object
Orthoslice Viewer, specified as an orthosliceViewer
object.
Output Arguments
[hXY hYZ hXZ]
— Axes in Orthoslice Viewer
1-by-3 vector of Axes
objects
Axes in Orthoslice Viewer, returned as a 1-by-3 vector of Axes
objects.
Version History
Introduced in R2019b
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)