image cache to compute a running min/max More...
#include <Image/ImageCache.H>
Public Member Functions | |
ImageCacheMinMax () | |
Uninitialized constructor. | |
ImageCacheMinMax (uint maxSize) | |
Constructor. | |
Image< T > | getMax () const |
return the max of the images currently in the cache | |
Image< T > | getMin () const |
return the max of the images currently in the cache | |
Protected Member Functions | |
virtual void | doWhenAdd (const Image< T > &img) |
called when an image is added - here it's a nop-op | |
virtual void | doWhenRemove (const Image< T > &img) |
called when an image is removed - here it's a no-op |
image cache to compute a running min/max
In this implementation, all the computations are done when getMax() or getMin() are called. That is, the cache is fairly dump and does not attempt to keep an updated min and max image as new images get added or removed. This differs substantially from the ImageCacheAvg implementation, where all computations are done as images are added/removed and getting the mean is a very cheap operation.
Definition at line 173 of file ImageCache.H.
ImageCacheMinMax< T >::ImageCacheMinMax | ( | ) | [inline] |
Uninitialized constructor.
By default, cache size is not limited. A limit can be set later using setMaxSize().
Definition at line 236 of file ImageCache.C.
ImageCacheMinMax< T >::ImageCacheMinMax | ( | uint | maxSize | ) | [inline] |
Constructor.
maxSize | the maximum size of the cache. If this size is exceeded, images are popped off the front of the cache and disregarded for the computation of the mean. If maxSize = 0, the cache is not limited. |
Definition at line 242 of file ImageCache.C.
void ImageCacheMinMax< T >::doWhenAdd | ( | const Image< T > & | img | ) | [inline, protected, virtual] |
called when an image is added - here it's a nop-op
Reimplemented from ImageCache< T >.
Definition at line 272 of file ImageCache.C.
void ImageCacheMinMax< T >::doWhenRemove | ( | const Image< T > & | img | ) | [inline, protected, virtual] |
called when an image is removed - here it's a no-op
Reimplemented from ImageCache< T >.
Definition at line 277 of file ImageCache.C.
Image< T > ImageCacheMinMax< T >::getMax | ( | ) | const [inline] |
return the max of the images currently in the cache
Definition at line 248 of file ImageCache.C.
References ImageCache< T >::itsCache, and takeMax().
Referenced by SimulationViewerEyeHand::getTraj(), SimulationViewerEyeRegion::getTraj(), and SimulationViewerEyeMvt::getTraj().
Image< T > ImageCacheMinMax< T >::getMin | ( | ) | const [inline] |
return the max of the images currently in the cache
Definition at line 260 of file ImageCache.C.
References ImageCache< T >::itsCache, and takeMin().
Referenced by TaskRelevanceMapKillN::integrate().