Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make vtk contour take an affine #1165
I took the code from the contour function from fvtk.py (which doesn't use an affine) and combined it with code from the slicer in actor.py to make a function contour_actor in actor.py that uses an affine to place contours. I'm using this to display a roi with background image (slicer) and streamlines. I haven't written tests, yet.
@@ Coverage Diff @@ ## master #1165 +/- ## ========================================== + Coverage 87.03% 87.07% +0.03% ========================================== Files 228 227 -1 Lines 29034 29060 +26 Branches 3128 3123 -5 ========================================== + Hits 25269 25303 +34 + Misses 3058 3047 -11 - Partials 707 710 +3
Thanks for adding this actor :). Tests would be really nice as it would help us to run the code see what kind of contour we should expect.
Hi, @arokem. I have addressed some of them, and am writing tests modeled after the slicer tests, but got a bit stuck on the multi-level contours (the way the original function was written, it puts multiple skins into the assembly, each with their own opacity, color, etc, based on a set of levels that are provided by the user). After testing the multi-level contouring, I'm not sure I understand the original intent of the contour actor; the main functionality I wanted is to make 3D ROI's... instead of making multiple contours we could instead just have it render a single skin ROI... Unless anyone disagrees, I think I'll modify the actor to display a single binary ROI as a volume and get rid of the rest of the contouring?
I made a few comments but I'll wait after you fixed the unit test and the example script to continue.
1 similar comment
Hey @kesshijordan, thanks for the modification. I tried it and it works great. I've made a few more comments.
Regarding the unit test, I do think it can run on Travis with the right setting for the
snapshot function. At least, it does on my computer with VTK5.8 and XVFB.