#include <ImageFactory.h>
Public Types | |
enum | ComplexToFloatFunction { REAL, IMAG } |
Static methods for creating images. More... | |
Public Member Functions | |
ImageFactory () | |
~ImageFactory () | |
Static Public Member Functions | |
template<class T > | |
static SPIIT | createImage (const String &outfile, const CoordinateSystem &cSys, const IPosition &shape, Bool log, Bool overwrite, const std::vector< std::pair< LogOrigin, String > > *const &msgs) |
Create a TempImage if outfile is empty, otherwise a PagedImage. | |
static String | className () |
static SPIIF | floatImageFromShape (const String &outfile, const Vector< Int > &shape, const Record &csys, Bool linear=True, Bool overwrite=False, Bool verbose=True, const std::vector< std::pair< LogOrigin, String > > *const &msgs=0) |
create an image with the specified shape and specified coordinate system. | |
static SPIIC | complexImageFromShape (const String &outfile, const Vector< Int > &shape, const Record &csys, Bool linear=True, Bool overwrite=False, Bool verbose=True, const std::vector< std::pair< LogOrigin, String > > *const &msgs=0) |
static std::pair< SPIIF, SPIIC > | fromImage (const String &outfile, const String &infile, const Record ®ion, const String &mask, Bool dropdeg=False, Bool overwrite=False) |
only the pointer of the correct data type will be valid, the other will be null. | |
template<class T > | |
static SPIIT | imageFromArray (const String &outfile, const Array< T > &pixels, const Record &csys, Bool linear=False, Bool overwrite=False, Bool verbose=True, const vector< std::pair< LogOrigin, String > > *const &msgs=0) |
static SPIIF | fromASCII (const String &outfile, const String &infile, const IPosition &shape, const String &sep, const Record &csys, const Bool linear, const Bool overwrite) |
static SHARED_PTR< TempImage < Float > > | floatFromComplex (SPCIIC complexImage, ComplexToFloatFunction func) |
Create a float-valued image from a complex-valued image. | |
static SHARED_PTR< TempImage < Complex > > | complexFromFloat (SPCIIF realPart, const Array< Float > &imagPart) |
Create a complex-valued image from a float-valued image (real part) and float-valued array (imaginary part). | |
static SPIIC | makeComplex (SPCIIF realPart, SPCIIF imagPart, const String &outfile, const Record ®ion, Bool overwrite=False) |
Create a complex-valued image from a float-valued image (real part) and float-valued array (imaginary part). | |
static std::pair< SPIIF, SPIIC > | fromFile (const String &filename) |
exactly one of the pointers will not be null, indicating the pixel data type | |
static SPIIF | fromFITS (const String &outfile, const String &fitsfile, const Int whichrep, const Int whichhdu, const Bool zeroBlanks, const Bool overwrite) |
static std::pair< SPIIF, SPIIC > | fromRecord (const RecordInterface &rec, const String &imagename="") |
template<class T > | |
static void | remove (SPIIT &image, Bool verbose) |
static void | rename (SPIIF &image, const String &name, const Bool overwrite) |
if successful, image will be reset to point to new image upon return | |
static void | rename (SPIIC &image, const String &name, const Bool overwrite) |
static SPIIF | testImage (const String &outfile, const Bool overwrite, const String &imagetype="2d") |
open a canonical image | |
static void | toASCII (SPCIIF image, const String &outfile, Record ®ion, const String &mask, const String &sep=" ", const String &format="%e", Double maskvalue=-999, Bool overwrite=False, Bool extendMask=False) |
static void | toFITS (SPCIIF image, const String &outfile, Bool velocity, Bool optical, Int bitpix, Double minpix, Double maxpix, const Record ®ion, const String &mask, Bool overwrite=False, Bool dropdeg=False, Bool deglast=False, Bool dropstokes=False, Bool stokeslast=False, Bool wavelength=False, Bool airWavelength=False, const String &origin="", Bool stretch=False, Bool history=True) |
Static Private Member Functions | |
template<class T > | |
static SPIIT | _fromShape (const String &outfile, const Vector< Int > &shape, const Record &csys, Bool linear, Bool overwrite, Bool verbose, const std::vector< std::pair< LogOrigin, String > > *const &msgs) |
template<class T > | |
static SPIIT | _fromRecord (const RecordInterface &rec, const String &name) |
static void | _centerRefPix (CoordinateSystem &csys, const IPosition &shape) |
static void | _checkInfile (const String &infile) |
static CoordinateSystem * | _makeCoordinateSystem (const casa::Record &cSys, const casa::IPosition &shape) |
Convert a Record to a CoordinateSystem. | |
static void | _checkOutfile (const String &outfile, Bool overwrite) |
static std::pair< SPIIF, SPIIC > | _fromLatticeBase (std::unique_ptr< LatticeBase > &latt) |
template<class T > | |
static std::pair< SPIIF, SPIIC > | _rename (SPIIT &image, const String &name, const Bool overwrite) |
if successful, image will point to the newly named image upone return |
Definition at line 50 of file ImageFactory.h.
Static methods for creating images.
Definition at line 69 of file ImageFactory.h.
casa::ImageFactory::ImageFactory | ( | ) |
casa::ImageFactory::~ImageFactory | ( | ) | [inline] |
Definition at line 76 of file ImageFactory.h.
static void casa::ImageFactory::_centerRefPix | ( | CoordinateSystem & | csys, | |
const IPosition & | shape | |||
) | [static, private] |
static void casa::ImageFactory::_checkInfile | ( | const String & | infile | ) | [static, private] |
static void casa::ImageFactory::_checkOutfile | ( | const String & | outfile, | |
Bool | overwrite | |||
) | [static, private] |
static std::pair<SPIIF, SPIIC> casa::ImageFactory::_fromLatticeBase | ( | std::unique_ptr< LatticeBase > & | latt | ) | [static, private] |
static SPIIT casa::ImageFactory::_fromRecord | ( | const RecordInterface & | rec, | |
const String & | name | |||
) | [inline, static, private] |
static SPIIT casa::ImageFactory::_fromShape | ( | const String & | outfile, | |
const Vector< Int > & | shape, | |||
const Record & | csys, | |||
Bool | linear, | |||
Bool | overwrite, | |||
Bool | verbose, | |||
const std::vector< std::pair< LogOrigin, String > > *const & | msgs | |||
) | [inline, static, private] |
static CoordinateSystem* casa::ImageFactory::_makeCoordinateSystem | ( | const casa::Record & | cSys, | |
const casa::IPosition & | shape | |||
) | [static, private] |
Convert a Record to a CoordinateSystem.
static std::pair<SPIIF, SPIIC> casa::ImageFactory::_rename | ( | SPIIT & | image, | |
const String & | name, | |||
const Bool | overwrite | |||
) | [inline, static, private] |
if successful, image will point to the newly named image upone return
static String casa::ImageFactory::className | ( | ) | [inline, static] |
Definition at line 88 of file ImageFactory.h.
References String.
static SHARED_PTR<TempImage<Complex> > casa::ImageFactory::complexFromFloat | ( | SPCIIF | realPart, | |
const Array< Float > & | imagPart | |||
) | [static] |
Create a complex-valued image from a float-valued image (real part) and float-valued array (imaginary part).
All metadata is copied from the real image and pixel values are initialized to realPart + i*complexPart
static SPIIC casa::ImageFactory::complexImageFromShape | ( | const String & | outfile, | |
const Vector< Int > & | shape, | |||
const Record & | csys, | |||
Bool | linear = True , |
|||
Bool | overwrite = False , |
|||
Bool | verbose = True , |
|||
const std::vector< std::pair< LogOrigin, String > > *const & | msgs = 0 | |||
) | [static] |
static SPIIT casa::ImageFactory::createImage | ( | const String & | outfile, | |
const CoordinateSystem & | cSys, | |||
const IPosition & | shape, | |||
Bool | log, | |||
Bool | overwrite, | |||
const std::vector< std::pair< LogOrigin, String > > *const & | msgs | |||
) | [inline, static] |
Create a TempImage if outfile is empty, otherwise a PagedImage.
If log is True, log useful messages, quiet if False. Created image has all pixel values set to zero and is unmasked.
static SHARED_PTR<TempImage<Float> > casa::ImageFactory::floatFromComplex | ( | SPCIIC | complexImage, | |
ComplexToFloatFunction | func | |||
) | [static] |
Create a float-valued image from a complex-valued image.
All metadata is copied and pixel values are initialized according to func
.
static SPIIF casa::ImageFactory::floatImageFromShape | ( | const String & | outfile, | |
const Vector< Int > & | shape, | |||
const Record & | csys, | |||
Bool | linear = True , |
|||
Bool | overwrite = False , |
|||
Bool | verbose = True , |
|||
const std::vector< std::pair< LogOrigin, String > > *const & | msgs = 0 | |||
) | [static] |
create an image with the specified shape and specified coordinate system.
If outfile is blank, the returned object is a TempImage, PagedImage otherwise. If csys is empty, a default coordiante system is attached to the image, and if linear is True, it has linear coordinates in place of the direction coordinate.
static SPIIF casa::ImageFactory::fromASCII | ( | const String & | outfile, | |
const String & | infile, | |||
const IPosition & | shape, | |||
const String & | sep, | |||
const Record & | csys, | |||
const Bool | linear, | |||
const Bool | overwrite | |||
) | [static] |
static std::pair<SPIIF, SPIIC> casa::ImageFactory::fromFile | ( | const String & | filename | ) | [static] |
exactly one of the pointers will not be null, indicating the pixel data type
static SPIIF casa::ImageFactory::fromFITS | ( | const String & | outfile, | |
const String & | fitsfile, | |||
const Int | whichrep, | |||
const Int | whichhdu, | |||
const Bool | zeroBlanks, | |||
const Bool | overwrite | |||
) | [static] |
static std::pair<SPIIF, SPIIC> casa::ImageFactory::fromImage | ( | const String & | outfile, | |
const String & | infile, | |||
const Record & | region, | |||
const String & | mask, | |||
Bool | dropdeg = False , |
|||
Bool | overwrite = False | |||
) | [static] |
only the pointer of the correct data type will be valid, the other will be null.
static std::pair<SPIIF, SPIIC> casa::ImageFactory::fromRecord | ( | const RecordInterface & | rec, | |
const String & | imagename = "" | |||
) | [static] |
static SPIIT casa::ImageFactory::imageFromArray | ( | const String & | outfile, | |
const Array< T > & | pixels, | |||
const Record & | csys, | |||
Bool | linear = False , |
|||
Bool | overwrite = False , |
|||
Bool | verbose = True , |
|||
const vector< std::pair< LogOrigin, String > > *const & | msgs = 0 | |||
) | [inline, static] |
static SPIIC casa::ImageFactory::makeComplex | ( | SPCIIF | realPart, | |
SPCIIF | imagPart, | |||
const String & | outfile, | |||
const Record & | region, | |||
Bool | overwrite = False | |||
) | [static] |
Create a complex-valued image from a float-valued image (real part) and float-valued array (imaginary part).
All metadata is copied from the real image and pixel values are initialized to realPart + i*complexPart
static void casa::ImageFactory::remove | ( | SPIIT & | image, | |
Bool | verbose | |||
) | [inline, static] |
static void casa::ImageFactory::rename | ( | SPIIC & | image, | |
const String & | name, | |||
const Bool | overwrite | |||
) | [static] |
static void casa::ImageFactory::rename | ( | SPIIF & | image, | |
const String & | name, | |||
const Bool | overwrite | |||
) | [static] |
if successful, image will be reset to point to new image upon return
static SPIIF casa::ImageFactory::testImage | ( | const String & | outfile, | |
const Bool | overwrite, | |||
const String & | imagetype = "2d" | |||
) | [static] |
open a canonical image
static void casa::ImageFactory::toASCII | ( | SPCIIF | image, | |
const String & | outfile, | |||
Record & | region, | |||
const String & | mask, | |||
const String & | sep = " " , |
|||
const String & | format = "%e" , |
|||
Double | maskvalue = -999 , |
|||
Bool | overwrite = False , |
|||
Bool | extendMask = False | |||
) | [static] |
static void casa::ImageFactory::toFITS | ( | SPCIIF | image, | |
const String & | outfile, | |||
Bool | velocity, | |||
Bool | optical, | |||
Int | bitpix, | |||
Double | minpix, | |||
Double | maxpix, | |||
const Record & | region, | |||
const String & | mask, | |||
Bool | overwrite = False , |
|||
Bool | dropdeg = False , |
|||
Bool | deglast = False , |
|||
Bool | dropstokes = False , |
|||
Bool | stokeslast = False , |
|||
Bool | wavelength = False , |
|||
Bool | airWavelength = False , |
|||
const String & | origin = "" , |
|||
Bool | stretch = False , |
|||
Bool | history = True | |||
) | [static] |