From f6b77ed991095240a44af0e9d40fbe2e166e7ffe Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 15 Feb 2017 13:22:17 -0500 Subject: [PATCH] BUG: shape: Fix datatype bug in python implementation 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). --- radiomics/shape.py | 1 + 1 file changed, 1 insertion(+) diff --git a/radiomics/shape.py b/radiomics/shape.py index b4800a5b..fde332ea 100644 --- a/radiomics/shape.py +++ b/radiomics/shape.py @@ -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)])