Skip to content

Fix #468: Implemented search space restrictions in all dimensions (z, y, x) for cell detection #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

0Anshu1
Copy link
Contributor

@0Anshu1 0Anshu1 commented Apr 9, 2025

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

  • Allows users to restrict the search space in all dimensions using coordinates like (:, 100:400, 200:500) for (z, y, x).
  • The implementation maintains compatibility with both napari plugin data and dask-loaded data, ensuring proper handling of boundary conditions and coordinate transformations.

What does this PR do?

  • Adds a new feature to run cell detection on a subvolume of an image and not just select z by :-
    1.) Adding new parameters to DetectionSettings class:
    - start_y, end_y: for restricting the y-dimension search space.
    - start_x, end_x: for restricting the x-dimension search space.
    - added roi_shape property to calculate the shape of the region of interest.
    - updated the main detection function in detect.py.

2.) modified DetectionSettings initialization to include these parameters.

References

How has this PR been tested?

  • Verified functionality with:

    • Full volume detection (no restrictions)
    • Partial volume detection in all dimensions
    • Edge cases (coordinates at/outside volume boundaries)
  • Tested with both:

    • Napari plugin interface
    • Direct dask array input

Is this a breaking change?

  • No

Does this PR require an update to the documentation?

  • No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Copy link
Contributor Author

@0Anshu1 0Anshu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the unwanted (as far as the changes in this PR are concerned)train_yaml.py file was pushed by mistake...deleted that one from this PR.

@0Anshu1 0Anshu1 marked this pull request as ready for review April 9, 2025 20:26
@0Anshu1
Copy link
Contributor Author

0Anshu1 commented Apr 9, 2025

Will raise a new PR shortly by fixing the conflicts and by adding tests also for covering the new functionality that I have added i.e. for region of interest. Closing this PR.

@adamltyson
Copy link
Member

Would you mind keeping everything in a single PR? Opening and closing multiple PRs makes it hard for the core developers to keep track of everything. Thanks!

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.

2 participants