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

Fix dtype NumObjects

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