Commit 014c5f05 authored by Nicole Bussola's avatar Nicole Bussola
Browse files

Add AUCCSH feature

parent e75cad5c
......@@ -547,19 +547,17 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
with Oct2Py() as oc:
try:
oc.eval('pkg load image')
perimeter = oc.bwperim(mask, 26) # oc.bwperim(mask, 26)
perimeter = oc.bwperim(mask, 26)
mask_inactive = oc.imclose(mask_inactive, conn)
mask_inactive = oc.imopen(mask_inactive, conn)
except Oct2PyError as e:
print(e)
oc.exit()
# mask_inactive = oc.imclose(mask_inactive, conn)
# mask_inactive = oc.imopen(mask_inactive, conn)
new_mask = mask_inactive + perimeter
import ipdb
ipdb.set_trace()
new_mask = mask_inactive + perimeter
return n
def getAUCCSHFeatureValue(self):
......@@ -579,6 +577,7 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
mask = self.maskArray
ROIPet[~mask] = numpy.nan
outliers = numpy.where(
ROIPet
> (
......@@ -586,7 +585,8 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
+ 3 * numpy.std(ROIPet[~numpy.isnan(ROIPet)])
)
)[0]
goodVoxels = numpy.where(
good_voxels = numpy.where(
ROIPet
<= (
numpy.mean(ROIPet[~numpy.isnan(ROIPet)])
......@@ -594,21 +594,21 @@ class RadiomicsFirstOrder(base.RadiomicsFeaturesBase):
)
)[0]
ROIPet[outliers] = numpy.mean(ROIPet[goodVoxels])
ROIPet = ROIPet - numpy.min(ROIPet)
ROIPet = ROIPet / numpy.max(ROIPet)
ROIPet[outliers] = numpy.mean(ROIPet[good_voxels])
ROIPet = ROIPet - numpy.min(ROIPet[~numpy.isnan(ROIPet)])
ROIPet = ROIPet / numpy.max(ROIPet[~numpy.isnan(ROIPet)])
volume = ROIPet[~numpy.isnan(ROIPet)]
nVoxel = len(volume)
bins = numpy.histogram(volume, nBins)
import ipdb
ipdb.set_trace()
csh = numpy.fliplr(numpy.cumsum(numpy.fliplr(bins)) / nVoxel)
bins, _ = numpy.histogram(volume, nBins)
csh = numpy.flipud(numpy.cumsum(numpy.flipud(bins)) / nVoxel)
return numpy.sum(csh / nBins)
# ROIPet = numpy.pad(ROIPet, 1, mode='constant', constant_values=np.nan)
# nVoxel = numel(volume);
# bins = hist(volume,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