Re: Counting topology features of iso-surfaces from TTK?

40 views
Skip to first unread message

Dan Zeng

unread,
Feb 22, 2022, 7:04:26 AM2/22/22
to topology...@gmail.com, ttk-...@googlegroups.com, julien...@sorbonne-universite.fr
To clarify (also sending to the google group and Dr. Tierny), I have now also tried inputting a 3D voxelized volume and performed topological simplification (and thresholding the persistence diagram) as pictured. I then selected the output and went to File -> Save Data to create a .csv file with the scalar intensity data at each coordinate. I then processed this file to recreate a topologically simplified volume. 

I would now like to count the number of object and background components. What voxel connectivity should I use for the object / background? Is it 26-connectivity FG / 6-connectivity BG, or something else? For context, I'm working on a project which requires 6-connectivity for the object, so under the assumption that TTK is using 26-connectivity for the object, I tried inverting my volume, running TTK, and inverting the volume again. However, the result still appears to be simply connected only in the 26 object-connectivity case. Any insights would be appreciated.

Thanks!

Dan Zeng
PhD Candidate, Computer Science
Washington University in St. Louis


On Sat, Feb 19, 2022 at 1:45 PM Dan Zeng <danz...@gmail.com> wrote:
Hi TTK team,

I'm using the topological simplification tool to simplify a grayscale image, and would like to record the number of object and background connected components after simplification at a certain set of iso-values. Using Paraview, I've saved the output as a .png image, and would now like to count the features. Which pixel connectivity should I use for the object and background? Is it 8 connectivity for the object and 4 for the background, or vice versa?

Thank you,
Dan Zeng
PhD Candidate, Computer Science
Washington University in St. Louis
Screen Shot 2022-02-21 at 8.05.05 PM.png

Jonas Lukasczyk

unread,
Feb 22, 2022, 8:11:22 AM2/22/22
to ttk-...@googlegroups.com
Dear Dan Zeng,
are you looking for superlevel set components? In this case I would do the following:
1. Load the data (lets assume the scalar array is called S)
2. Simplify by Persistence (threshold will need to be adjusted manually)
3. Use the calculator to create a new scalar field: the component mask (0: background, 1: component). The expression can simply be: S > SomeIsoValue.
4. Either export the data and count vertex values manually, or you can use the histogram filter in paraview.

Regarding connectivity: TTK assumes that the underlying domain is a simplicial complex (so classical voxel-connectivity like 6 or 26 does not apply). Even if the data is a regular grid, TTK will assume an implicit triangulation behind the scenes. If you want to make sure that everything is consistent you can use the Tetrahedralize filter after loading the data. This will turn your domain into an explicit simplicial complex.

To compute connected components consistent with the neighborhood relationship maintained by TTK you can use the new filter that will be merged into TTK via this pull request: https://github.com/topology-tool-kit/ttk/pull/730.

Best
Jonas Lukasczyk
> --
> You received this message because you are subscribed to the Google Groups "ttk-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ttk-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ttk-users/CABRwK2etPVes3bg_WNXsTC5JVCZBhH9VUoKJ0Rs7Dm7K2qC-qA%40mail.gmail.com (https://groups.google.com/d/msgid/ttk-users/CABRwK2etPVes3bg_WNXsTC5JVCZBhH9VUoKJ0Rs7Dm7K2qC-qA%40mail.gmail.com?utm_medium=email&utm_source=footer).
>

Dan Zeng

unread,
Mar 1, 2022, 3:20:12 PM3/1/22
to ttk-users
Thanks! Sorry I just saw this. A couple of follow-ups:

*Using TTK's connectivity, how would I go about computing the number of cycles?
*I'd like to better understand the connectivity maintained by TTK and its relation to voxel connectivity. Could you elaborate and/or is there any documentation?
*When the tetrahedralize filter is applied to a voxelized scalar field, does the resulting simplicial complex correspond to 6 or 26 connectivity? For example if I apply the component mask above to find a superlevel set, then count the components, which type of voxel connectivity would this correspond to (for the both the object or background)?

Dan

Dan Zeng

unread,
Mar 14, 2022, 4:40:46 PM3/14/22
to ttk-users
Basically, I need a way to H0, H1, and H2 at particular iso-values before and after running topological simplification, using TTK's connectivity. Any thoughts on this?

My input is a voxelized volume (from an .mrc file) which appears to be a cubical complex after importing into Paraview. 

Thanks,
Dan
Reply all
Reply to author
Forward
0 new messages