Skip to content

Commit beae426

Browse files
committed
eliminate thinko version checks
* and add matrixStats to imports
1 parent a8cd4d4 commit beae426

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Imports:
4040
checkmate,
4141
stringr,
4242
pbapply,
43-
zip
43+
zip,
44+
matrixStats
4445
Suggests:
4546
spelling,
4647
Rvcg (>= 0.17),
@@ -56,8 +57,7 @@ Suggests:
5657
readobj,
5758
brotli,
5859
qs,
59-
jsonlite,
60-
matrixStats
60+
jsonlite
6161
Enhances:
6262
natcpp
6363
License: GPL-3

R/coordinates.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ coord2ind <- function(coords, ...) UseMethod("coord2ind")
122122
coord2ind.default<-function(coords, imdims, voxdims=NULL, origin=NULL,
123123
linear.indices=TRUE, aperm=NULL,
124124
Clamp=FALSE, CheckRanges=!Clamp, ...) {
125-
checkmate::assertIntegerish(version, lower = 1L, upper = 7L)
126125
if(is.object(imdims)){
127126
if(!inherits(imdims, "im3d"))
128127
imdims=as.im3d(imdims)
@@ -174,11 +173,7 @@ coord2ind.default<-function(coords, imdims, voxdims=NULL, origin=NULL,
174173
pixcoords[,2]=pmin(imdims[2],pmax(1,pixcoords[,2]))
175174
pixcoords[,3]=pmin(imdims[3],pmax(1,pixcoords[,3]))
176175
} else if(CheckRanges){
177-
if(version>=3 && requireNamespace('matrixStats', quietly = T))
178-
ranges=t(matrixStats::colRanges(pixcoords))
179-
else {
180-
ranges=apply(pixcoords,2,range)
181-
}
176+
ranges=t(matrixStats::colRanges(pixcoords))
182177
if(any(ranges[2,]>imdims) || any(ranges[1,]<1))
183178
stop("pixcoords out of range")
184179
}

man/coord2ind.Rd

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)