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 2d65a6f..2c741ed 100644 --- a/R/ImageArray.R +++ b/R/ImageArray.R @@ -492,7 +492,9 @@ ImageArray <- function( # create ImageArray from file path if (inherits(image, "character")) { - if (grepl(".ome.tiff$|.ome.tif$|.qptiff$|.qptif$", 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/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..85f946a 100644 --- a/vignettes/ImageArray.Rmd +++ b/vignettes/ImageArray.Rmd @@ -240,6 +240,11 @@ 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