00001 #ifndef Impala_Core_Histogram_MakeHistogram1d_h 00002 #define Impala_Core_Histogram_MakeHistogram1d_h 00003 00004 #include "Core/Histogram/Histogram2dTem.h" 00005 #include "Core/Array/MakeRoi.h" 00006 #include "Core/Histogram/TraitInOutHistogram2d.h" 00007 #include "Core/Array/Pattern/PatInOutOp.h" 00008 00009 namespace Impala 00010 { 00011 namespace Core 00012 { 00013 namespace Histogram 00014 { 00015 00016 00017 /* 00018 call function something like this: 00019 00020 Array::Array2dScalarReal64* im1 = MakeFromValue<Array::Array2dScalarReal64>(0.1, 10, 10); 00021 Array::Array2dScalarReal64* im2 = MakeFromValue<Array::Array2dScalarReal64>(0.7, 10, 10); 00022 Histogram::Histogram2dTem<double> hist(0, 1, 4, 0, 1, 4); 00023 Histogram::MakeHistogram2d(&hist, im1, im2, Geometry::Rectangle(0,0,9,9)); 00024 hist.Dump(true); 00025 00026 */ 00027 template<class HistT, class ArrayT> 00028 void 00029 MakeHistogram2d(HistT* hist, ArrayT* im1, ArrayT* im2, Geometry::Rectangle rect) 00030 { 00031 hist->Clear(); 00032 TraitInOutHistogram2d<HistT, ArrayT> inoutHist(hist); 00033 ArrayT* roi1 = Array::MakeRoi(im1, rect); 00034 ArrayT* roi2 = Array::MakeRoi(im2, rect); 00035 Array::Pattern::PatInOutOp(roi1, roi2, inoutHist); 00036 delete roi1; 00037 delete roi2; 00038 } 00039 00040 00041 } // namespace Histogram 00042 } // namespace Core 00043 } // namespace Impala 00044 00045 #endif