Commit fa058b89 authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Fix Inactive Volume for constant volumes

parent d8815d99
import numpy import numpy
from scipy import ndimage
from oct2py import Oct2Py, Oct2PyError from oct2py import Oct2Py, Oct2PyError
from scipy import ndimage
from radiomics.firstorder import RadiomicsFirstOrder from radiomics.firstorder import RadiomicsFirstOrder
from .mybase import MyRadiomicsFeaturesBase from .mybase import MyRadiomicsFeaturesBase
...@@ -234,12 +235,12 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase): ...@@ -234,12 +235,12 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
a threshold of 0.01 × (SUVmax)^2 followed by closing and opening morphological operations were used a threshold of 0.01 × (SUVmax)^2 followed by closing and opening morphological operations were used
to differentiate active and inactive regions on FDG-PET scans to differentiate active and inactive regions on FDG-PET scans
- input: 3D array representing the PET volume in SUV format, with - input: 3D array representing the PET volume in SUV format
voxels outside the ROI set to NaNs.
.. note:: .. note::
Extracted from PET scans and not used in the CT feature set. Extracted from PET scans and not used in the CT feature set.
""" """
ROIPet = self.imageArray ROIPet = self.imageArray
mask = self.maskArray mask = self.maskArray
...@@ -298,6 +299,8 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase): ...@@ -298,6 +299,8 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
connObjects = oc.bwconncomp(new_mask, 26) connObjects = oc.bwconncomp(new_mask, 26)
if int(connObjects.NumObjects) > 1:
b = numpy.zeros((1, int(connObjects.NumObjects))) b = numpy.zeros((1, int(connObjects.NumObjects)))
for i in range(int(connObjects.NumObjects)): for i in range(int(connObjects.NumObjects)):
...@@ -319,6 +322,8 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase): ...@@ -319,6 +322,8 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
] ]
) )
else:
sumInactive = 0
sumVolume = numpy.sum(mask) sumVolume = numpy.sum(mask)
except Oct2PyError as e: except Oct2PyError as e:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment