Add optional border padding to detection pipeline#602
Add optional border padding to detection pipeline#602vijayalakshmipokala wants to merge 5 commits intobrainglobe:mainfrom
Conversation
|
Hi maintainers, Thank you for the automated checks. The failure reported by the Ruff linter was due to an unused variable ( I have removed the unused variable and pushed the update to this branch. This change only addresses the linting issue and does not affect the behaviour of the test or the functionality of the PR. Please let me know if any additional changes are required. Thank you for reviewing the contribution. |
|
Among other things, this would actually shift the original coordinates by the |
|
Thank you for pointing this out. You are correct that padding the input volume would shift the detected coordinates by the pad_width value. I will update the implementation so that after detection the padding offset is removed from the predicted coordinates, ensuring they remain aligned with the original image space. I will push an update shortly to handle this adjustment. |
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
Detection near the borders of a 3D image volume can sometimes miss structures because filtering operations have limited context at the edges. Adding optional padding allows the detection pipeline to operate with additional border context when desired, while keeping the default behaviour unchanged.
What does this PR do?
This PR adds optional padding to the input signal_array before running the detection pipeline in cellfinder.
New parameters added to main() in detect.py:
References
No existing issue directly referenced.
This PR proposes an enhancement to improve border detection behaviour.
Please reference any existing issues/PRs that relate to this PR.
How has this PR been tested?
python -m pytest
Please explain how any new code has been tested, and how you have ensured that no existing functionality has changed.
Results:
1264 tests passed
14 tests skipped
2 tests marked as expected failures
No existing tests failed.
Is this a breaking change?
No.
Default behaviour remains unchanged because padding is disabled by default (pad_border=False).
If this PR breaks any existing functionality, please explain how and why.
Does this PR require an update to the documentation?
No documentation updates have been made yet. The feature introduces optional parameters but does not change existing behaviour.
If any features have changed, or have been added. Please explain how the documentation has been updated (and link to the associated PR). See here for details.
Checklist: