Skip to content

Commit

Permalink
docs: improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jun 6, 2024
1 parent 12082ae commit 77e3621
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dcnum/feat/feat_background/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_ppid(self):
"""Return a unique background pipeline identifier
The pipeline identifier is universally applicable and must
be backwards-compatible (future versions of dcevent will
be backwards-compatible (future versions of dcnum will
correctly acknowledge the ID).
The segmenter pipeline ID is defined as::
Expand Down
29 changes: 28 additions & 1 deletion src/dcnum/feat/feat_texture/tex_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@

def haralick_texture_features(
mask, image=None, image_bg=None, image_corr=None):
"""Compute Haralick texture features
The following texture features are excluded
- feature 6 "Sum Average", which is equivalent to `2 * bright_bc_avg`
since dclab 0.44.0
- feature 10 "Difference Variance", because it has a functional
dependency on the offset value and since we do background correction,
we are not interested in it
- feature 14, because nobody is using it, it is not understood by
everyone what it actually is, and it is computationally expensive.
This leaves us with the following 11 texture features (22 if you count
avg and ptp):
https://earlglynn.github.io/RNotes/package/EBImage/Haralick-Textural-Features.html
- 1. `tex_asm`: (1) Angular Second Moment
- 2. `tex_con`: (2) Contrast
- 3. `tex_cor`: (3) Correlation
- 4. `tex_var`: (4) Variance
- 5. `tex_idm`: (5) Inverse Difference Moment
- 6. `tex_sva`: (7) Sum Variance
- 7. `tex_sen`: (8) Sum Entropy
- 8. `tex_ent`: (9) Entropy
- 9. `tex_den`: (11) Difference Entropy
- 10. `tex_f12`: (12) Information Measure of Correlation 1
- 11. `tex_f13`: (13) Information Measure of Correlation 2
"""
# make sure we have a boolean array
mask = np.array(mask, dtype=bool)
size = mask.shape[0]
Expand All @@ -22,7 +50,6 @@ def haralick_texture_features(

for ii in range(size):
# Haralick texture features
# https://gitlab.gwdg.de/blood_data_analysis/dcevent/-/issues/20
# Preprocessing:
# - create a copy of the array (don't edit `image_corr`)
# - add grayscale values (negative values not supported)
Expand Down
4 changes: 2 additions & 2 deletions src/dcnum/feat/gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, data, *,
Parameters
----------
data: .HDF5Data
dcevent data instance
dcnum data instance
online_gates: bool
set to True to enable gating with "online" gates stored
in the input file; online gates are applied in real-time
Expand Down Expand Up @@ -95,7 +95,7 @@ def get_ppid(self):
"""Return a unique gating pipeline identifier
The pipeline identifier is universally applicable and must
be backwards-compatible (future versions of dcevent will
be backwards-compatible (future versions of dcnum will
correctly acknowledge the ID).
The gating pipeline ID is defined as::
Expand Down
2 changes: 1 addition & 1 deletion src/dcnum/feat/queue_event_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get_ppid(self):
"""Return a unique feature extractor pipeline identifier
The pipeline identifier is universally applicable and must
be backwards-compatible (future versions of dcevent will
be backwards-compatible (future versions of dcnum will
correctly acknowledge the ID).
The feature extractor pipeline ID is defined as::
Expand Down

0 comments on commit 77e3621

Please sign in to comment.