Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions docs/source/Math/f_glcm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ Notation
* - Symbol
- Meaning
* - :math:`N_g`
- Number of grey levels.
- Number of grey levels, :math:`1 \ldots N_g`. With MATLAB-style and IBSI binning it is
the bin count. With PyRadiomics-style binning it is the highest level present in the ROI,
and the ROI need not occupy every level below it; an absent level has :math:`p_{ij} = 0`
in its row and column.
* - :math:`i,\; j`
- Grey level of the reference pixel (:math:`i`) and of its neighbour :math:`\delta` pixels
along :math:`\theta` (:math:`j`).
Expand Down Expand Up @@ -807,18 +810,14 @@ ROI with too many grey levels
applies to a ``--coarseGrayDepth`` above 46340. A ROI covered by "Constant ROI" above returns
before any matrix is sized, so it gets neither the substitute nor the message.

Grey-level values and indices
With PyRadiomics-style binning (negative ``--coarseGrayDepth``) the grey levels are the distinct
binned values present in the ROI. Most features use those values, but ``DIS``, ``HOM1``,
``HOM2``, ``DIFENTRO``, ``SUMENTROPY`` and the inverse-difference features use positions 1 to
:math:`N_g` in that list, and ``IDN`` and ``IDMN`` divide by :math:`N_g`, the number of levels
present. ``DIFAVE``, ``SUMAVERAGE``, ``IV``, ``JVAR`` and ``DIFVAR`` are a known defect
(`#510 <https://github.com/PolusAI/nyxus/issues/510>`__) and, when the levels present are not
consecutive, match neither convention. ``DIFAVE``, ``SUMAVERAGE`` and ``IV`` group pairs by the
difference or sum of their positions, but weight each group by the value difference or sum of
one pair in it. ``JVAR`` takes positions minus ``JAVE``, a mean of values, and ``DIFVAR`` takes
position differences minus ``DIFAVE``. Values and positions coincide with the default binning
and in IBSI mode.
Levels absent from the ROI
With PyRadiomics-style binning (negative ``--coarseGrayDepth``) the matrix holds a row and a
column only for the binned levels present in the ROI, and a CT ROI at 20 bins often leaves some
of them empty: a dense block of low levels and a few voxels alone in the top bin. Every feature
still works on the grey levels themselves, as in PyRadiomics: :math:`p_{x+y}` and
:math:`p_{x-y}` group pairs by the sum and difference of their levels, :math:`|i-j|` in ``DIS``,
``HOM1`` and ``HOM2`` is a difference of levels, and :math:`N_g` in ``IDN`` and ``IDMN`` is the
highest level present, not the count of levels present.


Validation
Expand All @@ -827,7 +826,8 @@ Validation
The test suite checks every 2D GLCM feature against an independent implementation, named in the
:ref:`index <glcm-index>`. PyRadiomics and MIRP are compared on matched settings (symmetric matrix,
identical grey levels), and IBSI mode reproduces the IBSI consensus values on the IBSI digital
phantom. Because the reference tools count pairs symmetrically, the default asymmetric counting is
phantom. PyRadiomics is also compared with PyRadiomics-style binning (20 bins) on a crop of a CT
image whose levels leave bins empty, which is where a grey level and its row in the matrix differ. Because the reference tools count pairs symmetrically, the default asymmetric counting is
covered by regression tests only.


Expand Down
11 changes: 5 additions & 6 deletions docs/source/Math/f_glcm_3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,9 @@ Constant ROI
``set_metaparam("3glcm/greydepth=8")``, ``get_metaparam("3glcm/greydepth")`` returns 64, the
2D default. The features use the value that was set.

Grey-level values and indices
As in 2D, with PyRadiomics-style binning some features use positions 1 to :math:`N_g` in the
list of grey levels present, and others the levels themselves. ``DIFAVE``, ``SUMAVERAGE``,
``IV``, ``JVAR`` and ``DIFVAR`` mix the two as on the 2D page, a known defect
(`#510 <https://github.com/PolusAI/nyxus/issues/510>`__).
Levels absent from the ROI
As in 2D, with PyRadiomics-style binning every feature works on the grey levels themselves when
some bins are empty, and :math:`N_g` in ``IDN`` and ``IDMN`` is the highest level present.


Validation
Expand All @@ -644,7 +642,8 @@ Validation
The test suite checks every 3D GLCM feature against PyRadiomics 3.0.1 with PyRadiomics-style
binning (20 bins), where both matrices are symmetric. Each plain feature is compared direction by
direction, all 13 values against PyRadiomics' own per-direction values, and each ``_AVE`` code
against PyRadiomics' direction-averaged value. Entropy features are compared at a looser tolerance
against PyRadiomics' direction-averaged value. A second fixture, a crop of a CT volume whose levels
leave bins empty, is compared feature by feature on the direction-averaged values. Entropy features are compared at a looser tolerance
because of the approximate logarithm. Values with the default binning are covered by regression
tests only, and IBSI mode only by the worked-example script on this page.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Math/glcm_3d_index.inc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* - :ref:`3GLCM_ENTROPY <feature-3glcm-entropy>`
- Entropy (same as joint entropy)
- —
- PyRadiomics (rel. 1e-9)
- PyRadiomics (rel. 1e-3, rel. 1e-9)
- 3.808
* - :ref:`3GLCM_HOM1 <feature-3glcm-hom1>`
- Homogeneity 1 (same as inverse difference)
Expand Down
18 changes: 9 additions & 9 deletions docs/source/Math/glcm_index.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* - :ref:`GLCM_ACOR <feature-glcm-acor>`
- Autocorrelation
- QWB0
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 6.85
* - :ref:`GLCM_CLUPROM <feature-glcm-cluprom>`
- Cluster prominence
Expand All @@ -28,7 +28,7 @@
* - :ref:`GLCM_CLUSHADE <feature-glcm-clushade>`
- Cluster shade
- 7NFM
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 4.8
* - :ref:`GLCM_CLUTEND <feature-glcm-clutend>`
- Cluster tendency
Expand Down Expand Up @@ -73,7 +73,7 @@
* - :ref:`GLCM_ENTROPY <feature-glcm-entropy>`
- Entropy (same as joint entropy)
- —
- MIRP (rel. 5e-3)
- MIRP (rel. 5e-3), PyRadiomics (rel. 5e-3)
- 3.805
* - :ref:`GLCM_HOM1 <feature-glcm-hom1>`
- Homogeneity 1 (same as inverse difference)
Expand All @@ -83,7 +83,7 @@
* - :ref:`GLCM_HOM2 <feature-glcm-hom2>`
- Homogeneity 2 (same as inverse difference moment)
- —
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 0.45
* - :ref:`GLCM_ID <feature-glcm-id>`
- Inverse difference
Expand All @@ -108,7 +108,7 @@
* - :ref:`GLCM_INFOMEAS1 <feature-glcm-infomeas1>`
- Information measure of correlation 1
- R8DG
- MIRP (rel. 5e-3)
- MIRP (rel. 5e-3), PyRadiomics (rel. 5e-3)
- −0.2276
* - :ref:`GLCM_INFOMEAS2 <feature-glcm-infomeas2>`
- Information measure of correlation 2
Expand All @@ -123,7 +123,7 @@
* - :ref:`GLCM_JAVE <feature-glcm-jave>`
- Joint average
- 60VM
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 2.5
* - :ref:`GLCM_JE <feature-glcm-je>`
- Joint entropy
Expand All @@ -138,12 +138,12 @@
* - :ref:`GLCM_JVAR <feature-glcm-jvar>`
- Joint variance
- UR99
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 2.05
* - :ref:`GLCM_SUMAVERAGE <feature-glcm-sumaverage>`
- Sum average
- ZGXS
- MIRP (rel. 1e-9)
- MIRP (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 5
* - :ref:`GLCM_SUMENTROPY <feature-glcm-sumentropy>`
- Sum entropy
Expand All @@ -158,5 +158,5 @@
* - :ref:`GLCM_VARIANCE <feature-glcm-variance>`
- Variance
- —
- IBSI (rel. 1e-9)
- IBSI (rel. 1e-9), PyRadiomics (rel. 1e-9)
- 2.05
62 changes: 31 additions & 31 deletions docs/source/featurelist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -890,13 +890,13 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_ACOR``
- Autocorrelation: the co-occurrence-weighted mean of the product of the two grey levels of a pixel pair, which grows with both coarseness and brightness.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_CLUPROM``
- Cluster prominence: the fourth moment of the sum of the two grey levels of a pair about twice the neighbour pixel's mean grey level, which is large when that distribution is asymmetric or heavy-tailed.
- vetted: PyRadiomics
* - ``GLCM_CLUSHADE``
- Cluster shade: the third moment of the sum of the two grey levels of a pair about twice the neighbour pixel's mean grey level, which measures the skewness of the co-occurrence matrix.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_CLUTEND``
- Cluster tendency: the second moment of the sum of the two grey levels of a pair about twice the neighbour pixel's mean grey level, which measures how strongly pairs group into similar grey levels.
- vetted: PyRadiomics
Expand All @@ -923,13 +923,13 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_ENTROPY``
- Entropy: the base-2 entropy of the co-occurrence probabilities, which is high when many grey-level pairs are about equally likely; it returns the same value as GLCM_JE.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_HOM1``
- Homogeneity 1: the co-occurrence probabilities weighted by one over one plus the grey-level difference of the pair; it returns the same value as GLCM_ID.
- vetted: PyRadiomics
* - ``GLCM_HOM2``
- Homogeneity 2: the co-occurrence probabilities weighted by one over one plus the squared grey-level difference of the pair; it returns the same value as GLCM_IDM and has no _AVE code.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_ID``
- Inverse difference: the co-occurrence probabilities weighted by one over one plus the grey-level difference of the pair, which is high when paired pixels have similar grey levels.
- vetted: PyRadiomics
Expand All @@ -944,7 +944,7 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_INFOMEAS1``
- Informational measure of correlation 1: the joint entropy minus the entropy expected if the two grey levels were independent, divided by the entropy of one marginal distribution; it measures how much the two grey levels depend on each other.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_INFOMEAS2``
- Informational measure of correlation 2: a 0-to-1 measure of the dependence between the two grey levels of a pair, computed from the gap between the joint entropy and the entropy of the product of the marginals.
- vetted: PyRadiomics
Expand All @@ -953,7 +953,7 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_JAVE``
- Joint average: the co-occurrence-weighted mean grey level of the reference pixel of a pair.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_JE``
- Joint entropy: the base-2 entropy of the co-occurrence probabilities, which is high when many grey-level pairs are about equally likely.
- vetted: PyRadiomics
Expand All @@ -962,10 +962,10 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_JVAR``
- Joint variance: the co-occurrence-weighted spread of the neighbour pixel's grey level around the joint average (the reference pixel's mean); it equals GLCM_VARIANCE only when the matrix is symmetric.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_SUMAVERAGE``
- Sum average: the mean of the sum of the two grey levels of a pixel pair.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_SUMENTROPY``
- Sum entropy: the base-2 entropy of the distribution of the sum of the two grey levels of a pixel pair.
- vetted: PyRadiomics
Expand All @@ -974,22 +974,22 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_VARIANCE``
- Variance: the co-occurrence-weighted variance of the reference pixel's grey level about its mean (PyRadiomics sum of squares).
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_ASM_AVE``
- Angular second moment, averaged over the angles.
- vetted: PyRadiomics
* - ``GLCM_ACOR_AVE``
- Autocorrelation, averaged over the angles.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_CLUPROM_AVE``
- Cluster prominence, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_CLUSHADE_AVE``
- Cluster shade, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_CLUTEND_AVE``
- Cluster tendency, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_CONTRAST_AVE``
- Contrast, averaged over the angles.
- vetted: PyRadiomics
Expand All @@ -998,70 +998,70 @@ Definitions, formulas and settings: :doc:`/Math/f_glcm`.
- vetted: PyRadiomics
* - ``GLCM_DIFAVE_AVE``
- Difference average, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_DIFENTRO_AVE``
- Difference entropy, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_DIFVAR_AVE``
- Difference variance, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_DIS_AVE``
- Dissimilarity, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_ENERGY_AVE``
- Energy, averaged over the angles.
- vetted: PyRadiomics
* - ``GLCM_ENTROPY_AVE``
- Entropy, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_HOM1_AVE``
- Homogeneity 1, averaged over the angles.
- vetted: PyRadiomics
* - ``GLCM_ID_AVE``
- Inverse difference, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_IDN_AVE``
- Inverse difference normalized, averaged over the angles.
- vetted: PyRadiomics
* - ``GLCM_IDM_AVE``
- Inverse difference moment, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_IDMN_AVE``
- Inverse difference moment normalized, averaged over the angles.
- vetted: PyRadiomics
* - ``GLCM_IV_AVE``
- Inverse variance, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_JAVE_AVE``
- Joint average, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_JE_AVE``
- Joint entropy, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_INFOMEAS1_AVE``
- Informational measure of correlation 1, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_INFOMEAS2_AVE``
- Informational measure of correlation 2, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_VARIANCE_AVE``
- Variance, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_JMAX_AVE``
- Joint maximum, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_JVAR_AVE``
- Joint variance, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_SUMAVERAGE_AVE``
- Sum average, averaged over the angles.
- vetted: MIRP
- vetted: MIRP, PyRadiomics
* - ``GLCM_SUMENTROPY_AVE``
- Sum entropy, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics
* - ``GLCM_SUMVARIANCE_AVE``
- Sum variance, averaged over the angles.
- vetted: IBSI
- vetted: IBSI, PyRadiomics

.. _features-glrlm:

Expand Down
Loading
Loading