Skip to content

Commit

Permalink
Match structure in dynamic adjacency detection
Browse files Browse the repository at this point in the history
  • Loading branch information
joeranbosma committed Mar 23, 2022
1 parent 3594322 commit fdf08f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
long_description = fh.read()

setuptools.setup(
version='0.2.2',
version='0.2.3',
author_email='[email protected]',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
11 changes: 2 additions & 9 deletions src/report_guided_annotation/extract_lesion_candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,8 @@ def preprocess_softmax_dynamic(
# create mask with its confidence
hard_blob = (all_hard_blobs * mask_current_lesion)

# Detect whether the extractted mask is a ring/hollow sphere
# around an existing lesion candidate. For confident lesions,
# the surroundings of the prediction are still quite confident,
# and can become a second 'detection'. For an # example, please
# see extracted lesion candidates nr. 4 and 5 at:
# https://repos.diagnijmegen.nl/trac/ticket/9299#comment:49
# Detection method: grow currently extracted lesions by one voxel,
# and check if they overlap with the current extracted lesion.
extracted_lesions_grown = ndimage.morphology.binary_dilation(dynamic_hard_blobs > 0)
# Detect whether the extractted mask is too close to an existing lesion candidate
extracted_lesions_grown = ndimage.morphology.binary_dilation(dynamic_hard_blobs > 0, structure=np.ones((3, 3, 3)))
current_lesion_has_overlap = (mask_current_lesion & extracted_lesions_grown).any()

# Check if lesion candidate should be retained
Expand Down

0 comments on commit fdf08f0

Please sign in to comment.