1 | #ifndef OBJECT_GROWER_H |
---|
2 | #define OBJECT_GROWER_H |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | #include <duchamp/duchamp.hh> |
---|
6 | #include <Detection/detection.hh> |
---|
7 | #include <Cubes/cubes.hh> |
---|
8 | #include <duchamp/Utils/Statistics.hh> |
---|
9 | |
---|
10 | namespace duchamp { |
---|
11 | |
---|
12 | /// @brief Flags defining the state of each pixel |
---|
13 | enum STATE {AVAILABLE, DETECTED, BLANK, MW}; |
---|
14 | |
---|
15 | /// @brief A class to manage the growing of objects to a secondary |
---|
16 | /// threshold |
---|
17 | /// @details This class provides a mechanism for handling the |
---|
18 | /// growing of objects. By keeping track of the state of each pixel, |
---|
19 | /// through an array of flags indicating whether a pixel is |
---|
20 | /// available or in an object, it is able to efficiently grow the |
---|
21 | /// objects from pixels on the edge, rather than spending time |
---|
22 | /// examining pixels that are completely surrounded by other object |
---|
23 | /// pixels. |
---|
24 | class ObjectGrower |
---|
25 | { |
---|
26 | public: |
---|
27 | /// @brief Default constructor |
---|
28 | ObjectGrower(); |
---|
29 | /// @brief Destrctor |
---|
30 | virtual ~ObjectGrower(){}; |
---|
31 | /// @brief Copy constructor |
---|
32 | ObjectGrower(ObjectGrower &o); |
---|
33 | /// @brief Copy operator |
---|
34 | ObjectGrower& operator=(const ObjectGrower &o); |
---|
35 | |
---|
36 | /// @brief Set up the class with parameters & pointers from the cube |
---|
37 | void define(Cube *theCube); |
---|
38 | /// @brief Grow an object |
---|
39 | void grow(Detection *theObject); |
---|
40 | /// @brief Grow out from a single voxel, returning the list of new voxels. |
---|
41 | std::vector<Voxel> growFromPixel(Voxel vox); |
---|
42 | |
---|
43 | protected: |
---|
44 | std::vector<STATE> itsFlagArray; ///< The array of pixel flags |
---|
45 | std::vector<long> itsArrayDim; ///< The dimensions of the array |
---|
46 | Statistics::StatsContainer<float> itsGrowthStats; ///< The statistics used to determine membership of an object |
---|
47 | int itsSpatialThresh; ///< The spatial threshold for merging |
---|
48 | int itsVelocityThresh; ///< The spectral threshold for merging |
---|
49 | float* itsFluxArray; ///< The location of the pixel values |
---|
50 | }; |
---|
51 | |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | #endif |
---|