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
23 stars 17 forks source link

mincLm dies on R object as mask #258

Open gdevenyi opened 5 years ago

gdevenyi commented 5 years ago

The mincLm function description says it can accept vectors: https://github.com/Mouse-Imaging-Centre/RMINC/blob/master/R/minc_voxel_statistics.R#L570-L571

So I did:

averagemask <- mincArray(mincGetVolume("../../derivatives/squirrel/MBM-with-model/squirrel_nlin/squirrel-nlin-3_mask.mnc"))

But mincLm failed:

/opt/quarantine/minc-toolkit/1.9.16/src/minc-toolkit-v2/libminc/libsrc/netcdf_convenience.c:573 (from miopen): Unable to open file '0'
0: No such file or directory
/opt/quarantine/minc-toolkit/1.9.16/src/minc-toolkit-v2/libminc/libsrc2/volume.c:1386 (from miopen): Unable to open file '0'
Error in minc.dimensions.sizes(mask) : Error opening input file: 0.

It looks like minc.dimensions.sizes assumes its reading a file: https://github.com/Mouse-Imaging-Centre/RMINC/blob/master/R/minc_voxel_statistics.R#L662-L670