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

Fix coordinates of SUVmax voxel in SUVPeak

parent a9647f17
......@@ -162,10 +162,10 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
"""
ROIPet = self.imageArray
mask = self.maskArray
ROIPet[~mask] = numpy.nan
oc = Oct2Py()
ROIPet = oc.double(ROIPet.tolist())
with Oct2Py() as oc:
try:
......@@ -175,17 +175,9 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
)
SUVmax = numpy.max(ROIPet[~numpy.isnan(ROIPet)])
indMax = numpy.where(ROIPet[~numpy.isnan(ROIPet)] == SUVmax)[0]
indMax = numpy.where(ROIPet == SUVmax)
[indMaxX, indMaxY, indMaxZ] = numpy.unravel_index(
indMax[0], ROIPet.shape, 'F'
)
# connectivity = oc.getneighbors(
# oc.strel(
# 'arbitrary',
# oc.double(numpy.ones((3, 3, 3), dtype=numpy.int).tolist()),
# )
# )
indMaxX, indMaxY, indMaxZ = indMax[0][0], indMax[1][0], indMax[2][0]
connectivity = numpy.array(
[
......@@ -227,15 +219,14 @@ class MyRadiomicsFirstOrder(MyRadiomicsFeaturesBase):
connectivity[i, 1] + indMaxY - 1,
connectivity[i, 2] + indMaxZ - 1,
]
# import ipdb
# ipdb.set_trace()
except Oct2PyError as e:
print(e)
oc.exit()
return numpy.mean(neighborsMax[~numpy.isnan(neighborsMax)])
def getInactiveVolumeFeatureValue(self):
r"""
**26. Inactive volume **
......
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