You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lani Cupo edited this page Jan 21, 2026
·
11 revisions
Defining and running arbitrary functions across all voxels in parallel
There may come a time when you want to run a function across all the voxels in your data and there is no built-in function in RMINC to accomplish this. Some functions, such as mean and standard deviation are already built-in statistics that can be applied (see here: https://mouse-imaging-centre.github.io/RMINC/reference/mincSummary.html), but what if you want to calculate the mean and add 100 or something silly like that?
The RMINC function qMincApply (https://mouse-imaging-centre.github.io/RMINC/reference/qMincApply.html) is the perfect function for you! It allows you to pass in a list of filenames (which point to minc files), perform a function on each voxel in parallel, and output the results. This output can be used in R or saved as a minc file.
For this function, you will need:
library(RMINC)
library(batchtools)
Set up your csv as you would for running voxelwise linear models or linear mixed effects models in R with RMINC. Specifically you need, at the very least a csv with one column that includes paths to each minc file you want to use. For this example, the dataframe is called data and the column with the mincs is called file