casa
5.7.0-16
|
Displays histograms of regions from an image. More...
#include <ImageHistograms.h>
Public Member Functions | |
ImageHistograms (const casacore::ImageInterface< T > &image, casacore::LogIO &os, casacore::Bool showProgress=true, casacore::Bool forceDisk=false) | |
Constructor takes the image and a casacore::LogIO object for logging. More... | |
ImageHistograms (const casacore::ImageInterface< T > &image, casacore::Bool showProgress=true, casacore::Bool forceDisk=false) | |
Constructor takes the image only. More... | |
ImageHistograms (const ImageHistograms< T > &other) | |
Copy constructor (copy semantics) More... | |
virtual | ~ImageHistograms () |
Destructor. More... | |
ImageHistograms< T > & | operator= (const ImageHistograms< T > &other) |
Assignment operator (copy semantics) More... | |
casacore::Bool | setNewImage (const casacore::ImageInterface< T > &image) |
Set a new image. More... | |
Public Member Functions inherited from casacore::LatticeHistograms< T > | |
LatticeHistograms (const MaskedLattice< T > &lattice, LogIO &os, Bool showProgress=True, Bool forceDisk=False) | |
Constructor takes the MaskedLattice and a LogIO object for logging. More... | |
LatticeHistograms (const MaskedLattice< T > &lattice, Bool showProgress=True, Bool forceDisk=False) | |
Constructor takes the MaskedLattice only. More... | |
LatticeHistograms (const LatticeHistograms< T > &other) | |
Copy constructor (copy semantics) More... | |
virtual | ~LatticeHistograms () |
Destructor. More... | |
LatticeHistograms< T > & | operator= (const LatticeHistograms< T > &other) |
Assignment operator (copy semantics) More... | |
Bool | setAxes (const Vector< Int > &cursorAxes) |
Set the cursor axes (0 relative). More... | |
Bool | setNBins (const uInt &nBins) |
Set the number of bins for the histogram. More... | |
Bool | setIncludeRange (const Vector< T > &include) |
Specify a pixel intensity range for which all pixels in that range are included. More... | |
Bool | setGaussian (const Bool &doGauss) |
Specify that a Gaussian overlay should be plotted on the histogram. More... | |
Bool | setForm (const Bool &doLog, const Bool &doCumu) |
Specify the form of the histogram. More... | |
Bool | setStatsList (const Bool &doList) |
This function allows you to control whether some statistics of the data that contributed to the histogram are written to the output stream. More... | |
Bool | setPlotting (PGPlotter &plotter, const Vector< Int > &nxy) |
This function sets the name of the PGPLOT plotting device and the number of subplots in x and y per page. More... | |
Bool | display () |
Display the histograms by plotting them. More... | |
void | closePlotting () |
CLose the plotter. More... | |
Vector< Int > | displayAxes () const |
Return the display axes. More... | |
Bool | getHistograms (Array< T > &values, Array< T > &counts) |
This function retrieves the histograms into Array . More... | |
Bool | getHistograms (Array< T > &values, Array< T > &counts, Array< Vector< T > > &stats) |
in this version, the set of stats for each histogram is also returned. More... | |
Bool | getHistogram (Vector< T > &values, Vector< T > &counts, const IPosition &pos, const Bool posInLattice=False) |
This function retrieves the histogram at the specified location into Vectors . More... | |
void | resetError () |
Reset argument error condition. More... | |
String | errorMessage () const |
Recover last error message. More... | |
Bool | setNewLattice (const MaskedLattice< T > &lattice) |
Set a MaskedLattice. More... | |
Private Member Functions | |
virtual casacore::String | writeCoordinates (const casacore::IPosition &histPos) const |
Make a string with pixel and world coordinates of display axes. More... | |
Private Attributes | |
casacore::LogIO | os_p |
const casacore::ImageInterface < T > * | pInImage_p |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::LatticeHistograms< T > | |
IPosition | locHistInLattice (const IPosition &histPosition, Bool relativeToParent=True) const |
Given a location in the histogram storage lattice, convert those locations on the non-histogram axis (the first one) relative to the parent or current lattice. More... | |
Protected Attributes inherited from casacore::LatticeHistograms< T > | |
LogIO | os_p |
These things are protected only so that they are available to ImageHistograms which inherits from LatticeHistograms. More... | |
Bool | goodParameterStatus_p |
Vector< Int > | cursorAxes_p |
Vector< Int > | displayAxes_p |
String | error_p |
Displays histograms of regions from an image.
Public interface
This is a class designed to display histograms from images
This class enable you to display and/or retrieve histograms evaluated over specified regions from an image. The dimension of the region is arbitrary, but the size of each dimension is always the size of the corresponding image axis. The histograms are displayed as a function of location of the axes not used to evaluate the histograms over. The axes which you evaluate the histograms over are called the cursor axes, the others are called the display axwes.
For example, consider an image cube (call the axes xyz or [0,1,2]). You could display histograms from xy planes (cursor axes [0,1]) as a function of z (display axes [2]). Or you could retrieve histograms from the z axis (cursor axes [2]) for each [x,y] location (display axes [0,1]).
The hard work is done by casacore::LatticeHistograms which this class (clumsily) inherits. It generates a "storage lattice" into which it writes the histograms. It is from this storage image that the plotting and retrieval arrays are drawn. The storage image is either in core or on disk depending upon its size (if > 10% of memory given by.aipsrc system.resources.memory then it goes into a disk-based casacore::PagedArray). If on disk, the storage image is deleted when the ImageHistograms
object destructs.
See casacore::LatticeHistograms for most of the useful public interface. ImageHistograms exists only so that it can write some world coordinate information to the plots and logger.
Tip: Note that for complex images, real and imaginary are treated independently; They are binned and plotted separately;
Tip: If you ignore return error statuses from the functions that set the state of the class, the internal status of the class is set to bad; This means it will just keep on returning error conditions until you explicitly recover the situation; A message describing the last error condition can be recovered with function errorMessage;
In this example, a casacore::PagedImage
is constructed. We set the cursor axes to be the y and z axes so we make a histogram of each yz plane as a function of x location on the device "/xs" (no longer supported) with 9 subplots per page. After the plotting we also retrieve the histograms into an array.
The generation of histograms from an image is a basic and necessary capability.
Definition at line 163 of file ImageHistograms.h.
casa::ImageHistograms< T >::ImageHistograms | ( | const casacore::ImageInterface< T > & | image, |
casacore::LogIO & | os, | ||
casacore::Bool | showProgress = true , |
||
casacore::Bool | forceDisk = false |
||
) |
Constructor takes the image and a casacore::LogIO
object for logging.
You can also specify whether you want to see progress meters or not. You can force the storage image to be disk based, otherwise the decision for core or disk is taken for you.
casa::ImageHistograms< T >::ImageHistograms | ( | const casacore::ImageInterface< T > & | image, |
casacore::Bool | showProgress = true , |
||
casacore::Bool | forceDisk = false |
||
) |
Constructor takes the image only.
In the absence of a logger you get no messages. This includes error messages and potential listing of statistics. You can specify whether you want to see progress meters or not. You can force the storage image to be disk based, otherwise the decision for core or disk is taken for you.
casa::ImageHistograms< T >::ImageHistograms | ( | const ImageHistograms< T > & | other | ) |
Copy constructor (copy semantics)
|
virtual |
Destructor.
ImageHistograms<T>& casa::ImageHistograms< T >::operator= | ( | const ImageHistograms< T > & | other | ) |
Assignment operator (copy semantics)
casacore::Bool casa::ImageHistograms< T >::setNewImage | ( | const casacore::ImageInterface< T > & | image | ) |
Set a new image.
A return value of false
indicates the image had an invalid type or that the internal status of the class is bad.
|
privatevirtual |
Make a string with pixel and world coordinates of display axes.
Reimplemented from casacore::LatticeHistograms< T >.
|
private |
Definition at line 198 of file ImageHistograms.h.
|
private |
Definition at line 199 of file ImageHistograms.h.