Skip to content

Fix blank holes in line-by-line derotation - #76

Draft
divya-git03 wants to merge 2 commits into
neuroinformatics-unit:mainfrom
divya-git03:fix-derotation-blank-holes
Draft

divya-git03 wants to merge 2 commits into
neuroinformatics-unit:mainfrom
divya-git03:fix-derotation-blank-holes

Conversation

@divya-git03

Copy link
Copy Markdown

Summary

This draft PR implements a small neighbour-based interpolation step to address blank holes produced by the existing forward-mapping algorithm in line-by-line derotation.

  • Tracks which output pixels have actually been mapped.
  • Identifies eligible unmapped pixels using their neighbouring valid pixels.
  • Fills eligible holes using the average intensity of valid neighbours.
  • Adds a synthetic test to check that significant blank gaps are not left inside the image.

Tests

  • Targeted unit tests: 6 passed.
  • Full test suite: 72 passed, 2 failed.

The two failures are golden-image regression comparisons. Investigation showed that the changed pixels in both fixtures were previously blank pixels and are now interpolated. No previously nonblank pixels were changed in those comparisons.

Review requested

This is an initial draft focused only on interpolation using the current algorithm, as suggested in the issue discussion. The interpolation threshold is an initial implementation choice and would benefit from maintainer feedback.

Could you advise whether the expected golden-image fixtures should be updated to reflect the intended interpolation behaviour?

Displacement-field improvements are intentionally outside this PR's scope.

@divya-git03
divya-git03 marked this pull request as draft November 2, 2026 14:01

This branch has not been deployed

No deployments
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