[SOFA] Creation of new componeent responsible on translating the skeleton txt file into a vtk one - #1
Open
bouamarakamelia wants to merge 2 commits into
Open
Conversation
This file contains hidden or 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
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.
1. Description
Adds a new
SkeletonReadercomponent toMeshSkeletonizationPlugin.It reads the polyline skeleton file produced by
MeshSkeletonizationand rebuilds it in memory as a proper node graph(id, parents, children, mesh correspondence), rooted as a tree from a chosen entry point, and exportable as
.vtkfor visualization in ParaView.2. New features according to the 3 main classes
SkeletonNode: skeleton point as a data classPlain C++ class (no SOFA/CGAL dependency).
Stores id, 3D position,
parentIds/childrenIds, and optional mesh-correspondence fields (meshVertexId,distanceToMesh).SkeletonGraph: parsing + tree buildingloadFromFile(): parses the polyline text format, merges coincident points into one node.buildTree(): BFS from an entry point, fills parent/child ids, flags loop/anastomosis (when veins loop over each other) edges instead of dropping or duplicating them.computeMeshCorrespondence(): links each node to its closest mesh vertex.exportToVTK(): writes points, tree-edge lines, andtype/depth/is_loopscalars.SkeletonReader: SOFADataEnginewrapperExposes the above as scene Data fields (
filename,inputVertices,entryPointin;outputVTK,nodeCountout).Registered in
init.cppalongsideMeshSkeletonization.init()forces oneupdate()pass so it also runs correctly in batch mode, not just when a GUI happens to read its outputs.3. Results
A comparison window between the txt file output on SOFA and the vtk file output dependent from MeshSkeletonization plugin on the left opened in 3DSlicer.