Commit ce1ca5cf authored by Nicole Bussola's avatar Nicole Bussola
Browse files

fixed features number and add gETU

parent 014c5f05
......@@ -486,7 +486,7 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
def getInactiveVolumeFeatureValue(self):
r"""
**21. Inactive volume **
**22. Inactive volume **
Percentage of the tumour region that is inactive. Ast defined by Valieres et al
a threshold of 0.01 × (SUVmax)^2 followed by closing and opening morphological operations were used
......@@ -562,7 +562,7 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
def getAUCCSHFeatureValue(self):
r"""
**21. Inactive volume **
**23. AUCCSH **
Area under the curve of the cumulative SUV-volume histogram describing the percentage
of total tumour volume above a percentage threshold of maximum SUV, as defined by van Velden et al.
......@@ -605,12 +605,96 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
csh = numpy.flipud(numpy.cumsum(numpy.flipud(bins)) / nVoxel)
return numpy.sum(csh / nBins)
def getSuvPeakFeatureValue(self):
r"""
**24. SuvPeak**
Total lesion glycolysis.
Defined as
.. math::
\textit{SUVMean}\times \textit{total volume of the tumour region}
- input: 3D array representing the PET volume in SUV format, with
voxels outside the ROI set to NaNs.
.. note::
Extracted from PET scans and not used in the CT feature set.
"""
ROIPet = self.imageArray
mask = self.maskArray
ROIPet[~mask] = numpy.nan
# ROIPet = numpy.pad(ROIPet, 1, mode='constant', constant_values=numpy.nan)
xx = numpy.array(
[
[[1, 2, 3], [4, 5, 6], [7, 8, 9]],
[[10, 11, 12], [13, 14, 15], [16, 17, 18]],
[[19, 20, 21], [22, 223, 24], [25, 26, 27]],
]
)
oc = Oct2Py()
ROIPet = oc.double(xx.tolist())
with Oct2Py() as oc:
try:
oc.eval('pkg load image')
ROIPet = oc.padarray(
ROIPet, oc.double(numpy.array([1, 1, 1]).tolist()), numpy.nan
)
SUVmax = numpy.max(ROIPet[~numpy.isnan(ROIPet)])
indMax = numpy.where(ROIPet[~numpy.isnan(ROIPet)] == SUVmax)[0]
# ROIPet = numpy.pad(ROIPet, 1, mode='constant', constant_values=np.nan)
[indMaxX, indMaxY, indMaxZ] = numpy.unravel_index(
indMax[0], ROIPet.shape, 'F'
)
connectivity = oc.getneighbors(
oc.strel('arbitrary', oc.conndef(3, 'maximal'))
)
import ipdb
ipdb.set_trace()
nPeak = len(connectivity)
neighborsMax = oc.zeros(1, nPeak)
for i in range(nPeak):
neighborsMax[i] = ROIPet[
connectivity(i, 1) + indMaxX,
connectivity(i, 2) + indMaxY,
connectivity(i, 3) + indMaxZ,
]
except Oct2PyError as e:
print(e)
oc.exit()
import ipdb
ipdb.set_trace()
# SUVpeak = mean(neighborsMax(~isnan(neighborsMax)))
return mean(neighborsMax(~isnan(neighborsMax)))
# ROIPet = numpy.pad(ROIPet, 1, mode='constant', constant_values=np.nan)
def getgETUFeatureValue(self):
r"""
**25. gETU**
Generalized effective total uptake, with parameter a = 0.25 as defined by Rahim et al.
- input: 3D array representing the PET volume in SUV format, with
voxels outside the ROI set to NaNs.
.. note::
Extracted from PET scans and not used in the CT feature set.
"""
ROIPet = self.imageArray
mask = self.maskArray
ROIPet[~mask] = numpy.nan
a = 0.25
n_voxels = numpy.sum(ROIPet[~numpy.isnan(ROIPet)])
ROIPet = ROIPet ** a
# nVoxel = numel(volume);
return numpy.sum(ROIPet[~numpy.isnan(ROIPet)] / n_voxels) ** (1 / a)
# bins = hist(volume,nBins);
# CSH = fliplr(cumsum(fliplr(bins))./nVoxel);
# aucCSH = sum(CSH./nBins);
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