Skip to content

Commit

Permalink
BUG: shape: Fix datatype bug in python implementation
Browse files Browse the repository at this point in the history
Fix a datatype bug in the python calculation of surface area (must be
in a number-like datatype, otherwise the interpolate function will not
work properly).
  • Loading branch information
jcfr committed Feb 15, 2017
1 parent c588100 commit f6b77ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions radiomics/shape.py
Expand Up @@ -50,6 +50,7 @@ def __init__(self, inputImage, inputMask, **kwargs):
self.SurfaceArea = self._calculateSurfaceArea()

def _calculateSurfaceArea(self):
self.maskArray = self.maskArray.astype('int') # needed for the interpolate function to work correctly
# define relative locations of the 8 voxels of a sampling cube
gridAngles = numpy.array([(0, 0, 0), (0, 0, 1), (0, 1, 1), (0, 1, 0),
(1, 0, 0), (1, 0, 1), (1, 1, 1), (1, 1, 0)])
Expand Down

0 comments on commit f6b77ed

Please sign in to comment.