Skip to content

Handle IndexError in cropInfo calculations (FUSE_det / localizingSample) . Defaults to whole image.#27

Open
DBP008 wants to merge 1 commit intopeng-lab:mainfrom
MMV-Lab:dp_fix
Open

Handle IndexError in cropInfo calculations (FUSE_det / localizingSample) . Defaults to whole image.#27
DBP008 wants to merge 1 commit intopeng-lab:mainfrom
MMV-Lab:dp_fix

Conversation

@DBP008
Copy link

@DBP008 DBP008 commented Oct 15, 2025

This PR fixes a bug in FUSE_det / localizingSample. No new functionality is introduced.

  • Type of change: Bug fix
  • Scope: leonardo_toolset/fusion/fuse_det.py
  • Backward compatibility: No breaking changes
  • Documentation: Not required (no new features)
  • Root cause: If thresholding fails, the segmentation arrays d1 or d2 derived from the mask are empty (np.array([])). Accessing d1[0]/d1[-1] or d2[0]/d2[-1] raises IndexError. The pipeline should still run with default behavior (whole image, no cropping).
  • Motivation: Ensure robustness on sparse or low-signal inputs where thresholding yields no objects; avoid hard failure and default to using the full image.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant