Skip to content

anatomical.select_rois applies the spatial high-pass twice (duplicated line since v1.0.0.1) #1270

Description

@cindykrafft

detection/anatomical.py::select_rois contains the same statement twice:

if settings.get("highpass_spatial", 0):
    img = np.clip(normalize99(img), 0, 1)
    img -= gaussian_filter(img, diameter[1] * settings["highpass_spatial"])
    img -= gaussian_filter(img, diameter[1] * settings["highpass_spatial"])

v0.14.4 has the subtraction once. The second line high-passes the already high-passed image, i.e. a stronger filter than highpass_spatial implies, which changes the image Cellpose segments (and therefore the ROI set) for anatomical-mode users who set highpass_spatial. If two passes are intended it would help to say so in the parameter description; otherwise the duplicate line can be dropped.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions