Skip to content

Commit

Permalink
Add warning that unit support is not yet available for masking kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Apr 19, 2024
1 parent 80e7542 commit c79bee3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions fil_finder/filfinderPPV.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def create_mask(self, adapt_thresh=9, glob_thresh=0.0,
"""

warnings.warn("Units are not yet supported for kwargs. Please provide pixel units",
UserWarning)

if self.mask is not None and use_existing_mask:
warnings.warn("Using inputted mask. Skipping creation of a"
"new mask.")
Expand Down Expand Up @@ -165,8 +168,15 @@ def create_mask(self, adapt_thresh=9, glob_thresh=0.0,
close = mo.closing(dilate)

# Don't allow small holes: these lead to "shell"-shaped skeleton features
mo.remove_small_objects(close, min_size=min_object_size, connectivity=1, in_place=True)
mo.remove_small_holes(close, area_threshold=max_hole_size, connectivity=1, in_place=True)
# Specify out to avoid duplicating the mask in memory
close = mo.remove_small_objects(close,
min_size=min_object_size,
connectivity=1,
out=close)
close = mo.remove_small_holes(close,
area_threshold=max_hole_size,
connectivity=1,
out=close)

self.mask = close

Expand Down

0 comments on commit c79bee3

Please sign in to comment.