diff --git a/DESCRIPTION b/DESCRIPTION index d5ea13d..f5cce51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: SpatialFeatureExperiment Type: Package Title: Integrating SpatialExperiment with Simple Features in sf -Version: 1.9.4 +Version: 1.9.5 Authors@R: c(person("Lambda", "Moses", email = "dl3764@columbia.edu", role = c("aut", "cre"), diff --git a/R/coerce.R b/R/coerce.R index 16b379a..3fb4feb 100644 --- a/R/coerce.R +++ b/R/coerce.R @@ -44,7 +44,7 @@ terra::RGB(im_new) <- seq_len(3) } else if (inherits(img, "RemoteSpatialImage") || inherits(img, "StoredSpatialImage")) { suppressWarnings(im_new <- rast(imgSource(img))) - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) im_new <- terra::flip(im_new) } else { warning("Don't know how to convert image ", i, " to SpatRaster, ", diff --git a/R/read.R b/R/read.R index 8e6dc03..4fb94b8 100644 --- a/R/read.R +++ b/R/read.R @@ -79,7 +79,7 @@ read10xVisiumSFE <- function(samples = "", data <- match.arg(data) unit <- match.arg(unit) flip <- match.arg(flip) - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) flip <- "none" if (is_present(load)) { deprecate_warn("1.8.0", "read10xVisiumSFE(load)") @@ -326,7 +326,7 @@ readVisiumHD <- function(data_dir, bin_size = c(2L, 8L, 16L), data <- match.arg(data) unit <- match.arg(unit) flip <- match.arg(flip) - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) flip <- "none" images <- match.arg(images, several.ok = TRUE) bin_size <- match.arg(as.character(bin_size), choices = c("2", "8", "16"), @@ -747,7 +747,7 @@ readVizgen <- function(data_dir, check_installed("sfarrow") data_dir <- normalizePath(data_dir, mustWork = TRUE) flip <- match.arg(flip) - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) flip <- "none" image <- match.arg(image, several.ok = TRUE) if ((any(z < 0) || any(z > 6)) && z != "all") { diff --git a/tests/testthat/test-image.R b/tests/testthat/test-image.R index 5cd5826..85d1ad0 100644 --- a/tests/testthat/test-image.R +++ b/tests/testthat/test-image.R @@ -197,7 +197,7 @@ test_that("mirrorImg, SpatRasterImage method", { img_m2 <- mirrorImg(img, maxcell = 100) expect_equal(dim(img_m2), c(13,8,3)) # check content - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) expect_equal(imgRaster(img_m2)[4,3,2][[1]], 190) # Use filename @@ -243,7 +243,7 @@ test_that("scaleImg, SpatRasterImage method, EBI behind the scene", { test_that("affineImg, SpatRasterImage method, EBI behind the scene", { suppressWarnings(spi <- SpatRasterImage(rast(img_path))) - if (packageVersion('terra') >= as.package_version("1.7.83")) + if (packageVersion('terra') == as.package_version("1.7.83")) spi <- mirrorImg(spi, "vertical") # Should rotate clockwise somewhat, squished to be flatter, shear to the right M <- matrix(c(0.6, -0.2, 0.2, 0.3), nrow = 2)