public class DefaultMutableNdx extends BridgeNdx implements MutableNdx
MutableNdx interface,
so provides mutator methods as well as the accessor methods of Ndx.
This class can be used to wrap a (presumably immutable) existing Ndx
object, or to construct a mutable Ndx from an NdxImpl object.BridgeNdx.BridgeNdxHdxFacadendxDocumentCache| Constructor and Description |
|---|
DefaultMutableNdx(NDArray image)
Constructs a MutableNdx from a given
NDArray which
will be its Image component. |
DefaultMutableNdx(Ndx ndx)
Constructs a MutableNdx from a given Ndx.
|
DefaultMutableNdx(NdxImpl impl)
Constructs a MutableNdx from a given NdxImpl.
|
| Modifier and Type | Method and Description |
|---|---|
FrameSet |
getAst()
Get the world coordinate system of the NDX as
an AST
FrameSet. |
int |
getBadBits()
Gets the value of the badBits mask.
|
Source |
getEtc()
Returns the XML containing extension information for this NDX.
|
NDArray |
getImage()
Returns the image component of this NDX.
|
String |
getLabel()
Returns the label string for this Ndx.
|
NDArray |
getQuality()
Returns the quality component of this NDX.
|
String |
getTitle()
Returns the title of this Ndx.
|
String |
getUnits()
Returns the units string for this Ndx.
|
NDArray |
getVariance()
Returns the variance component of this NDX.
|
boolean |
hasEtc()
Find out if the NDX contains user-defined extension information.
|
boolean |
hasLabel()
Indicates whether there is a label component.
|
boolean |
hasQuality()
Indicates whether there is a quality component.
|
boolean |
hasTitle()
Indicates whether there is a title component.
|
boolean |
hasUnits()
Indicates whether there is a units component.
|
boolean |
hasVariance()
Indicates whether there is a variance component.
|
boolean |
hasWCS()
Find out if the NDX has World Coordinate System information.
|
void |
setBadBits(int badbits)
Sets the bad bits mask for this Ndx.
|
void |
setEtc(Node etc)
Sets the Etc component of this Ndx.
|
void |
setImage(NDArray image)
Sets the Image component of this Ndx.
|
void |
setLabel(String label)
Sets the label component of this Ndx.
|
void |
setQuality(NDArray quality)
Sets the Quality component of this Ndx.
|
void |
setTitle(String title)
Sets the title component of this Ndx.
|
void |
setUnits(String units)
Sets the units component of this Ndx.
|
void |
setVariance(NDArray variance)
Sets the Variance component of this Ndx.
|
void |
setWCS(Object wcsob)
Sets the WCS component of this Ndx.
|
getHdxFacade, getHdxResourceType, isPersistent, toXMLclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHdxFacade, isPersistent, toXMLpublic DefaultMutableNdx(NdxImpl impl)
BridgeNdx
constructed from impl
until such time as one of the set methods is used on it,
after which time the new value(s) will be returned by the
corresponding get methods.impl - the implementation object on which this Ndx will be basedpublic DefaultMutableNdx(Ndx ndx)
set methods is used on it,
after which time the new value(s) will be returned by the
corresponding get methods.ndx - the underlying Ndx on which this one will be basedpublic DefaultMutableNdx(NDArray image)
NDArray which
will be its Image component.
The resulting object has no optional components (title, etc and so on),
though these can be set using the various set methods.image - the Image component of this NdxNullPointerException - if image is nullpublic void setImage(NDArray image)
MutableNdxnull value.setImage in interface MutableNdximage - the new Image componentpublic NDArray getImage()
Ndx
Note that this returns the raw image NDArray object,
which should not in general be used directly for reading image
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the image data for read access,
use the Ndxs.getMaskedImage(Ndx) method.
public void setVariance(NDArray variance)
MutableNdxnull the Ndx will be considered
to have no Variance component.setVariance in interface MutableNdxvariance - the new Variance componentpublic boolean hasVariance()
NdxhasVariance in interface NdxhasVariance in class BridgeNdxNdx.getVariance() may be calledpublic NDArray getVariance()
Ndx
Note that this returns the raw variance
NDArray object,
which should not in general be used directly for reading variance
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the variance data for read access,
use the Ndxs.getMaskedVariance(Ndx) method.
May only be called if Ndx.hasVariance() returns true.
getVariance in interface NdxgetVariance in class BridgeNdxpublic void setQuality(NDArray quality)
MutableNdxnull the Ndx will be considered to have
no Quality component.setQuality in interface MutableNdxquality - the new Quality componentpublic boolean hasQuality()
NdxhasQuality in interface NdxhasQuality in class BridgeNdxNdx.getQuality() may be calledpublic NDArray getQuality()
Ndx
May only be called if Ndx.hasQuality() returns true.
getQuality in interface NdxgetQuality in class BridgeNdxpublic void setBadBits(int badbits)
MutableNdxsetBadBits in interface MutableNdxbadbits - the new bad bits maskpublic int getBadBits()
NdxgetBadBits in interface NdxgetBadBits in class BridgeNdxpublic void setTitle(String title)
MutableNdxsetTitle in interface MutableNdxtitle - the new title.
If null, this Ndx will be considered to have
no titlepublic boolean hasTitle()
NdxhasTitle in interface NdxhasTitle in class BridgeNdxNdx.getTitle() may be calledpublic String getTitle()
NdxNdx.hasTitle() returns true.public void setLabel(String label)
MutableNdxsetLabel in interface MutableNdxlabel - the new label.
if null, this Ndx will be considered to have
no labelpublic boolean hasLabel()
NdxhasLabel in interface NdxhasLabel in class BridgeNdxNdx.getLabel() may be calledpublic String getLabel()
NdxNdx.hasLabel() returns true.public void setUnits(String units)
MutableNdxsetUnits in interface MutableNdxunits - the new units string.
if null, this Ndx will be considered to have no
units componentpublic boolean hasUnits()
NdxhasUnits in interface NdxhasUnits in class BridgeNdxNdx.getUnits() may be calledpublic String getUnits()
NdxNdx.hasUnits() returns true.public void setWCS(Object wcsob)
MutableNdxsetWCS in interface MutableNdxwcsob - an object representing the new WCS component
If null, a default WCS will be usedpublic boolean hasWCS()
Ndx
If it exists, then the Ndx.getAst() method may be called to
access it as an AST FrameSet.
Note: in due course, when the uk.ac.starlink.wcs
package has been released a getWCS method will be
provided to access it as a WCS object.
hasWCS in interface NdxhasWCS in class BridgeNdxNdx.getAst() (and in due course getWCS
can be calledpublic FrameSet getAst()
NdxFrameSet.
Note: This method is intended as a temporary measure
until the uk.ac.starlink.wcs package has been released.
At that time a getWCS method will be provided, and
this one will be deprecated.
getAst in interface NdxgetAst in class BridgeNdxNdx.hasWCS()public void setEtc(Node etc)
MutableNdxnull
the supplied Node should be a Document or Element of type <etc>.setEtc in interface MutableNdxetc - the new user-defined extensions component as a DOM node.
If null, this Ndx will be considered to have no
extensionspublic boolean hasEtc()
NdxhasEtc in interface NdxhasEtc in class BridgeNdxNdx.getEtc() may be calledpublic Source getEtc()
Ndx<etc> which contains an element for each extension.
May only be called if Ndx.hasEtc() returns true.getEtc in interface NdxgetEtc in class BridgeNdxSourceReaderCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.