Mouse-Imaging-Centre / RMINC

Statistics for MINC volumes: A library to integrate voxel-based statistics for MINC volumes into the R environment. Supports getting and writing of MINC volumes, running voxel-wise linear models, correlations, etc.; correcting for multiple comparisons using the False Discovery Rate, and more. With contributions from Jason Lerch, Chris Hammill, Jim Nikelski and Matthijs van Eede. Some additional information can be found here:
https://mouse-imaging-centre.github.io/RMINC
Other
22 stars 17 forks source link

F-statistics not working with mincRandomize #318

Open rwickens opened 9 months ago

rwickens commented 9 months ago

Hello,

I'm trying to use mincRandomize on my mincLm object, which contains a column called F-statistic. In the documentation, I see that the default is t-stats...However, I'm attempting the following:

result = mincRandomize(myLm_masked, R = 500, alternative = "greater", columns = "F-statistic")

Am I calling it correctly? It's giving me the following error:


Error in apply(post_procd, 2, max): dim(X) must have a positive length Traceback:

  1. mincRandomize(myLm_masked, R = 500, alternative = "greater", . columns = "F-statistic")
  2. mincRandomize.mincLm(myLm_masked, R = 500, alternative = "greater", . columns = "F-statistic")
  3. mincRandomize_core(lmod, R = R, replace = replace, parallel = parallel, . columns = columns, alternative = alternative, conf_file = conf_file, . resources = resources)
  4. boot_model(R)
  5. Reduce(function(max_val_matrix, i) { . shuf_data <- lmod_data . shuf_data[, pred_cols] <- lmod_data[sample(seq_len(nrow(lmod_data)), . replace = replace), pred_cols] . new_mod <- update(lmod, data = shuf_data) . new_mod[!is.finite(new_mod)] <- 0 . post_procd <- post_proc(new_mod[, columns], ...) . if (alternative == "two.sided") { . post_procd <- abs(post_procd) . } . biggest_stats <- apply(post_procd, 2, max) . rbind(max_val_matrix, biggest_stats) %>% colnames<-(colnames(lmod)[columns]) %>% . rownames<-(NULL) . }, seq_len(n), NULL)
  6. f(init, x[[i]])
  7. apply(post_procd, 2, max)
  8. stop("dim(X) must have a positive length")

Using RMINC on a Mac (ARM64) using majestic-minc by josh unrau