The ImageConcat object does not copy the input images, it
just references them. You can use the Lattice
If you use the putSlice function, be aware that it will change the
underlying images if they are writable.
You can also concatenate a lattice to an image.
Default constructor, Sets the concatenation axis to 0
Copy constructor (reference semantics)
Destructor
Assignment operator (reference semantics)
Make a copy of the object (reference semantics).
Get the image type (returns name of derived class).
Sets a new image into the list to be concatenated.
If relax is False, throws an exception if the images
are not contiguous along the concatenation axis.
If relax is True, it will create a non-regular TabularCoordinate
for non-contiguous images if the coordinates are monotonic.
Otherwise, it just uses the coordinates of the image
Sets a new lattice into the list to be concatenated.
You can only concatenate a lattice with an image if
you have first used setImage to set an image (this
provides the CooridinateSystem information)
Return the number of images/lattices set so far
Returns the current concatenation axis (0 relative)
Returns the number of dimensions of the *input* images/lattices
Returns 0 if none yet set.
Handle the (un)locking and syncing, etc..
Return the name of the current ImageInterface object.
Since many images may be concatenated, there is no
sensible name. So returns the string "Concatenation :"
Has the object really a mask?
Does the image have a pixelmask?
Get access to the pixelmask.
An exception is thrown if the image does not have a pixelmask
Get the region used (always returns 0)
If all of the underlying lattices are writable returns True
Return the shape of the concatenated image
Return the best cursor shape. This isn't very meaningful for an ImageConcat
Image since it isn't on disk ! But if you do copy it out, this is
what you should use. The maxPixels aregument is ignored.
Do the actual get of the data.
The return value is always False, thus the buffer does not reference
another array. Generally the user should use function getSlice
Do the actual get of the mask data.
The return value is always False, thus the buffer does not reference
another array. Generally the user should use function getMaskSlice
Do the actual put of the data into the Lattice. This will change the
underlying images (if they are writable) that were used to create the
ImageConcat object. It throws an exception if not writable.
Generally the user should use function putSlice
Throws an excpetion as you cannot reshape an ImageConcat object
Check class invariants.
These are the implementations of the LatticeIterator letters.
Example
IPosition shape(2, 10, 20);
PagedImage<Float> im1(shape, CoordinateUtil::defaultCoords2D(),
"tImageConcat_tmp1.img");
im1.set(1.0);
PagedImage<Float> im2(shape, CoordinateUtil::defaultCoords2D(),
"tImageConcat_tmp2.img");
im2.set(2.0);
// Make concatenator for axis 0
ImageConcat<Float> concat(0);
// Relax coordinate constraints
concat.setImage(im1, True);
concat.setImage(im2, True);
// Make output image and mask (if required, which it will be in this case)
PagedImage<Float> im3(concat.shape(), CoordinateUtil::defaultCoords2D(),
"tImageConcat_tmp3.img");
// Copy to output
im3.copyData(concat);
See tImageConcat.cc for more examples.
Motivation
Image concatentation is a useful enduser requirement.
To Do
Member Description
ImageConcat (uInt axis, Bool tempClose=True)
Constructor. Specify the pixel axis for concatenation
ImageConcat()
ImageConcat (const ImageConcat<T> &other)
virtual ~ImageConcat()
ImageConcat<T> &operator= (const ImageConcat<T> &other)
virtual ImageInterface<T>* cloneII() const
virtual String imageType() const
void setImage (ImageInterface<T>& image, Bool relax)
void setLattice (MaskedLattice<T>& lattice)
uInt nimages() const
uInt axis () const
uInt imageDim() const
virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
virtual void resync()
virtual void flush()
virtual void tempClose()
virtual void reopen()
virtual String name (Bool stripPath=False) const
virtual Bool isMasked() const
virtual Bool hasPixelMask() const
virtual const Lattice<Bool>& pixelMask() const
virtual Lattice<Bool>& pixelMask()
virtual const LatticeRegion* getRegionPtr() const
virtual Bool isWritable() const
virtual IPosition shape() const
virtual IPosition doNiceCursorShape (uInt maxPixels) const
virtual Bool doGetSlice (Array<T>& buffer, const Slicer& section)
virtual Bool doGetMaskSlice (Array<Bool>& buffer, const Slicer& section)
virtual void doPutSlice (const Array<T>& sourceBuffer, const IPosition& where, const IPosition& stride)
virtual void resize(const TiledShape&)
virtual Bool ok() const
virtual LatticeIterInterface<T> *makeIter (const T &navigator, Bool useRef) const
Double coordConvert(Int& worldAxis, LogIO& os, const CoordinateSystem& cSys, uInt axis, Double pixelCoord) const
void checkContiguous (Bool& isContig, Bool& warnContig, const IPosition& shape1, const CoordinateSystem& cSys1, const CoordinateSystem& cSys2, LogIO& os, uInt axis, Bool relax)
void checkNonConcatAxisCoordinates (Bool& warnRefPix, Bool& warnRefVal, Bool& warnInc, LogIO& os, const ImageInterface<T>& image, Bool relax)
Vector<Int> makeNewStokes(const Vector<Int>& stokes1, const Vector<Int>& stokes2)
void setCoordinates()