Open brettviren opened 2 years ago
nanoflann
should work as a PC library.
It's a single header and the devs recommend simply copying that into a project which is something we do already for others.
The documentation is a little sparse but with the examples and ref docs its all good enough. We must supply a DatasetAdaptor
to return number of points and an individual point given its index. This should let us easily share memory with a monolithic array that can even span all of the 3D and 3x 2D point clouds and which can include additional values beyond point info. This should work fine using ITensor
(or perhaps better, ITensorSet
) for the IData
. There is also provided an adaptor to an Eigen matrix.
I think adopting nanoflann
for operations and ITensor
for storage resolves the first 4 items and strongly influences the 6th. I'll start a branch to begin some integration work with nanoflann.hpp
placed in util
include area and providing an "adaptor" that can work with boost::multiarray
and thus with ITensor
.
This issue is kind of more a "project". It is meant to capture various decisions we need to make for a number of things that WCT needs to accommodate the clustering and pattern recognition algorithms from WCP.
Check list of decisions:
Here are questions needing decisions. Let's check them off and add their answers. After each check list item are some requirements, comments and secondary questions. We will add lines giving the decisions as we make them.
[x] What Point Cloud (PC)
IData
representation to use?ITensor
first. A PC is ultimately a 2D array eg with each column representing a point and each row representing some numeric data type.ITensorSet
will be the DFP node input/output. This allows for both floating point and integer types and is compatible with providing ananoflann
adaptor.[x] What PC operations library to use?
nanoflann
, see comment below.[x] How do we represent transient PC data for algorithmic use
iface
(see why below).nanoflann
data types work?ITensor
can be used viaboost::multiarray
orEigen
array via sharing memory which will be fast. A single copy at the input of the DFP node is needed to make a mutable copy.PointCloud::Dataset
and its constituentPointCloud::Array
in PR #187.[x] How do we convert between
IData
and the transient PC data structure?boost::multiarray
held byITensor
.nanoflann
"adaptor" is required, but it looks trivial.KDTree
in PR #187[x] How do we represent collections of PC points?
std::vector<size_t>
holding indices into PC array.KDTree
in PR #187.[ ] PC point sampling following "2D projected measure" algorithm.
~This produces "2D" points that lack Cartesian coordinate attributes and have quasi-coordinates of wire-in-plane and time tick. They also carry channel and charge attributes.~
This is not projected but rather is formed from 2D channel-vs-tick "pixels".
[x] PC point sampling following "3D stepped" algorithm:
[ ] Determine if two points are inside blob-neighbors.
[ ] Test memory usage for realistic events and kitchen sink of point attributes.
[ ] Filtered point cloud
boost::filtered_graph
that provides "dynamic" selection is wanted.[ ] PC union operation.
[ ] PCA on PC
[ ] Hough transform
boost::histogram
is in https://github.com/WireCell/wire-cell-toolkit/blob/apply-pointcloud/util/test/doctest_pointcloud_hough.cxx[ ]
Related
189
190