00001 #ifndef Impala_Core_Histogram_MakeHistogram1d_h
00002 #define Impala_Core_Histogram_MakeHistogram1d_h
00003 
00004 #include "Core/Histogram/Histogram1dTem.h"
00005 
00006 
00007 #include "Core/Array/MakeRoi.h"
00008 #include "Core/Histogram/TraitInOutHistogram1d.h"
00009 
00010 #include "Core/Array/Pattern/PatInOutOp.h"
00011 
00012 namespace Impala
00013 {
00014 namespace Core
00015 {
00016 namespace Histogram
00017 {
00018 
00019 template<class HistT, class ArrayT>
00020 void
00021 MakeHistogram1d(HistT* hist, ArrayT* im)
00022 {
00023     
00024     
00025     hist->Clear();
00026     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00027     Array::Pattern::PatInOutOp(im, inoutHist);
00028 }
00029 
00030 template<class HistT, class ArrayT>
00031 void
00032 MakeHistogram1d(HistT* hist, ArrayT* im, ArrayT* weights)
00033 {
00034     hist->Clear();
00035     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00036     Array::Pattern::PatInOutOp(im, weights, inoutHist);
00037 }
00038 
00039 template<class HistT, class ArrayT>
00040 void
00041 MakeHistogram1d(HistT* hist, ArrayT* im, Geometry::Rectangle rect)
00042 {
00043     hist->Clear();
00044     TraitInOutHistogram1d<HistT, ArrayT> inoutHist(hist);
00045     ArrayT* roi = Array::MakeRoi(im, rect);
00046     Array::Pattern::PatInOutOp(roi, inoutHist);
00047     delete roi;
00048 }
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 } 
00070 } 
00071 } 
00072 
00073 #endif