From 6d710a8d8ffd48b5adcf4b498c67c3ebb073f0ad Mon Sep 17 00:00:00 2001 From: Artur-man Date: Fri, 7 Aug 2026 11:40:23 +0200 Subject: [PATCH 1/2] pyramid formats are introduced --- R/ImageArray.R | 3 ++- R/utils.R | 16 ++++++++++++++++ vignettes/ImageArray.Rmd | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/R/ImageArray.R b/R/ImageArray.R index 2d65a6f..117ccfa 100644 --- a/R/ImageArray.R +++ b/R/ImageArray.R @@ -492,7 +492,8 @@ ImageArray <- function( # create ImageArray from file path if (inherits(image, "character")) { - if (grepl(".ome.tiff$|.ome.tif$|.qptiff$|.qptif$", image)) { + pyramid_formats <- paste(paste0(.PYRAMID_FORMATS, "$"), collapse = "|") + if (grepl(pyramid_formats, image)) { image <- BFPath(image, series, resolution) } else { image <- read_image(image, engine = engine) diff --git a/R/utils.R b/R/utils.R index f034f2c..c55a045 100644 --- a/R/utils.R +++ b/R/utils.R @@ -202,3 +202,19 @@ is.sequential <- function(x) { #' @keywords internal #' @noRd .TEMPLATE_SCALES <- c(c = 1, y = 1, x = 1, z = 1, t = 0.1) + +#' @keywords internal +#' @noRd +.PYRAMID_FORMATS <- c( + ".ome.tiff", # OME-TIFF pyramidal TIFF variants (OME-TIFF and related) + ".ome.tif", + ".ome.tf2", + ".ome.tf8", + ".ome.btf", + ".svs", # Aperio SVS + ".afi", # Aperio AFI + ".ndpi", # Hamamatsu NDPI + ".ndpis", # Hamamatsu NDPI variants + ".qptiff", # CODEX ? + ".qptif" # CODEX ? +) diff --git a/vignettes/ImageArray.Rmd b/vignettes/ImageArray.Rmd index e438dde..b3c7a88 100644 --- a/vignettes/ImageArray.Rmd +++ b/vignettes/ImageArray.Rmd @@ -240,6 +240,10 @@ imgarray <- ImageArray(ome.tiff.file, series = 1, resolution = 1) imgarray ``` +`r Biocpkg("ImageArray")` is also capable of reading other BioFormats +compatible image formats (e.g. qptiff, svs, ). For more information, visit the [Supported Formats](https://bio-formats.readthedocs.io/en/v8.3.0/supported-formats.html) +webpage of BioFormats. + # Image Transformations `r Biocpkg("ImageArray")` provides image transformation functions that operate From a4b058d8eac5472d0ce35d77068bcc751494937f Mon Sep 17 00:00:00 2001 From: Artur-man Date: Fri, 7 Aug 2026 17:36:00 +0200 Subject: [PATCH 2/2] claude fixes and version bump --- DESCRIPTION | 2 +- NEWS.md | 8 ++++++++ R/ImageArray.R | 5 +++-- vignettes/ImageArray.Rmd | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 904fa95..a1c4f12 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ImageArray Type: Package Title: A framework for on-disk and in-memory image arrays -Version: 1.1.5 +Version: 1.1.6 Authors@R: c( person("Artür", "Manukyan", role=c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index b17e2e0..a623592 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# ImageArray 1.1.6 + +## New features + +* `ImageArray` function now accepts Bioformats compatible image pyramid + formats beyond ome.tiff and qptiff. See https://bio-formats.readthedocs.io/en/latest/supported-formats.html + for more information. + # ImageArray 1.1.5 ## New features diff --git a/R/ImageArray.R b/R/ImageArray.R index 117ccfa..2c741ed 100644 --- a/R/ImageArray.R +++ b/R/ImageArray.R @@ -492,8 +492,9 @@ ImageArray <- function( # create ImageArray from file path if (inherits(image, "character")) { - pyramid_formats <- paste(paste0(.PYRAMID_FORMATS, "$"), collapse = "|") - if (grepl(pyramid_formats, image)) { + pyramid_formats <- paste0(gsub("\\.", "\\\\.", .PYRAMID_FORMATS), + "$", collapse = "|") + if (grepl(pyramid_formats, image, ignore.case = TRUE)) { image <- BFPath(image, series, resolution) } else { image <- read_image(image, engine = engine) diff --git a/vignettes/ImageArray.Rmd b/vignettes/ImageArray.Rmd index b3c7a88..85f946a 100644 --- a/vignettes/ImageArray.Rmd +++ b/vignettes/ImageArray.Rmd @@ -241,7 +241,8 @@ imgarray ``` `r Biocpkg("ImageArray")` is also capable of reading other BioFormats -compatible image formats (e.g. qptiff, svs, ). For more information, visit the [Supported Formats](https://bio-formats.readthedocs.io/en/v8.3.0/supported-formats.html) +compatible image formats (e.g. qptiff, svs). For more information, visit the +[Supported Formats](https://bio-formats.readthedocs.io/en/v8.3.0/supported-formats.html) webpage of BioFormats. # Image Transformations