Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Title: Representation of Python's SpatialData in R
Depends: R (>= 4.5)
Version: 0.99.25
Description: Interface to Python's 'SpatialData', currently including:
reticulate-based use of 'spatialdata-io' for reading of manufracturer
reticulate-based use of 'spatialdata-io' for reading of manufacturer
data and writing to .zarr, on-disk representation of images/labels as
'ZarrArray's ('Rarr') and shapes/points as 'arrow' objects, and method
drafts for visualization and coordinate system handling.
Expand Down
12 changes: 0 additions & 12 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ setGeneric("shapeNames", \(x, ...) standardGeneric("shapeNames"))
setGeneric("pointNames", \(x, ...) standardGeneric("pointNames"))
setGeneric("tableNames", \(x, ...) standardGeneric("tableNames"))

setMethod("images", "SpatialData", \(x) x$images)
setMethod("labels", "SpatialData", \(x) x$labels)
setMethod("shapes", "SpatialData", \(x) x$shapes)
setMethod("points", "SpatialData", \(x) x$points)
setMethod("tables", "SpatialData", \(x) x$tables)

setMethod("imageNames", "SpatialData", \(x) names(images(x)))
setMethod("labelNames", "SpatialData", \(x) names(labels(x)))
setMethod("shapeNames", "SpatialData", \(x) names(shapes(x)))
setMethod("pointNames", "SpatialData", \(x) names(points(x)))
setMethod("tableNames", "SpatialData", \(x) names(tables(x)))

# set one -----

setGeneric("image<-", \(x, i, ..., value) standardGeneric("image<-"))
Expand Down
2 changes: 1 addition & 1 deletion R/ShapeFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ setMethod("[", c("ShapeFrame", "missing", "missing"),
#' @export
setMethod("[", c("ShapeFrame", "numeric", "numeric"), \(x, i, j, ...) {
i <- seq_len(nrow(x))[i]
j <- seq_len(nrow(x))[j]
j <- seq_len(ncol(x))[j]
x@data <- x@data[i, j]
return(x)
})
2 changes: 1 addition & 1 deletion R/coord_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ setMethod("rmvCT", "Zattrs", \(x, i) {
}
nan <- setdiff(i, nms)
if (length(nan)) stop(
"couln't find 'coordTrans' of name(s) ",
"couldn't find 'coordTrans' of name(s) ",
paste(dQuote(nan), collapse=","))
i <- match(i, nms)
# protect against dropping identity
Expand Down
2 changes: 1 addition & 1 deletion R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ readSpatialData <- function(x,
if (is.numeric(opt) && opt > (. <- length(j)))
stop("'", i, "=", opt, "', but only ", ., " elements found")
if (is.character(opt) && length(. <- setdiff(opt, basename(j))))
stop("couln't find ", i, " of name", .)
stop("couldn't find ", i, " of name", .)
j <- j[opt]
}
f <- get(paste0("read", toupper(substr(i, 1, 1)), substr(i, 2, nchar(i)-1)))
Expand Down
4 changes: 2 additions & 2 deletions R/validity.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
.validateImageArray <- function(object) {
msg <- c()
if (ni <- length(images(object))) {
for (i in seq_along(ni)) {
for (i in seq_len(ni)) {
ai <- as.array(aperm(data(image(object,1))/255, perm=c(3,2,1)))
for (j in dim(ai)[3]) {
for (j in seq_len(dim(ai)[3])) {
if (!all(vapply(ai[,,j], is.numeric, logical(1)))) {
msg <- c(msg, paste0("Image ", i, " channel ", j, " not numeric"))
}
Expand Down
4 changes: 2 additions & 2 deletions man/trans.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading