Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxIndxHisto.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *  Author(s):
00006  *  Jan-Mark Geusebroek (mark@wins.uva.nl)
00007  *
00008  */
00009 
00010 #ifndef HxIndxHisto_H
00011 #define HxIndxHisto_H
00012 
00013 #include "HxIndxArray.h"
00014 #include "HxHistoList.h"
00015 
00016 
00017 template<class HeaderT>
00018 class IndxHistHeaderT {
00019     public:
00020         friend STD_OSTREAM& operator<<(STD_OSTREAM& os,
00021             const IndxHistHeaderT& l)
00022                 {return os << l.bins << " bins, " << l.chans <<
00023                     ((l.chans == 1) ?  HxString(" channel") :
00024                         HxString(" channels"));}
00025     int     bins;
00026     int     chans;
00027     HeaderT header;
00028 };
00029 
00030 template<class HeaderT>
00031 class indexedHisto : public indexedArray<float, IndxHistHeaderT<HeaderT> >  {
00032 public:
00033     void create(HxString indexFile, HeaderT header);
00034     void        add(HxString& key, HxHistoList& l); 
00035     void        search(HxHistoList& target, int n = 10, int refine = 0);
00036 
00037     int         bins() const;
00038     int         chans() const;
00039     HeaderT     header() const;
00040 
00041     friend STD_OSTREAM& operator<<(STD_OSTREAM& os,
00042         const indexedHisto& l)
00043             {return l.put(os);}
00044 
00045     int         arraySize(const IndxHistHeaderT<HeaderT>& header) const
00046                     {return header.bins*header.chans;}
00047 
00048     virtual double      compare(float *e1, float *e2,
00049                     const IndxHistHeaderT<HeaderT>& header) const;
00050 
00051 private:
00052     int         _create;
00053     HeaderT     _header;
00054 };
00055 
00056 
00057 #ifdef INC_TEMPLATE_SRC
00058 #include "HxIndxHisto.c"
00059 #endif
00060 
00061 #endif

Generated on Mon Jan 27 15:48:45 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001