Skip to content

feat(masks): add tile_mask for drawing tile outlines - #54

Merged
matejpekar merged 2 commits into
mainfrom
claude/tile-mask
Oct 13, 2026
Merged

matejpekar merged 2 commits into
mainfrom
claude/tile-mask

Conversation

@vejtek

@vejtek vejtek commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Ports tile_mask from the GitLab rationai-masks library into ratiopath.masks. It is part of consolidating our libraries (DEV-161): ratiopath covers everything masks did except this function, so with it new projects don't need rationai-masks at all.

Changes

  • ratiopath/masks/tile_mask.py: same behaviour as the original. It draws tile outlines into a mode L image. The docstring example now passes the tile extent as (width, height); the original example passed (height, width), which only worked for square tiles.
  • Exported from ratiopath.masks, reference page in the docs and added to the nav.
  • tests/test_tile_mask.py: outline placement, width/height order, empty input.

Checks

  • pytest: 376 passed.
  • mypy: clean.
  • mkdocs build --strict: passes.
  • ruff check / ruff format --check: clean on the changed files. With the current ruff, main itself already has 11 ruff check findings (RUF036, BLE001) and 7 files ruff format would change. They are untouched here.

Not in this PR

  • rationai-masks is still a dependency of about 12 GitHub repos, including mlkit (HeatmapAssembler) and the machine-learning template (tissue_mask). Moving those over is a separate step.

🤖 Generated with Claude Code

Ported from the GitLab rationai-masks library so new projects can use
ratiopath alone. The docstring example now passes the tile extent as
(width, height), matching the drawing code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3d5cd88-d3f4-4918-b17f-ce241e1b23fe
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Preview URL: https://RationAI.github.io/ratiopath/claude-tile-mask/

@vejtek
vejtek marked this pull request as ready for review October 13, 2026 15:09
@vejtek
vejtek requested review from a team, Adames4 and matejpekar October 13, 2026 15:09
@vejtek

vejtek commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

The failing Ruff job comes from findings already on main, not from this change. #55 fixes them. Once #55 is merged, I will merge main into this branch so the checks re-run.

@matejpekar
matejpekar merged commit 7fa1241 into main Oct 13, 2026
7 checks passed
@matejpekar
matejpekar deleted the claude/tile-mask branch October 13, 2026 21:14
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.

3 participants