Skip to content

Assorted minor issues found during the 1.1.6 pre-release audit #50

Description

@PierreRaybaut

Summary

Small, low-risk issues found during the pre-release audit of 1.1.6. Grouped here because none of them warrants an issue of its own.

1. Wrong wording in a signal error message

sigima/objects/signal/creation.py, in __get_signal_parameters_class:

f"Image type {stype} has no parameters class registered"

This is a signal module; the message should read "Signal type".

2. magnitude_spectrum has no guard against log10(0)

sigima/tools/signal/fourier.py computes 20 * log10(...) without clamping, which yields -inf and a RuntimeWarning whenever the spectrum contains an exact zero.

3. Undocumented Fourier conventions

  • fft1d uses the raw, unnormalised numpy.fft.fft; the docstring does not say so.
  • psd relies on scipy.signal.welch's default scaling='density'; the docstring does not state which scaling is applied.

4. Blob detection conflates sigma and radius

sigima/tools/image/detection.py::__blobs_to_coords names the third column of the scikit-image output radii and returns it as-is:

cy, cx, radii = blobs.T

That column is scikit-image's sigma, not a radius: for blob_log and blob_dog the blob radius is approximately √2·σ, while for blob_doh it is approximately σ. The docstrings compound the confusion by describing the min_sigma / max_sigma parameters as "the minimum/maximum blob radius in pixels".

Changing the returned value would alter the size of auto-generated ROIs and of the displayed circles, so this issue only covers correcting the documentation. The convention change itself is tracked separately.

5. Undocumented input convention for the model-fitting helpers

fit_circle_model and fit_ellipse_model in sigima/tools/image/preprocessing.py expect the contour coordinates in (row, col) order; this is not documented.

Scope

  • Fix the "Image type" wording in sigima/objects/signal/creation.py
  • Guard magnitude_spectrum against log10(0)
  • Document fft1d normalisation and psd scaling
  • Document the sigma-vs-radius semantics in find_blobs_log, find_blobs_dog, find_blobs_doh and __blobs_to_coords
  • Document the (row, col) input convention of fit_circle_model / fit_ellipse_model
  • Release note

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions