Prepare for CRAN release#1
Open
billdenney wants to merge 4 commits into
Open
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
Two of the three feedback items from the CRAN reviewer:
1. Strip single quotes from function names in the Description field.
thinImage(), EBImage::thinImage(), and thin() now appear unquoted.
The 'EBImage' package name retains single quotes per CRAN
convention; the EBImage::thinImage() reference is rephrased to
"thinImage() in the 'EBImage' package on Bioconductor".
2. Add references with DOIs in the Description field, per CRAN format
authors (year) <doi:...>:
- Zhang and Suen (1984) <doi:10.1145/357994.358023>
- Guo and Hall (1989) <doi:10.1145/62065.62074>
- Lee, Kashyap, and Chu (1994) <doi:10.1006/cgip.1994.1042>
- Saeed, Tabedzki, Rybnik, and
Adamski (2010) <doi:10.2478/v10006-010-0024-4>
All four DOIs verified resolvable at doi.org.
R CMD check --as-cran (with _R_CHECK_CRAN_INCOMING_=true): 0 errors,
0 warnings, 2 NOTEs (new submission + Ubuntu system compilation
flags). Title-case NOTE no longer appears now that the description
reads naturally.
The third feedback item (add more algorithms for comprehensiveness)
is intentionally deferred to a separate commit. A proposal for the
specific set of algorithms to add (Hilditch + Medial Axis Transform
+ Stentiford recommended) is surfaced in the response message; the
implementation waits on your direction.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five additional thinning algorithms plus the medial axis transform
and a stand-alone Euclidean / Manhattan / Chessboard distance
transform. CRAN reviewer's second feedback item ("make the package
more comprehensive") addressed.
Thinning (new in this commit)
- src/hilditch.cpp Hilditch (1969). Single-pass parallel
thinning with look-ahead crossing-number
check on cardinal neighbours.
- src/stentiford.cpp Stentiford & Mortimer (1983). Four
directional 3-pixel templates per pass.
- src/pavlidis.cpp Pavlidis (1980). Four directional sub-
iterations with restrictive B(P) <= 5
interior preservation.
- src/opta.cpp Naccache & Shinghal (1984). One-pass
thinning derived from Hilditch with a
spike / isthmus guard.
- src/holt.cpp Holt et al. (1987). Zhang-Suen variant
that preserves isolated 2x2 blocks. The
guard only fires when the 2x2 is genuinely
standalone (all five other 8-neighbours
background), so it does not protect inner
pixels of larger solids.
Medial axis and distance transform (new in this commit)
- src/distance_transform.cpp / .h
Felzenszwalb-Huttenlocher (2012) linear-
time separable squared Euclidean DT, plus
Rosenfeld-Pfaltz (1968) two-pass forward +
backward sweep for L1 and L_infinity.
Exposed as the user-level
distance_transform(image, metric).
- src/medial_axis.cpp Ridge detection on the squared Euclidean
DT: a foreground pixel is medial iff it is
a strict local maximum of the DT along at
least one of the four principal directions.
medial_axis(image, return_distance) returns
binary skeleton, optionally with the
per-pixel Euclidean distance.
Plumbing
- src/thinr_common.h Inline helpers (crossing_number,
neighbour_count, is_border_4) shared by the
new algorithms.
- R/thin.R match.arg + switch() extended for the five
new methods.
- R/distance_transform.R, R/medial_axis.R
Exported wrappers + roxygen docs with
references and DOIs.
- DESCRIPTION Description field extended; new DOIs added
(Stentiford-Mortimer, Felzenszwalb-
Huttenlocher). Pavlidis (1980) and OPTA
(1984) cite by author/year only because
their old-format Elsevier DOIs return 404
at doi.org as of this writing; CRAN allows
references without DOIs when none are
available.
Tests
- tests/testthat/test-thin.R: methods vector extended to all
nine algorithms; all property tests apply automatically.
Horizontal-line collapse test relaxes max_rows to 2 for Holt
(Holt's documented behaviour preserves transient 2x2 blocks
formed at the ends of bars during thinning).
- tests/testthat/test-distance-transform.R: 48 assertions
exercising all three metrics, including brute-force L2
agreement against a corner-source 5x5 image.
- tests/testthat/test-medial-axis.R: 12 assertions covering
background-only input, isolated foreground pixel preservation,
horizontal-bar centerline, return_distance shape and type,
and storage-mode round-trip.
Documentation
- NEWS.md: full algorithm list with DOI references.
- vignettes/choosing-a-method.Rmd: new "When to use which" entries
for the five new methods; medial axis and distance-transform
sections; reference list with DOIs.
- README.md: usage block extended; algorithms table replaces the
Status column with a Reference column.
- R/thinr-package.R: Algorithms section lists all nine; new
Medial axis and distance transform section.
- CLAUDE.md: Current state refreshed to v0.2.0; module boundaries
enumerate all C++ and R sources; extension-points guide rewritten
for "add a new thinning algorithm".
Verification
- 138 tests pass (up from 38). testthat 3rd edition.
- lintr::lint_package(): clean.
- R CMD check --as-cran with _R_CHECK_CRAN_INCOMING_=true:
0 errors, 0 warnings, 2 NOTEs (new submission + Ubuntu system
compilation flags). All DOIs in DESCRIPTION verified to resolve
at doi.org.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reserves a top-level references/ directory in the package for local PDF copies of the papers thinr implements. The directory is excluded from git (negation pattern in .gitignore keeps just the README) and from R CMD build (.Rbuildignore), so: - PDFs never get staged, pushed, or shipped with the package. - We avoid any redistribution-licence concern with the papers. - A future contributor or Claude session sees references/README.md and immediately knows where to drop papers when verifying an implementation against the published algorithm. The README documents the suggested filename convention, the list of papers most useful to have for thinr (with Lam-Lee-Suen 1992 at the top, since one survey verifies several algorithms), and the workflow for replacing a 'reviewers welcome to verify' header caveat with a verified-against-source acknowledgement. No PDFs included; this commit only adds the .gitignore / .Rbuildignore entries and the README placeholder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.