6 #include <boost/graph/graphviz.hpp> 20 Img::BlobClustering::~BlobClustering()
26 m_spans =
get(
cfg,
"spans", m_spans);
37 cfg[
"spans"] = m_spans;
43 clusters.push_back(std::make_shared<SimpleCluster>(m_grind.graph()));
57 if (m_spans <= epsilon) {
61 auto nslice = newbs->slice();
62 auto oslice = m_last_bs->slice();
64 const double dt = nslice->start() - oslice->start();
65 return std::abs(dt - m_spans*oslice->span()) > epsilon;
71 if (m_grind.has(islice)) {
75 for (
const auto& ichv : islice->activity()) {
77 if (m_grind.has(ich)) {
80 for (
const auto& iwire : ich->wires()) {
81 m_grind.edge(ich, iwire);
88 for (
const auto& iblob : newbs->blobs()) {
89 auto islice = iblob->slice();
91 m_grind.edge(islice, iblob);
93 auto iface = iblob->face();
94 auto wire_planes = iface->planes();
96 const auto& shape = iblob->shape();
97 for (
const auto& strip : shape.strips()) {
100 const int num_nonplane_layers = 2;
101 int iplane = strip.layer - num_nonplane_layers;
105 const auto& wires = wire_planes[iplane]->wires();
106 for (
int wip=strip.bounds.first; wip < strip.bounds.second and wip <
int(wires.size()); ++wip) {
107 auto iwire = wires[wip];
108 m_grind.edge(iblob, iwire);
123 if (judge_gap(newbs)) {
135 const auto beg1 = blobs1.begin();
136 const auto beg2 = blobs2.begin();
141 m_grind.edge(iblobs1[an], iblobs2[bn]);
153 l->debug(
"BlobClustering: EOS");
155 clusters.push_back(
nullptr);
161 bool gap = graph_bs(blobset);
164 l->debug(
"BlobClustering: sending {} clusters", clusters.size());
std::shared_ptr< const ISlice > pointer
std::vector< pointer > vector
std::deque< output_pointer > output_queue
blobs_t::const_iterator blobref_t
QTextStream & flush(QTextStream &s)
logptr_t logger(std::string name)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
std::vector< Blob > blobs_t
#define SPDLOG_LOGGER_TRACE(logger,...)
Json::Value Configuration
std::shared_ptr< const IBlobSet > input_pointer
bool associate(const std::string &classname, WireCell::INamedFactory *factory)
Associate a factory with the type it makes.
WIRECELL_FACTORY(BlobClustering, WireCell::Img::BlobClustering, WireCell::IClustering, WireCell::IConfigurable) using namespace WireCell