7 #ifndef LCVN_IMAGE_UTILS_H 8 #define LCVN_IMAGE_UTILS_H 17 typedef std::vector<std::vector<unsigned char>>
ViewVector;
26 CVNImageUtils(
unsigned int nWires,
unsigned int nTDCs,
unsigned int nViews);
37 void SetImageSize(
unsigned int nWires,
unsigned int nTDCs,
unsigned int nViews);
55 std::vector<float>& v1pe,
56 std::vector<float>& v2pe,
57 std::vector<unsigned char>& pix);
67 std::vector<float>& v1pe,
68 std::vector<float>& v2pe,
69 ImageVector& imageVec);
73 std::vector<float>& v1pe,
74 std::vector<float>& v2pe,
75 ImageVectorF& imageVec);
79 ImageVectorF& imageVec);
84 std::vector<float>& v1pe,
85 std::vector<float>& v2pe,
91 ImageVector
BuildImageVector(ViewVector& v0, ViewVector& v1, ViewVector& v2);
92 ImageVectorF
BuildImageVectorF(ViewVectorF& v0, ViewVectorF& v1, ViewVectorF& v2);
96 unsigned int& minWire,
97 unsigned int& maxWire);
100 void GetMinMaxTDCs(std::vector<float>& tdcCharges,
unsigned int& minTDC,
unsigned int& maxTDC);
136 #endif // CVN_IMAGE_UTILS_H ImageVectorF BuildImageVectorF(ViewVectorF &v0, ViewVectorF &v1, ViewVectorF &v2)
void GetMinMaxWires(std::vector< float > &wireCharges, unsigned int &minWire, unsigned int &maxWire)
Get the minimum and maximum wires from the pixel map needed to make the image.
void ConvertChargeVectorsToPixelArray(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, std::vector< unsigned char > &pix)
unsigned int fPixelMapTDCs
ViewVectorF ConvertViewVecToViewVecF(ViewVector &view)
Convert a ViewVector into a ViewVectorF.
Class containing some utility functions for all things CVN.
void ConvertPixelArrayToImageVectorF(const std::vector< unsigned char > &pixelArray, ImageVectorF &imageVec)
Convert a pixel array into a ImageVectorF.
std::vector< std::vector< unsigned char > > ViewVector
Useful typedefs.
void ReverseView(std::vector< float > &peVec)
Funtion to actually reverse the view.
PixelMap, basic input to CVN neural net.
void ConvertPixelMapToPixelArray(const PixelMap &pm, std::vector< unsigned char > &pix)
Convert a Pixel Map object into a single pixel array with an image size nWire x nTDC.
Utility class for truth labels.
void ConvertPixelMapToImageVectorF(const PixelMap &pm, ImageVectorF &imageVec)
Convert a pixel map into an image vector (float version)
bool fDisableRegionSelection
Disable the region finding?
unsigned char ConvertChargeToChar(float charge)
Convert the hit charge into the range 0 to 255 required by the CVN.
void SetLogScale(bool setLog)
Set the log scale for charge.
void SetPixelMapSize(unsigned int nWires, unsigned int nTDCs)
Set the input pixel map size.
bool fUseLogScale
Use a log scale for charge?
void ConvertChargeVectorsToViewVectors(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ViewVector &view0, ViewVector &view1, ViewVector &view2)
Base function for conversion of the Pixel Map to our required output format.
void GetMinMaxTDCs(std::vector< float > &tdcCharges, unsigned int &minTDC, unsigned int &maxTDC)
Get the minimum and maximum tdcs from the pixel map needed to make the image.
std::vector< ViewVector > ImageVector
unsigned int fNViews
Number of views of each event.
unsigned int fNTDCs
Number of TDCs to use for the image height.
ImageVector BuildImageVector(ViewVector &v0, ViewVector &v1, ViewVector &v2)
Make the image vector from the view vectors.
void ConvertChargeVectorsToImageVector(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ImageVector &imageVec)
Convert three adc vectors into an image vector (contains all three views)
void EnableRegionSelection()
Enable the selection of the wire region.
ImageVectorF ConvertImageVecToImageVecF(ImageVector &image)
Convert a ImageVector into a ImageVectorF.
unsigned int fPixelMapWires
Input pixel map sizes.
std::vector< std::vector< float > > ViewVectorF
void DisableRegionSelection()
Disable the selection of the wire region and just use the first 500 wires.
std::vector< bool > fViewReverse
Vector of bools to decide if any views need to be reversed.
void ConvertChargeVectorsToImageVectorF(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ImageVectorF &imageVec)
Float version of conversion for convenience of TF interface.
std::vector< ViewVectorF > ImageVectorF
unsigned int fNWires
Number of wires to use for the image width.
void ConvertPixelMapToImageVector(const PixelMap &pm, ImageVector &imageVec)
Convert a pixel map into an image vector (contains all three views)
void SetImageSize(unsigned int nWires, unsigned int nTDCs, unsigned int nViews)
Set up the image size that we want to have.
void SetViewReversal(bool reverseX, bool reverseY, bool reverseZ)
Function to set any views that need reversing.