Skip to content

Commit 1fc8a56

Browse files
committed
address HG comments
1 parent 67f1b14 commit 1fc8a56

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

R/AllGenerics.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,10 @@ setGeneric("CTgraph", \(x, ...) standardGeneric("CTgraph"))
5757
setGeneric("rmvCT", \(x, ...) standardGeneric("rmvCT"))
5858
setGeneric("addCT", \(x, ...) standardGeneric("addCT"))
5959

60-
#setGeneric("scale", \(x, t, ...) standardGeneric("scale"))
61-
#setGeneric("rotate", \(x, t, ...) standardGeneric("rotate"))
62-
#setGeneric("sequence", \(x, t, ...) standardGeneric("sequence"))
63-
setGeneric("translation", \(x, t, ...) standardGeneric("translation"))
64-
6560
setGeneric("flip", \(x, ...) standardGeneric("flip"))
6661
setGeneric("flop", \(x, ...) standardGeneric("flop"))
6762
setGeneric("mirror", \(x, ...) standardGeneric("mirror"))
63+
setGeneric("translation", \(x, t, ...) standardGeneric("translation"))
6864

6965
# sda ----
7066

R/CTutils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ setMethod("addCT", "SpatialDataAttrs", \(x, name, type="identity", data=NULL) {
220220
x[[ct]] <- new
221221
} else {
222222
switch(
223-
tryCatch(.zv(x), error=\(e) "9.9"),
223+
tryCatch(.ome_ver(x), error=\(e) "9.9"),
224224
"0.3"=x$ome[[ms]][[1]][[ct]] <- new,
225225
x[[ms]][[1]][[ct]] <- new)
226226
}

R/sdArray.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ setMethod("data_type", "DelayedArray", \(x) {
116116
# internal use only!
117117
#' @noRd
118118
.ch <- \(x) {
119-
v <- tryCatch(.zv(x), error=\(e) NULL)
119+
v <- tryCatch(.ome_ver(x), error=\(e) NULL)
120120
if (is.null(v)) return()
121121
if (v == "0.5") x <- x$ome
122122
unlist(x$omero$channels)

R/sdAttrs.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,21 @@ setMethod("$", "SpatialDataAttrs", \(x, name) x[[name]])
126126

127127
# internal use only!
128128
#' @noRd
129-
.zv <- \(x) {
129+
.ome_ver <- \(x) {
130130
v <-
131131
x$multiscales[[1]]$version %||%
132132
x$omero$version %||%
133133
x$ome$version
134134
if (!length(v)) stop("couldn't find 'version' in 'spatialdata_attrs'")
135-
ok <- length(v) == 1 && is.character(v) && (v <- gsub("-.*", "", v)) %in% sprintf("0.%d", seq_len(5))
136-
if (!ok) stop("invalid 'version' in 'spatialdata_attrs'; expected '0.x' where x is 1-5")
135+
ok <- length(v) == 1 && is.character(v) && (v <- gsub("-.*", "", v)) %in% sprintf("0.%d", seq_len(6))
136+
if (!ok) stop("invalid OME 'version'; expected '0.x' where x is 1-5")
137137
return(v)
138138
}
139139

140140
# internal use only!
141141
#' @noRd
142142
.ms <- \(x) {
143-
v <- tryCatch(.zv(x), error=\(e) NULL)
143+
v <- tryCatch(.ome_ver(x), error=\(e) NULL)
144144
if (is.null(v)) return()
145145
switch(v, "0.5"=x$ome$multiscales, x$multiscales)
146146
}

0 commit comments

Comments
 (0)