public class FrameSet extends Frame
Every FrameSet has a "base" Frame and a "current" Frame (which are allowed to be the same). Any of the Frames may be nominated to hold these positions, and the choice is determined by the values of the FrameSet's Base and Current attributes, which hold the indices of the relevant Frames. By default, the first Frame added to a FrameSet is its base Frame, and the last one added is its current Frame.
The base Frame describes the "native" coordinate system of whatever the FrameSet is used to calibrate (e.g. the pixel coordinates of an image) and the current Frame describes the "apparent" coordinate system in which it should be viewed (e.g. displayed, etc.). Any further Frames represent a library of alternative coordinate systems, which may be selected by making them current.
When a FrameSet is used in a context that requires a Frame, (e.g. obtaining its Title value, or number of axes), the current Frame is used. A FrameSet may therefore be used in place of its current Frame in most situations.
When a FrameSet is used in a context that requires a Mapping, the Mapping used is the one between its base Frame and its current Frame. Thus, a FrameSet may be used to convert "native" coordinates into "apparent" ones, and vice versa. Like any Mapping, a FrameSet may also be inverted (see astInvert), which has the effect of interchanging its base and current Frames and hence of reversing the Mapping between them.
Regions may be added into a FrameSet (since a Region is a type of Frame), either explicitly or as components within CmpFrames. In this case the Mapping between a pair of Frames within a FrameSet will include the effects of the clipping produced by any Regions included in the path between the Frames.
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA
Mapping.Interpolator, Mapping.Spreader
Modifier and Type | Field and Description |
---|---|
static int |
AST__BASE
Frame index of Base coordinate frame of FrameSet.
|
static int |
AST__CURRENT
Frame index of Current coordinate frame of FrameSet.
|
static int |
AST__NOFRAME
Frame index which applies to no frame in the FrameSet.
|
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
AST__BAD, AST__TUNULL, pointer
Modifier | Constructor and Description |
---|---|
protected |
FrameSet()
Dummy constructor.
|
|
FrameSet(Frame frame)
Creates a FrameSet.
|
Modifier and Type | Method and Description |
---|---|
void |
addFrame(int iframe,
Mapping map,
Frame frame)
Add a Frame to a FrameSet to define a new coordinate system.
|
int |
getBase()
Get
frameSet base Frame index.
|
int |
getCurrent()
Get
frameSet current Frame index.
|
Frame |
getFrame(int iframe)
Obtain a pointer to a specified Frame in a FrameSet.
|
Mapping |
getMapping(int iframe1,
int iframe2)
Obtain a Mapping that converts between two Frames in a FrameSet.
|
int |
getNframe()
Get
number of Frames in a FrameSet.
|
void |
remapFrame(int iframe,
Mapping map)
Modify a Frame's relationship to other Frames in a FrameSet.
|
void |
removeFrame(int iframe)
Remove a Frame from a FrameSet.
|
void |
setBase(int base)
Set
frameSet base Frame index.
|
void |
setCurrent(int current)
Set
frameSet current Frame index.
|
angle, axAngle, axDistance, axOffset, convert, distance, findFrame, format, getActiveUnit, getAlignSystem, getBottom, getDigits, getDigits, getDirection, getDomain, getDut1, getEpoch, getFormat, getLabel, getMatchEnd, getMaxAxes, getMinAxes, getNaxes, getNormUnit, getObsLat, getObsLon, getPermute, getPreserveAxes, getSymbol, getSystem, getTitle, getTop, getUnit, intersect, norm, offset, offset2, permAxes, pickAxes, resolve, setActiveUnit, setAlignSystem, setBottom, setDigits, setDigits, setDirection, setDomain, setDut1, setEpoch, setEpoch, setFormat, setLabel, setMatchEnd, setMaxAxes, setMinAxes, setObsLat, setObsLon, setPermute, setPreserveAxes, setSymbol, setSystem, setTitle, setTop, setUnit, unformat
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
annul, clear, copy, delete, equals, finalize, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
public static final int AST__BASE
public static final int AST__CURRENT
public static final int AST__NOFRAME
public FrameSet(Frame frame)
frame
- Pointer to the first Frame to be inserted into the
FrameSet. This initially becomes both the base and the
current Frame. (Further Frames may be added using the
astAddFrame function.)AstException
- if an error occurred in the AST libraryprotected FrameSet()
public void addFrame(int iframe, Mapping map, Frame frame)
This function may also be used to merge two FrameSets, or to append extra axes to every Frame in a FrameSet.
iframe
- The index of the Frame within the FrameSet which describes
the coordinate system upon which the new one is to be based.
This value should lie in the range from 1 to the number of
Frames already in the FrameSet (as given by its Nframe
attribute). As a special case, AST__ALLFRAMES may be supplied,
in which case the axes defined by the supplied Frame are appended
to every Frame in the FrameSet (see the Notes section for details).map
- Pointer to a Mapping which describes how to convert
coordinates from the old coordinate system (described by the
Frame with index "iframe") into coordinates in the new
system. The Mapping's forward transformation should perform
this conversion, and its inverse transformation should
convert in the opposite direction. The supplied Mapping is ignored
if parameter "iframe"is equal to AST__ALLFRAMES.frame
- Pointer to a Frame that describes the new coordinate system.
Any class of Frame may be supplied (including Regions and
FrameSets).
This function may also be used to merge two FrameSets by supplying a pointer to a second FrameSet for this parameter (see the Notes section for details).
AstException
- if an error occurred in the AST librarypublic Frame getFrame(int iframe)
iframe
- The index of the required Frame within the FrameSet. This
value should lie in the range from 1 to the number of Frames
in the FrameSet (as given by its Nframe attribute).AstException
- if an error occurred in the AST librarypublic Mapping getMapping(int iframe1, int iframe2)
iframe1
- The index of the first Frame in the FrameSet. This Frame describes
the coordinate system for the "input" end of the Mapping.iframe2
- The index of the second Frame in the FrameSet. This Frame
describes the coordinate system for the "output" end of the
Mapping.AstException
- if an error occurred in the AST librarypublic void remapFrame(int iframe, Mapping map)
Typically, this might be required if the FrameSet has been used to calibrate (say) an image, and that image is re-binned. The Frame describing the image will then have undergone a coordinate transformation, and this should be communicated to the associated FrameSet using this function.
iframe
- The index within the FrameSet of the Frame to be modified.
This value should lie in the range from 1 to the number of
Frames in the FrameSet (as given by its Nframe attribute).map
- Pointer to a Mapping whose forward transformation converts
coordinate values from the original coordinate system
described by the Frame to the new one, and whose inverse
transformation converts in the opposite direction.AstException
- if an error occurred in the AST librarypublic void removeFrame(int iframe)
iframe
- The index within the FrameSet of the Frame to be removed.
This value should lie in the range from 1 to the number of
Frames in the FrameSet (as given by its Nframe attribute).AstException
- if an error occurred in the AST librarypublic int getBase()
public void setBase(int base)
base
- the Base attribute of this objectpublic int getCurrent()
public void setCurrent(int current)
current
- the Current attribute of this objectpublic int getNframe()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.