7 #ifndef CVN_IMAGE_UTILS_H 8 #define CVN_IMAGE_UTILS_H 18 typedef std::vector<std::vector<unsigned char> >
ViewVector;
28 CVNImageUtils(
unsigned int nWires,
unsigned int nTDCs,
unsigned int nViews);
40 void SetImageSize(
unsigned int nWires,
unsigned int nTDCs,
unsigned int nViews);
58 std::vector<float> &v2pe, std::vector<unsigned char> &pix);
68 std::vector<float> &v2pe, ImageVector &imageVec);
72 std::vector<float> &v2pe, ImageVectorF &imageVec);
81 ViewVector& view0, ViewVector& view1, ViewVector& view2);
88 void GetMinMaxWires(std::vector<float> &wireCharges,
unsigned int &minWire,
unsigned int &maxWire);
91 void GetMinMaxTDCs(std::vector<float> &tdcCharges,
unsigned int &minTDC,
unsigned int &maxTDC);
128 #endif // CVN_IMAGE_UTILS_H std::vector< ViewVectorF > ImageVectorF
std::vector< std::vector< float > > ViewVectorF
ImageVectorF ConvertImageVecToImageVecF(ImageVector image)
Convert a ImageVector into a ImageVectorF.
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)
unsigned int fPixelMapWires
Input pixel map sizes.
void DisableRegionSelection()
Disable the selection of the wire region and just use the first 500 wires.
void ConvertChargeVectorsToPixelArray(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, std::vector< unsigned char > &pix)
void SetViewReversal(bool reverseX, bool reverseY, bool reverseZ)
Function to set any views that need reversing.
void SetLogScale(bool setLog)
Set the log scale for charge.
std::vector< ViewVector > ImageVector
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.
void EnableRegionSelection()
Enable the selection of the wire region.
Utility class for truth labels.
void ReverseView(std::vector< float > &peVec)
Funtion to actually reverse the view.
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.
unsigned char ConvertChargeToChar(float charge)
Convert the hit charge into the range 0 to 255 required by the CVN.
ImageVector BuildImageVector(ViewVector v0, ViewVector v1, ViewVector v2)
Make the image vector from the view vectors.
void ConvertPixelMapToImageVector(const PixelMap &pm, ImageVector &imageVec)
Convert a pixel map into an image vector (contains all three views)
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.
bool fDisableRegionSelection
Disable the region finding?
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.
std::vector< bool > fViewReverse
Vector of bools to decide if any views need to be reversed.
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.
unsigned int fNTDCs
Number of TDCs to use for the image height.
unsigned int fNViews
Number of views of each event.
bool fUseLogScale
Use a log scale for charge?
void ConvertPixelMapToImageVectorF(const PixelMap &pm, ImageVectorF &imageVec)
Convert a pixel map into an image vector (float version)
Class containing some utility functions for all things CVN.
ImageVectorF BuildImageVectorF(ViewVectorF v0, ViewVectorF v1, ViewVectorF v2)
void SetImageSize(unsigned int nWires, unsigned int nTDCs, unsigned int nViews)
Set up the image size that we want to have.
void ConvertPixelArrayToImageVectorF(const std::vector< unsigned char > &pixelArray, ImageVectorF &imageVec)
Convert a pixel array into a ImageVectorF.
ViewVectorF ConvertViewVecToViewVecF(ViewVector view)
Convert a ViewVector into a ViewVectorF.
unsigned int fPixelMapTDCs
unsigned int fNWires
Number of wires to use for the image width.
PixelMap, basic input to CVN neural net.
std::vector< std::vector< unsigned char > > ViewVector
Useful typedefs.
void SetPixelMapSize(unsigned int nWires, unsigned int nTDCs)
Set the input pixel map size.