forked from brettviren/wire-cell-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply pointcloud #294
Merged
Merged
Apply pointcloud #294
Conversation
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
…kit into apply-pointcloud
…g the way, cleanup long standing logging build issue
…joint range accessor
…kit into apply-pointcloud
5sec for 0.5M ITen
Some in-dev code and speed up of conversion code
This commit adds a new interface called IClusterFaninTensorSet to the WireCellIface namespace. The interface is a fan-in node that takes IClusters as input and outputs an ITensorSet. The commit also includes the necessary header and source file changes to implement the interface.
…d comment out one that is apparently not used (now called nprojection()
…ts option offset=0 to go back to ray-centric
…and other things. In general, a scoped view will not have the same ordering as children(). The scoped view may not even span the children of one node. In the case of the blob and cluster facade and the "3d" scoped view on a cluster node there was a chance the two orders would be the same but its still not guaranteed. So, in order to properly resolve a k-d point index back to a blob one must go through the scoped view's nodes and convert extract their blob facades. This now implemented. Detailed changes: - Lots of API improvements in Nary, Points, Facade, clustering funcs, MultiAlgBlobClustering - Various replacement of copy-pasted code for const variants with const_casting. - Fix regression in NaryTree where the wrong node was being notified for an insert/remove action. - Fix NFKDVec::point() which was only setting dimension 0. It seems no code yet used this. - Improve NFKDVec to have symmetric behavior for dynamic or static and have lazy behavior w.r.t. constructing and filling the underlying nanoflann object. Nothing is done to nanoflann until a query. When nanoflann is created, any points that were appended prior will be added en masse. If append happens after a static nanoflan is created, static nanoflan is deleted and remade on the new, larger point set. - Make ScopedView more lazy for everything but its collection of nodes. - Points now uses STATIC NFKDVec/nanoflan k-d tree. - Many changes in PointCloudFacade. Facades can now return their parent facade. Cluster and blob facades have new methods: hash() and sanity() to help with debugging. Cluster has several new methods to simply and hide access to scoped view and k-d tree queries and to help resolve k-d results to blobs and points. A pair of `{cluster,blob}_less()` and `sort_{clusters,blobs}()` methods are defined to sort facades by their "size". NOTE, this makes 3 possible ordering of blobs in the wild: tree children(), scoped view and sorted. Also, ostream operators added. - The "TPCParams" is no longer externally passed everywhere but set on a Grouping. A cluster may ask its parent grouping for the TP. This makes Cluster::get_length() argless. - In MultiAlgBlobClustering, consolidate the various debug prints and ExecMon into a Perf object that is controlled by the "perf" config option. - In `clustering_live_dead()`, remove prints/ExecMon and there and other clusering funcs, adjust to change in where the "tp" lives. - In PointTreeBuilding, move the check for "3d" from graph exec time to the configuration. - Various tests and docs improvements and additions.
This should also negate the need for special spdlog/fmt formatter to print Point and removes a very nasty bug where the compiler apparently is perfectly happy to convert a Point to bool and then to double.
- The result of unnecessary resolution from point to major index was passed as a point index. - For some mysterious reason, I had the NaryTreeFacade::children() sorting on child pointer value. A few changes along the way: - Make log pointer optional to the sanity() methods. - Add sanity checking of the facade blob and scoped node ordering, now that they are correctly, if accidentally/constructed to be the same. - Rewrite get_closest_blob() to do slightly less work to get its job done. - Add cluster length as most significant value to the mix of values when comparing the "size" of two clusters. - Rename test cases in clustering prototype test to better follow convention to make the tests more user friendly for "-tc='clustering*'" type doctest executing.
Test results before merging: $SPDLOG_LEVEL=debug ./build/img/wcdoctest-img -tc="clustering facade"
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
[2024-05-17 16:06:16.326] [wct] [debug] pc1: 10
[2024-05-17 16:06:16.327] [wct] [debug] pc2: 10
[2024-05-17 16:06:16.327] [wct] [debug] blob 0: q=1, r=0.5
[2024-05-17 16:06:16.327] [wct] [debug] blob 1: q=2, r=1.5
[2024-05-17 16:06:16.327] [wct] [debug] expect average pos 1.1666666666666667
[2024-05-17 16:06:16.327] [wct] [debug] ave_pos: (1.16667 0 0) | expecting (1.1666666666666665 0 0)
[2024-05-17 16:06:16.327] [wct] [debug] vdir_alg0: (0.999946 0.0087264 0.00555556) | expecting around {1, 0, 0}
[2024-05-17 16:06:16.328] [wct] [debug] vdir_alg1: (0.999924 0.0087262 -0.00872654) | expecting around {1, 0, 0}
[2024-05-17 16:06:16.328] [wct] [debug] length: 8.503120030318284 | expecting 8.50312003032
[2024-05-17 16:06:16.328] [wct] [debug] earliest_latest_points: (0 0 0) (1.9 0 0) | expecting (0 0 0) (1.9 0 0)
[2024-05-17 16:06:16.328] [wct] [debug] num_points: 15 5 | expecting 15, 5
===============================================================================
[doctest] test cases: 1 | 1 passed | 0 failed | 2 skipped
[doctest] assertions: 14 | 14 passed | 0 failed |
[doctest] Status: SUCCESS! uboone test: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@HaiwangYu
I think we should merge
apply-pointcloud
in tomaster
. The two branches are starting to diverge.