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
WIP: Combined contour function with slicer to use affine #1163
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.
referenced this pull request
Dec 11, 2016
Current coverage is 85.24% (diff: 1.51%)
@@ master #1163 diff @@ ========================================== Files 214 214 Lines 24917 24983 +66 Methods 0 0 Messages 0 0 Branches 2526 2535 +9 ========================================== + Hits 21296 21297 +1 - Misses 2989 3054 +65 Partials 632 632
This is great! I only had a couple of really small PEP8 suggestions.
Just so I understand how this fits in: the resulting return value (
skin_assembly) can be added to a rendering as an actor?
Yes; you can add it as an actor. I used the same code as was already implemented in the fvtk.py contour function, but I combined it with the slicer code so that it takes an affine (when I used the contour function originally, it rendered successfully, but was placed in the wrong part of the brain). The previous version took an affine, but didn't use it. See, below, how it's used for a binary roi.
roidata = roidata.astype('uint8')