casa::ImageTask< T > Class Template Reference

#include <ImageTask.h>

Inheritance diagram for casa::ImageTask< T >:
casa::Image1DSmoother< T > casa::Image2DConvolver< T > casa::ImageCollapser< T > casa::ImageConcatenator< T > casa::ImageConvolverTask< T > casa::ImageCropper< T > casa::ImageDecimator< T > casa::ImageDecomposerTask< T > casa::ImageFFTer< T > casa::ImageMaskedPixelReplacer< T > casa::ImageMaxFitter< T > casa::ImageMomentsTask< T > casa::ImageRebinner< T > casa::ImageRegridderBase< T > casa::ImageSourceFinder< T > casa::PixelValueManipulator< T > casa::SepImageConvolverTask< T > casa::TwoPointCorrelator< T >

List of all members.

Public Types

enum  Verbosity {
  QUIET,
  WHISPER,
  LOW,
  NORMAL,
  HIGH,
  NOISY,
  DEAFENING
}
 

Virtual base class for image analysis tasks.

More...

Public Member Functions

virtual ~ImageTask ()
virtual String getClass () const =0
void setStretch (const Bool stretch)
void setLogfile (const String &lf)
 tacitly does nothing if lf is the empty string.
void setLogfileAppend (const Bool a)
void setRegion (const Record &region)
void setMask (const String &mask)
void setVerbosity (Verbosity verbosity)
void addHistory (const vector< std::pair< String, String > > &msgs) const
 These messages will appear in the product image history upon the call to _prepareOutputImage().
void addHistory (const LogOrigin &origin, const String &msg) const
void addHistory (const LogOrigin &origin, const vector< String > &msgs) const
void addHistory (const LogOrigin &origin, const String &taskname, const vector< String > &paramNames, const vector< casac::variant > &paramValues) const
 This adds standard history messages regarding the task that was run and input parameters used.
void suppressHistoryWriting (Bool b)
 suppress writing the history on _prepareOutputImage() call.
vector< std::pair< String,
String > > 
getHistory ()
 get the history associated with the task.
void setDropDegen (Bool d)

Protected Member Functions

 ImageTask (const SPCIIT image, const String &region, const Record *const &regionPtr, const String &box, const String &chanInp, const String &stokes, const String &maskInp, const String &outname, Bool overwrite)
 if outname is empty, no image will be written if overwrite is True, if image already exists it will be removed if overwrite is False, if image already exists exception will be thrown
 ImageTask (const SPCIIT image, const Record *const &regionPtr, const String &mask, const String &outname, Bool overwrite)
virtual
CasacRegionManager::StokesControl 
_getStokesControl () const =0
virtual std::vector
< OutputDestinationChecker::OutputStruct
_getOutputStruct ()
virtual void _construct (Bool verbose=True)
 does the lion's share of constructing the object, ie checks validity of inputs, etc.
const SPCIIT _getImage () const
const String & _getMask () const
const Record * _getRegion () const
void _setStokes (const String &stokes)
const String & _getStokes () const
const String & _getChans () const
const String & _getOutname () const
virtual std::vector
< Coordinate::Type > 
_getNecessaryCoordinates () const =0
 Represents the minimum set of coordinates necessary for the task to function.
void _removeExistingOutfileIfNecessary () const
void _removeExistingFileIfNecessary (const String &filename, const Bool overwrite, Bool warnOnly=False) const
 if warnOnly is True, log a warning message if file exists and overwrite is True, else throw an exception.
String _summaryHeader () const
const SHARED_PTR< LogIO > _getLog () const
virtual Bool _hasLogfileSupport () const
 by default, derived classes are configured to have no log file support.
Bool _getStretch () const
const SHARED_PTR< LogFile_getLogFile () const
Bool _writeLogfile (const String &output, const Bool open=True, const Bool close=True)
Bool _openLogfile ()
void _closeLogfile () const
virtual Bool _supportsMultipleRegions () const
virtual Bool _supportsMultipleBeams () const
 does this task support images with multiple beams? False means it never does.
SPIIT _prepareOutputImage (const ImageInterface< T > &image, const Array< T > *const values, const ArrayLattice< Bool > *const mask=nullptr, const IPosition *const outShape=nullptr, const CoordinateSystem *const coordsys=nullptr, const String *const outname=nullptr, Bool overwrite=False, Bool dropDegen=False) const
 If outname != NULL, use the value supplied.
SPIIT _prepareOutputImage (const ImageInterface< T > &image, Bool dropDegen=False) const
SPIIT _prepareOutputImage (const ImageInterface< T > &image, const String &outname, Bool overwrite, Bool warnOnly) const
 if warnOnly is True, only log a warning message if the file exists and overwrite is True, else throw an excepction
SPIIT _prepareOutputImage (const ImageInterface< T > &image, const Lattice< T > &data) const
 data are copied to the output image from the data lattice.
Verbosity _getVerbosity () const
Bool _getOverwrite () const
virtual Bool _mustHaveSquareDirectionPixels () const
Bool _getDropDegen () const
template<class U >
void _doHistory (SHARED_PTR< ImageInterface< U >> &image) const

Static Protected Member Functions

static void _copyMask (Lattice< Bool > &mask, const ImageInterface< T > &image)
static void _copyData (Lattice< T > &data, const ImageInterface< T > &image)

Private Attributes

const SPCIIT _image
SHARED_PTR< LogIO > _log
const Record *const _regionPtr
Record _regionRecord
String _region
String _box
String _chan
String _stokesString
String _mask
String _outname
Bool _overwrite
Bool _stretch
Bool _logfileAppend
Bool _suppressHistory
Bool _dropDegen
std::unique_ptr< FiledesIO > _logFileIO
Verbosity _verbosity
SHARED_PTR< LogFile_logfile
vector< std::pair< String,
String > > 
_newHistory
C11Timer _timer

Detailed Description

template<class T>
class casa::ImageTask< T >

Definition at line 22 of file ImageTask.h.


Member Enumeration Documentation

template<class T>
enum casa::ImageTask::Verbosity

Virtual base class for image analysis tasks.

Etymology

Image tasking

Synopsis

Virtual base class for image tasking. verbosity levels

Enumerator:
QUIET 
WHISPER 
LOW 
NORMAL 
HIGH 
NOISY 
DEAFENING 

Definition at line 45 of file ImageTask.h.


Constructor & Destructor Documentation

template<class T>
virtual casa::ImageTask< T >::~ImageTask (  )  [virtual]
template<class T>
casa::ImageTask< T >::ImageTask ( const SPCIIT  image,
const String &  region,
const Record *const &  regionPtr,
const String &  box,
const String &  chanInp,
const String &  stokes,
const String &  maskInp,
const String &  outname,
Bool  overwrite 
) [protected]

if outname is empty, no image will be written if overwrite is True, if image already exists it will be removed if overwrite is False, if image already exists exception will be thrown

template<class T>
casa::ImageTask< T >::ImageTask ( const SPCIIT  image,
const Record *const &  regionPtr,
const String &  mask,
const String &  outname,
Bool  overwrite 
) [protected]

Member Function Documentation

template<class T>
void casa::ImageTask< T >::_closeLogfile (  )  const [protected]
template<class T>
virtual void casa::ImageTask< T >::_construct ( Bool  verbose = True  )  [protected, virtual]

does the lion's share of constructing the object, ie checks validity of inputs, etc.

template<class T>
static void casa::ImageTask< T >::_copyData ( Lattice< T > &  data,
const ImageInterface< T > &  image 
) [static, protected]
template<class T>
static void casa::ImageTask< T >::_copyMask ( Lattice< Bool > &  mask,
const ImageInterface< T > &  image 
) [static, protected]
template<class T>
template<class U >
void casa::ImageTask< T >::_doHistory ( SHARED_PTR< ImageInterface< U >> &  image  )  const [inline, protected]
template<class T>
const String& casa::ImageTask< T >::_getChans (  )  const [inline, protected]

Definition at line 140 of file ImageTask.h.

template<class T>
Bool casa::ImageTask< T >::_getDropDegen (  )  const [inline, protected]

Definition at line 223 of file ImageTask.h.

template<class T>
const SPCIIT casa::ImageTask< T >::_getImage (  )  const [inline, protected]

Definition at line 130 of file ImageTask.h.

template<class T>
const SHARED_PTR<LogIO> casa::ImageTask< T >::_getLog (  )  const [inline, protected]

Definition at line 158 of file ImageTask.h.

template<class T>
const SHARED_PTR<LogFile> casa::ImageTask< T >::_getLogFile (  )  const [protected]
template<class T>
const String& casa::ImageTask< T >::_getMask (  )  const [inline, protected]

Definition at line 132 of file ImageTask.h.

template<class T>
virtual std::vector<Coordinate::Type> casa::ImageTask< T >::_getNecessaryCoordinates (  )  const [protected, pure virtual]
template<class T>
const String& casa::ImageTask< T >::_getOutname (  )  const [inline, protected]

Definition at line 142 of file ImageTask.h.

template<class T>
virtual std::vector<OutputDestinationChecker::OutputStruct> casa::ImageTask< T >::_getOutputStruct (  )  [protected, virtual]
template<class T>
Bool casa::ImageTask< T >::_getOverwrite (  )  const [inline, protected]

Definition at line 219 of file ImageTask.h.

template<class T>
const Record* casa::ImageTask< T >::_getRegion (  )  const [inline, protected]

Definition at line 134 of file ImageTask.h.

template<class T>
const String& casa::ImageTask< T >::_getStokes (  )  const [inline, protected]

Definition at line 138 of file ImageTask.h.

template<class T>
virtual CasacRegionManager::StokesControl casa::ImageTask< T >::_getStokesControl (  )  const [protected, pure virtual]
template<class T>
Bool casa::ImageTask< T >::_getStretch (  )  const [inline, protected]

Definition at line 164 of file ImageTask.h.

template<class T>
Verbosity casa::ImageTask< T >::_getVerbosity (  )  const [inline, protected]

Definition at line 217 of file ImageTask.h.

template<class T>
virtual Bool casa::ImageTask< T >::_hasLogfileSupport (  )  const [inline, protected, virtual]

by default, derived classes are configured to have no log file support.

Reimplemented in casa::ImageFitter, casa::ImageProfileFitter, casa::ImageStatsCalculator, and casa::PixelValueManipulator< T >.

Definition at line 162 of file ImageTask.h.

template<class T>
virtual Bool casa::ImageTask< T >::_mustHaveSquareDirectionPixels (  )  const [inline, protected, virtual]

Reimplemented in casa::PVGenerator.

Definition at line 221 of file ImageTask.h.

template<class T>
Bool casa::ImageTask< T >::_openLogfile (  )  [protected]
template<class T>
SPIIT casa::ImageTask< T >::_prepareOutputImage ( const ImageInterface< T > &  image,
const Lattice< T > &  data 
) const [protected]

data are copied to the output image from the data lattice.

The mask is copied from the input image.

template<class T>
SPIIT casa::ImageTask< T >::_prepareOutputImage ( const ImageInterface< T > &  image,
const String &  outname,
Bool  overwrite,
Bool  warnOnly 
) const [protected]

if warnOnly is True, only log a warning message if the file exists and overwrite is True, else throw an excepction

template<class T>
SPIIT casa::ImageTask< T >::_prepareOutputImage ( const ImageInterface< T > &  image,
Bool  dropDegen = False 
) const [protected]
template<class T>
SPIIT casa::ImageTask< T >::_prepareOutputImage ( const ImageInterface< T > &  image,
const Array< T > *const   values,
const ArrayLattice< Bool > *const   mask = nullptr,
const IPosition *const   outShape = nullptr,
const CoordinateSystem *const   coordsys = nullptr,
const String *const   outname = nullptr,
Bool  overwrite = False,
Bool  dropDegen = False 
) const [protected]

If outname != NULL, use the value supplied.

If is NULL, use the value of _outname. Create a TempImage or PagedImage depending if outname/_outname is empty or not. Generally meant for the image to be returned to the UI or the final image product that the user will want. values=0 => the pixel values from the image will be used mask=0 => the mask attached to the image, if any will be used, outShape=0 => use image shape, coordsys=0 => use image coordinate system. overwrite is only used if outname != NULL.

SPIIT _prepareOutputImage(const ImageInterface<T>& image) const;

template<class T>
void casa::ImageTask< T >::_removeExistingFileIfNecessary ( const String &  filename,
const Bool  overwrite,
Bool  warnOnly = False 
) const [protected]

if warnOnly is True, log a warning message if file exists and overwrite is True, else throw an exception.

template<class T>
void casa::ImageTask< T >::_removeExistingOutfileIfNecessary (  )  const [protected]
template<class T>
void casa::ImageTask< T >::_setStokes ( const String &  stokes  )  [inline, protected]

Definition at line 136 of file ImageTask.h.

template<class T>
String casa::ImageTask< T >::_summaryHeader (  )  const [protected]
template<class T>
virtual Bool casa::ImageTask< T >::_supportsMultipleBeams (  )  const [inline, protected, virtual]

does this task support images with multiple beams? False means it never does.

True means it does, but not necessarily in all cases (in which case, the derived class is responsible for checking for and throwing exceptions in those cases).

Reimplemented in casa::Image1DSmoother< T >, casa::ImageDecimator< T >, casa::ImageDecomposerTask< T >, casa::ImageMaxFitter< T >, casa::ImageMomentsTask< T >, casa::ImageSourceFinder< T >, and casa::TwoPointCorrelator< T >.

Definition at line 182 of file ImageTask.h.

template<class T>
virtual Bool casa::ImageTask< T >::_supportsMultipleRegions (  )  const [inline, protected, virtual]
template<class T>
Bool casa::ImageTask< T >::_writeLogfile ( const String &  output,
const Bool  open = True,
const Bool  close = True 
) [protected]
template<class T>
void casa::ImageTask< T >::addHistory ( const LogOrigin &  origin,
const String &  taskname,
const vector< String > &  paramNames,
const vector< casac::variant > &  paramValues 
) const

This adds standard history messages regarding the task that was run and input parameters used.

The vectors must have the same length

template<class T>
void casa::ImageTask< T >::addHistory ( const LogOrigin &  origin,
const vector< String > &  msgs 
) const
template<class T>
void casa::ImageTask< T >::addHistory ( const LogOrigin &  origin,
const String &  msg 
) const
template<class T>
void casa::ImageTask< T >::addHistory ( const vector< std::pair< String, String > > &  msgs  )  const

These messages will appear in the product image history upon the call to _prepareOutputImage().

They will be located immediately after the input image's copied history. The first value in the pair is the log origin. The second is the associated message. If this method is called more than once on the same object, messages from subsequent calls are appended to the end of messages set in prior calls.

template<class T>
virtual String casa::ImageTask< T >::getClass (  )  const [pure virtual]
template<class T>
vector<std::pair<String, String> > casa::ImageTask< T >::getHistory (  )  [inline]

get the history associated with the task.

Does not include the history of the input image.

Definition at line 97 of file ImageTask.h.

template<class T>
void casa::ImageTask< T >::setDropDegen ( Bool  d  )  [inline]

Definition at line 99 of file ImageTask.h.

template<class T>
void casa::ImageTask< T >::setLogfile ( const String &  lf  ) 

tacitly does nothing if lf is the empty string.

template<class T>
void casa::ImageTask< T >::setLogfileAppend ( const Bool  a  ) 
template<class T>
void casa::ImageTask< T >::setMask ( const String &  mask  )  [inline]

Definition at line 68 of file ImageTask.h.

template<class T>
void casa::ImageTask< T >::setRegion ( const Record &  region  ) 
template<class T>
void casa::ImageTask< T >::setStretch ( const Bool  stretch  )  [inline]

Definition at line 59 of file ImageTask.h.

template<class T>
void casa::ImageTask< T >::setVerbosity ( Verbosity  verbosity  )  [inline]

Definition at line 70 of file ImageTask.h.

template<class T>
void casa::ImageTask< T >::suppressHistoryWriting ( Bool  b  )  [inline]

suppress writing the history on _prepareOutputImage() call.

Useful for not writing history to intermediate image products.

Definition at line 93 of file ImageTask.h.


Member Data Documentation

template<class T>
String casa::ImageTask< T >::_box [private]

Definition at line 237 of file ImageTask.h.

template<class T>
String casa::ImageTask< T >::_chan [private]

Definition at line 238 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::_getChans().

template<class T>
Bool casa::ImageTask< T >::_dropDegen [private]
template<class T>
const SPCIIT casa::ImageTask< T >::_image [private]
template<class T>
SHARED_PTR<LogIO> casa::ImageTask< T >::_log [mutable, private]

Definition at line 233 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::_getLog().

template<class T>
SHARED_PTR<LogFile> casa::ImageTask< T >::_logfile [private]

Definition at line 249 of file ImageTask.h.

template<class T>
Bool casa::ImageTask< T >::_logfileAppend [private]

Definition at line 244 of file ImageTask.h.

template<class T>
std::unique_ptr<FiledesIO> casa::ImageTask< T >::_logFileIO [private]

Definition at line 247 of file ImageTask.h.

template<class T>
String casa::ImageTask< T >::_mask [private]
template<class T>
vector<std::pair<String, String> > casa::ImageTask< T >::_newHistory [mutable, private]

Definition at line 250 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::getHistory().

template<class T>
String casa::ImageTask< T >::_outname [private]

Definition at line 241 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::_getOutname().

template<class T>
Bool casa::ImageTask< T >::_overwrite [private]

Reimplemented in casa::ImageProfileFitter.

Definition at line 242 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::_getOverwrite().

template<class T>
String casa::ImageTask< T >::_region [private]

Definition at line 236 of file ImageTask.h.

template<class T>
const Record* const casa::ImageTask< T >::_regionPtr [private]

Definition at line 234 of file ImageTask.h.

template<class T>
Record casa::ImageTask< T >::_regionRecord [private]

Definition at line 235 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::_getRegion().

template<class T>
String casa::ImageTask< T >::_stokesString [private]
template<class T>
Bool casa::ImageTask< T >::_stretch [private]
template<class T>
Bool casa::ImageTask< T >::_suppressHistory [private]

Definition at line 245 of file ImageTask.h.

Referenced by casa::ImageTask< Complex >::suppressHistoryWriting().

template<class T>
C11Timer casa::ImageTask< T >::_timer [mutable, private]

Definition at line 252 of file ImageTask.h.

template<class T>
Verbosity casa::ImageTask< T >::_verbosity [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1