Commit 5ebbe3f7 authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Fix dtype NumObjects

parent d3f1d17b
......@@ -226,7 +226,6 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
return numpy.mean(neighborsMax[~numpy.isnan(neighborsMax)])
def getInactiveVolumeFeatureValue(self):
r"""
**26. Inactive volume **
......@@ -243,8 +242,6 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
ROIPet = self.imageArray
mask = self.maskArray
ROIPet[~mask] = 0
thresh = 0.01 * (numpy.max(ROIPet[~numpy.isnan(ROIPet)]) ** 2)
mask_inactive = ROIPet > thresh
......@@ -290,17 +287,18 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
mask_inactive = oc.imclose(mask_inactive, conn)
mask_inactive = oc.imopen(mask_inactive, conn)
new_mask = mask_inactive + perimeter
new_mask[mask == 0] = 10
new_mask[new_mask == 1] = 10
new_mask[new_mask == 2] = 10
new_mask[new_mask == 0] = 1
new_mask[new_mask == 10] = 0
connObjects = oc.bwconncomp(new_mask, 26)
b = numpy.zeros((1, connObjects.NumObjects))
for i in range(connObjects.NumObjects):
a = oc.find(
b = numpy.zeros((1, int(connObjects.NumObjects)))
for i in range(int(connObjects.NumObjects)):
a = numpy.where(
len(connObjects.PixelIdxList[i]) >= 15
) # If the number of of pixel forming and object is lower than 15, reject it
if a.size == 0:
......@@ -308,8 +306,7 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
else:
b[i] = 1
[row, col] = oc.find(b > 0)
row, col = numpy.where(b > 0)
sumInactive = 0
for i in range(len(col)):
......@@ -318,9 +315,6 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
)
sumVolume = numpy.sum(mask)
import ipdb
ipdb.set_trace()
except Oct2PyError as e:
print(e)
......
Markdown is supported
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