Skip to content

pyramid formats are introduced - #52

Merged
Artur-man merged 2 commits into
develfrom
bioformats
Aug 7, 2026
Merged

pyramid formats are introduced#52
Artur-man merged 2 commits into
develfrom
bioformats

Conversation

@Artur-man

@Artur-man Artur-man commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@Artur-man

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude

claude Bot commented Aug 7, 2026

Copy link
Copy Markdown

Claude finished @Artur-man's task in 1m 53s —— View job


Claude's Review

  • Gather context (diff, repo guidelines)
  • Understand the request (code review)
  • Review changed files
  • Post review feedback

Summary

Good change — centralizing pyramid/BioFormats extensions into a single .PYRAMID_FORMATS vector (R/utils.R:207-220) is much easier to maintain and extend than the old inline regex in R/ImageArray.R.

Issues found

  1. Unescaped . in extensions creates a false-positive-prone regexR/ImageArray.R:495-496

    pyramid_formats <- paste(paste0(.PYRAMID_FORMATS, "$"), collapse = "|")
    if (grepl(pyramid_formats, image)) {

    Each entry in .PYRAMID_FORMATS (e.g. ".ome.tif") contains a literal . that grepl treats as "match any character" since the string isn't escaped or passed with fixed = TRUE. That means a filename like genome.tif or sample_xafi will also match .ome.tif$ / .afi$ respectively, since . in the pattern absorbs any single character (e.g. n before ome.tif, or x before afi). This bug pre-dates this PR (the original inline pattern had the same issue for .ome.tiff/.ome.tif/.qptiff/.qptif), but this PR both extends it to more extensions (.svs, .afi, .ndpi, .ndpis, .ome.tf2, .ome.tf8, .ome.btf) and centralizes the list — a good opportunity to fix it now, e.g.:

    pyramid_formats <- paste0(gsub("\\.", "\\\\.", .PYRAMID_FORMATS), "$", collapse = "|")

    or build the pattern with fixed = TRUE per-extension and combine with any(vapply(...)).

  2. Case sensitivity — some of the newly added formats (e.g. .SVS, .NDPI) commonly appear with uppercase extensions on Windows-originated scanner exports. grepl() here is case-sensitive by default; consider ignore.case = TRUE unless this is intentionally strict.

  3. Vignette typovignettes/ImageArray.Rmd:244: "(e.g. qptiff, svs, )." has a dangling comma before the closing parenthesis (should be "(e.g. qptiff, svs).").

  4. Uncertain commentsR/utils.R:218-219 has # CODEX ? next to .qptiff/.qptif, suggesting the format attribution wasn't confirmed. Worth double-checking (qptiff/qptif are actually PerkinElmer/Akoya Vectra "QPTIFF" format, used by CODEX/PhenoCycler pipelines but not CODEX-specific) and tidying the comment before merge.

Fix this →

No changes were implemented (review only, as requested).

@Artur-man
Artur-man merged commit d5598ef into devel Aug 7, 2026
10 of 12 checks passed
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