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

vertexTFCE "random" crashes? #145

Closed gdevenyi closed 7 years ago

gdevenyi commented 7 years ago

Having some "random" crashes with vertexTFCE. With rstudio I wans't getting an error dump, but I just attempted on the console and got this:

> model = vertexLm(left_thickness ~  M.F*poly(Age, 2), filtered.data)                                             
N: 316 P: 6
Beginning vertex loop: 40962 7
Done with vertex loop
> configureMincParallel("sge")
Sourcing configuration file: '/opt/quarantine/RMINC/git-develop/build/RMINC/parallel/sge_BatchJobs.R'
> TFCE = vertexTFCE(model, surface="surf_reg_model_left.obj", parallel=c("sge",100), weights = as.numeric(readLines("surf_reg_model_left_area.txt")))     

 *** caught segfault ***
address 0x10a63eab0, cause 'memory not mapped'

Traceback:
 1: .Call("RMINC_graph_tfce", PACKAGE = "RMINC", map, adjacencies,     E, H, nsteps, weights)
 2: graph_tfce(x, adjacencies, E, H, nsteps, weights)
 3: vertexTFCE.numeric(x[, col_ind], surface[[surface_ind]], E = E,     H = H, nsteps = nsteps, weights = weights)
 4: (function (col_ind, surface_ind) {    vertexTFCE.numeric(x[, col_ind], surface[[surface_ind]],         E = E, H = H, nsteps = nsteps, weights = weights)})(dots[[1L]][[1L]], dots[[2L]][[1L]])
 5: mapply(function(col_ind, surface_ind) {    vertexTFCE.numeric(x[, col_ind], surface[[surface_ind]],         E = E, H = H, nsteps = nsteps, weights = weights)}, seq_len(ncol(x)), surface_inds)
 6: vertexTFCE.matrix(lmod[, columns], surface = surface, weights = weights,     d = d, E = E, H = H, side = side, like_volume = like_vol)
 7: vertexTFCE.vertexLm(model, surface = "surf_reg_model_left.obj",     parallel = c("sge", 100), weights = as.numeric(readLines("surf_reg_model_left_area.txt")))
 8: vertexTFCE(model, surface = "surf_reg_model_left.obj", parallel = c("sge",     100), weights = as.numeric(readLines("surf_reg_model_left_area.txt")))
gdevenyi commented 7 years ago

Less random, seems to consistent with this dataset.

Tried removing weights, same result.

cfhammill commented 7 years ago

Are there any NAs in filtered.data?

gdevenyi commented 7 years ago

In the dataframe, yes, in the variables M.F and Age, no.

cfhammill commented 7 years ago

Hmm, not quite sure what's happening, thought it had to do with arguments getting passed wrong, but it looks like defaults should have protected from a seg fault. Could you send an RDS of the model and I'll try to debug. It's failing before it goes to the cluster so I should be able to solve it without the raw data.

gdevenyi commented 7 years ago

Sent.

cfhammill commented 7 years ago

Should be fixed in dev :+1:

gdevenyi commented 7 years ago

Fixed!