22S4_register(SpatialData )
33
44# ' @export
5- method(print , SpatialData ) <- \(object ) {
5+ method(print , SpatialData ) <- \(x , ... ) {
66 cat(" class: SpatialData\n " )
77 l <- list ()
88 # images
9- i <- names(x <- object @ images )
10- d <- lapply(x , \(. ) paste(dim(. ), collapse = " ," ))
9+ i <- names(y <- x @ images )
10+ d <- lapply(y , \(. ) paste(dim(. ), collapse = " ," ))
1111 l <- c(l , list (images = list (i , d )))
1212 # labels
13- i <- names(x <- object @ labels )
14- d <- lapply(x , \(. ) paste(dim(. ), collapse = " ," ))
13+ i <- names(y <- x @ labels )
14+ d <- lapply(y , \(. ) paste(dim(. ), collapse = " ," ))
1515 l <- c(l , list (labels = list (i , d )))
1616 # points
17- i <- names(x <- object @ points )
18- d <- vapply(x , length , integer(1 ))
17+ i <- names(y <- x @ points )
18+ d <- vapply(y , length , integer(1 ))
1919 l <- c(l , list (points = list (i , d )))
2020 # shapes
21- i <- names(x <- object @ shapes )
22- d <- vapply(x , length , integer(1 ))
23- n <- vapply(x , ncol , integer(1 ))
21+ i <- names(y <- x @ shapes )
22+ d <- vapply(y , length , integer(1 ))
23+ n <- vapply(y , ncol , integer(1 ))
2424 geom <- ifelse(n == 1 , " polygon" , " circle" )
2525 d <- paste(d , geom , sep = " ," )
2626 l <- c(l , list (shapes = list (i , d )))
2727 # tables
28- i <- names(x <- object @ tables )
29- d <- lapply(x , \(. ) paste(dim(. ), collapse = " ," ))
28+ i <- names(y <- x @ tables )
29+ d <- lapply(y , \(. ) paste(dim(. ), collapse = " ," ))
3030 l <- c(l , list (tables = list (i , d )))
3131 # render
3232 for (. in names(l )) {
@@ -46,24 +46,23 @@ method(print, SpatialData) <- \(object) {
4646}
4747
4848# ' @export
49- method(print , ImageArray ) <- \(object ) .show_ms_array(object )
49+ method(print , ImageArray ) <- \(x , ... ) .show_ms_array(x )
5050
5151# ' @export
52- method(print , LabelArray ) <- \(object ) .show_ms_array(object )
52+ method(print , LabelArray ) <- \(x , ... ) .show_ms_array(x )
5353
54- # ' @export
55- method( print , ShapeFrame ) <- \( object ) {
56- cat(" class: ShapeFrame \n " )
57- cat(" count:" , length(object ), " \n " )
58- coolcat(" data(%d): %s\n " , names(object ))
54+ .show_sd_frame <- \( x ) {
55+ . <- attr( x , " S7_class " ) @ name
56+ cat(sprintf( " class: %s \n " , . ) )
57+ cat(" count:" , length(x ), " \n " )
58+ coolcat(" data(%d): %s\n " , names(x ))
5959}
6060
6161# ' @export
62- method(print , PointFrame ) <- \(object ) {
63- cat(" class: PointFrame\n " )
64- cat(" count:" , length(object ), " \n " )
65- coolcat(" data(%d): %s\n " , names(object ))
66- }
62+ method(print , ShapeFrame ) <- \(x , ... ) .show_sd_frame(x )
63+
64+ # ' @export
65+ method(print , PointFrame ) <- \(x , ... ) .show_sd_frame(x )
6766
6867# ' @export
69- method(print , Zattrs ) <- \(object ) cat(class(object ))
68+ method(print , Zattrs ) <- \(x , ... ) cat(class(x ))
0 commit comments