Skip to content

[BUG]: background channel is required even when skip_classification=True (single-channel flow breaks) #605

@ishansurdi

Description

@ishansurdi

Describe the bug
I found that the Python API still requires a background channel even when skip_classification=True.
This seems wrong because if classification is skipped, background should not be mandatory.
Right now this blocks single-channel detection-only use cases.

To Reproduce

  1. Create a valid 3D signal_array.
  2. Call cellfinder.core.main.main(...) with:
    • signal_array=<3D array>
    • voxel_sizes=(5, 2, 2) (any valid voxel sizes)
    • skip_classification=True
    • do not pass background_array
  3. It fails with:
    • TypeError: main() missing 1 required positional argument: 'background_array'

I also checked classification function behavior with background_array=None and saw:

  • AttributeError: 'NoneType' object has no attribute 'ndim'

Expected behaviour
If skip_classification=True, run should work with signal-only input.
Background should only be required when classification is enabled.

Log file
No separate log file attached yet.
I reproduced using local script run:
python -u _bug_demo.py
and got the errors above consistently.

Screenshots
No screenshots (this report is based on Python/API repro, not UI testing).

Computer used (please complete the following information):

  • OS: Windows
  • Version: Windows 11

Additional context
This seems related to feature request #352 (make background channel optional).
I think this is a concrete blocker bug inside that larger feature work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions