Programmatic depiction of objects in tomograms
This article describes some technique for generation of tomogram scenes.
While we call the different objects as "matlab-"XX, all the following explanations apply to the Dynamo command line, which inherits the graphic functionality of matlab.
Contents
Basic tool: graphic handles
The basic objects that we will use are the matlab figure and the matlab axis. Roughly speaking, a Matlab figure is a window generated by Matlab. A Matlab axes is a system of coordinates that can be defined inside a figure, and which can contain graphical objects.
In other words, graphical objects are defined into a canvas (a Matlab axes), which is parented by a window (a Matlab figure);
Matlab figure
A matlab figure can be created just by the order;
f = figure();
Here, f</ff> is an arbitrary name,we could have called the figure any other name. Once created, this f offers a handle, i.e., a way to operate on the figure. For instance :
f.Name = 'This is my figure'
will change the name shown on the top bar of the figure.
The current figure
One can get a handle to the current figure (the last one to have been active) through the command gcf. If none is current, a new figure will be generated.
Matlab axes
A newly created figure will contain by default an axes object. The current axes can be captured through the gca command and get a handle assigned:
ax = gca
so that in the next commands we can use the variable ax to refer to the handle.
In tomography, we are normally interested in having the same scale for the x,y and z coordinates. To force an axes called ax to behave this way, we use: axes(ax,'equal');
Graphical objects
Matlab provides many primitives for depiction of 3d objects. Besides generating a graphical object, most of them will return a handle that represents the created object, and that can be used later to edit and manipulate it.
Clouds of points
If you have three vectors x,y,z you can depict them as a set of 3d coordinates with:
h = plot3(x,y,z,'o');
The handle h allows you to change properties in the graphics, for instance:
h.MarkerSize = 12
will enlarge the size of the circle markers generated by the original order.
= Lines
Use the command line
Tomogram slices
Models
Models have different plotting methods attached.
Standard plotting methods
The standard plotting methods are called plotXX, where XX can be Points, TablePoints
The regular syntax of a plotting method is:
object.method( axeesHandle)
Thus, if you want to use the method plotPoints to generate in a graphical axes ax a 3d depiction of the points contained inside a model called m, your syntax would be:
m.plotPoints(ax);