Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MPBA Radiomics
RADLER
Commits
7296d372
Commit
7296d372
authored
Mar 16, 2020
by
Alessia Marcolini
Browse files
Add SUVMax and SUVMean features for PET modality
parent
2fa3bde1
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyradiomics_radler/myfirstorder.py
0 → 100644
View file @
7296d372
import
numpy
from
scipy
import
ndimage
from
radiomics.firstorder
import
RadiomicsFirstOrder
from
.mybase
import
MyRadiomicsFeaturesBase
class
MyRadiomicsFirstOrder
(
MyRadiomicsFeaturesBase
):
def
__init__
(
self
,
inputImage
,
inputMask
,
**
kwargs
):
super
().
__init__
(
inputImage
,
inputMask
,
**
kwargs
)
self
.
pixelSpacing
=
inputImage
.
GetSpacing
()
self
.
voxelArrayShift
=
kwargs
.
get
(
'voxelArrayShift'
,
0
)
def
_initCalculation
(
self
):
return
super
().
_initSegmentBasedCalculation
()
self
.
targetVoxelArray
=
self
.
imageArray
[
self
.
labelledVoxelCoordinates
].
astype
(
'float'
)
self
.
discretizedTargetVoxelArray
=
None
# Lazy instantiation
self
.
logger
.
debug
(
'First order feature class initialized'
)
def
_moment
(
self
,
a
,
moment
=
1
,
axis
=
0
):
return
RadiomicsFirstOrder
.
_moment
(
self
,
a
,
moment
,
axis
)
def
_getDiscretizedTargetVoxelArray
(
self
):
return
RadiomicsFirstOrder
.
_getDiscretizedTargetVoxelArray
(
self
)
def
getSuvMaxFeatureValue
(
self
):
r
"""
**20. SUV max**
Implemented as one of the intensity features extracted by Vallieres et al.
Maximum SUV of the tumour region.
- input: 3D array representing the PET volume in SUV format
.. note::
Extracted from PET scans and not used in the CT feature set.
"""
ROIPet
=
self
.
imageArray
mask
=
self
.
maskArray
ROIPet
[
~
mask
]
=
numpy
.
nan
return
numpy
.
max
(
ROIPet
[
~
numpy
.
isnan
(
ROIPet
)])
def
getSuvMeanFeatureValue
(
self
):
r
"""
**21. SUV mean**
Implemented as one of the intensity features extracted by valieres et al.
Average SUV of the tumour region.
- input: 3D array representing the PET volume in SUV format
.. note::
Extracted from PET scans and not used in the CT feature set.
"""
ROIPet
=
self
.
imageArray
mask
=
self
.
maskArray
ROIPet
[
~
mask
]
=
numpy
.
nan
return
numpy
.
mean
(
ROIPet
[
~
numpy
.
isnan
(
ROIPet
)])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment