7 #include <boost/graph/connected_components.hpp> 20 Img::BlobGrouping::~BlobGrouping()
41 cluster_node_t nblob{iblob};
43 for (
auto wvtx : grind.neighbors(nblob)) {
44 if (wvtx.code() !=
'w') {
47 auto iwire = std::get<IWire::pointer>(wvtx.ptr);
48 auto layer = iwire->planeid().layer();
49 auto&
lg = lgs[layer];
51 for (
auto cvtx : grind.neighbors(wvtx)) {
52 if (cvtx.code() !=
'c') {
68 for (
auto other : grind.neighbors(islice)) {
69 if (
other.code() !=
'b') {
76 for (
auto lgit : lgs) {
77 auto& lgrind = lgit.second;
78 auto groups = lgrind.groups();
79 for (
auto& group : groups) {
82 IChannel::shared_vector imeas = IChannel::shared_vector(chans);
84 for (
auto& v : group.second) {
85 if (v.code() ==
'b') {
87 grind.edge(v.ptr, imeas);
90 if (v.code() ==
'c') {
92 grind.edge(v.ptr, imeas);
93 chans->push_back(std::get<IChannel::pointer>(v.ptr));
111 for (
auto islice : oftype<ISlice::pointer>(grind)) {
115 out = std::make_shared<SimpleCluster>(grind.graph());
IndexedGraph< cluster_node_t > cluster_indexed_graph_t
WIRECELL_FACTORY(BlobGrouping, WireCell::Img::BlobGrouping, WireCell::IClusterFilter, WireCell::IConfigurable) using namespace WireCell
static void fill_slice(cluster_indexed_graph_t &grind, ISlice::pointer islice)
std::shared_ptr< const ICluster > input_pointer
static void fill_blob(layer_graphs_t &lgs, const cluster_indexed_graph_t &grind, IBlob::pointer iblob)
char * lg(uint32_t n, Handler h) FMT_ALWAYS_INLINE
std::shared_ptr< const ICluster > output_pointer
std::unordered_map< WirePlaneLayer_t, cluster_indexed_graph_t > layer_graphs_t
Json::Value Configuration
WirePlaneLayer_t
Enumerate layer IDs. These are not indices!
const GenericPointer< typename T::ValueType > & pointer