forked from brettviren/wire-cell-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from HaiwangYu/apply-pointcloud
Some in-dev code and speed up of conversion code
- Loading branch information
Showing
20 changed files
with
506 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef WIRECELLIMG_MULTIALGBLOBCLUSTERING | ||
#define WIRECELLIMG_MULTIALGBLOBCLUSTERING | ||
|
||
#include "WireCellIface/ITensorSetFilter.h" | ||
#include "WireCellIface/IConfigurable.h" | ||
#include "WireCellAux/Logger.h" | ||
|
||
namespace WireCell::Img { | ||
|
||
class MultiAlgBlobClustering : public Aux::Logger, public ITensorSetFilter, public IConfigurable { | ||
public: | ||
MultiAlgBlobClustering(); | ||
virtual ~MultiAlgBlobClustering() = default; | ||
|
||
virtual void configure(const WireCell::Configuration& cfg); | ||
virtual WireCell::Configuration default_configuration() const; | ||
|
||
virtual bool operator()(const input_pointer& in, output_pointer& out); | ||
|
||
private: | ||
// Count how many times we are called | ||
size_t m_count{0}; | ||
|
||
/** Config: "inpath" | ||
* | ||
* The datapath for the input point graph data. This may be a | ||
* regular expression which will be applied in a first-match | ||
* basis against the input tensor datapaths. If the matched | ||
* tensor is a pcdataset it is interpreted as providing the | ||
* nodes dataset. Otherwise the matched tensor must be a | ||
* pcgraph. | ||
*/ | ||
std::string m_inpath{".*"}; | ||
|
||
/** Config: "outpath" | ||
* | ||
* The datapath for the resulting pcdataset. A "%d" will be | ||
* interpolated with the ident number of the input tensor set. | ||
*/ | ||
std::string m_outpath{""}; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* | ||
*/ | ||
|
||
#ifndef WIRECELLIMG_POINTCLOUDFACADE | ||
#define WIRECELLIMG_POINTCLOUDFACADE | ||
|
||
#include "WireCellUtil/PointCloudDataset.h" | ||
#include "WireCellUtil/PointTree.h" | ||
#include "WireCellUtil/Point.h" | ||
|
||
namespace WireCell::PointCloud { | ||
using node_t = WireCell::PointCloud::Tree::Points::node_t; | ||
using node_ptr = std::unique_ptr<node_t>; | ||
using Point = WireCell::Point; | ||
|
||
class Cluster { | ||
public: | ||
Cluster(const node_ptr& n) | ||
: m_node(n.get()) | ||
{ | ||
} | ||
WireCell::PointCloud::Point calc_ave_pos(const Point& origin, const double dis) const; | ||
|
||
private: | ||
node_t* m_node; /// do not own | ||
}; | ||
|
||
class Blob { | ||
public: | ||
Blob(const node_ptr& n) | ||
: m_node(n.get()) | ||
{ | ||
} | ||
double center_pos() const; | ||
|
||
private: | ||
node_t* m_node; /// do not own | ||
}; | ||
} // namespace WireCell::PointCloud | ||
|
||
#endif |
Oops, something went wrong.