Skip to content
etiaum edited this page Apr 14, 2025 · 4 revisions

Requirements

To use RMINC, you need a session where MincTools is activated.
I recommend using RMINC in the command prompt rather than in RStudio. If it's not already installed on your computer, make sure R is installed first, then follow the instructions on the RMINC website.
More complete guides for RMINC are available:

First, open a command prompt, source MincTools and RMINC (if using the lab's computer) launch R, and load the RMINC library:

 source /opt/minc/1.9.17/minc-toolkit-config.sh  
 source /data/data05/vfonov/conda/etc/profile.d/conda.sh  
 conda activate RMINC  
 R  
 library(RMINC)  

Voxel-wise t-test

RMINC works by using a dataframe that includes paths to 3D .mnc image files (such as the MCSA datasheet). For example:

Dx Age Group Sexe MOCA ID FEOBV_blur6
1 70 Pre 0 27 MTL0101 /home/minc/Desktop/ScansAll/AllScans/MTL0101-FEOBV_blur6.mnc
1 69 Pre 1 28 MTL0128 /home/minc/Desktop/ScansAll/AllScans/MTL0128-FEOBV_blur6.mnc
1 67 Pre 0 29 MTL0308 /home/minc/Desktop/ScansAll/AllScans/MTL0308-FEOBV_blur6.mnc
1 62 ctl 0 27 MTL0377 /home/minc/Desktop/ScansAll/AllScans/MTL0377-FEOBV_blur6.mnc
0 62 ctl 0 30 MTL0304 /home/minc/Desktop/ScansAll/AllScans/MTL0304-FEOBV_blur6.mnc
0 60 ctl 1 28 MTL0381 /home/minc/Desktop/ScansAll/AllScans/MTL0381-FEOBV_blur6.mnc
0 66 ctl 0 28 MTL0442 /home/minc/Desktop/ScansAll/AllScans/MTL0442-FEOBV_blur6.mnc
0 68 ctl 0 29 MTL0608 /home/minc/Desktop/ScansAll/AllScans/MTL0608-FEOBV_blur6.mnc

You may also use a mask to specifically perform your analyses within that region to make the multiple comparison correction less stringent.
Here is how the script for t-tests between preclinical (pre) and controls (ctl) looks like:

mask = "/home/minc/Desktop/PrevST_mask_ICV.mnc"
gf1 <- read.csv("/home/minc/Desktop/ScansAll/RMINC64.csv")
gf1$Group <- relevel(gf1$Group, ref="ctl")
      #Setting the control group as the reference
vs1 <- mincLm(FEOBV_blur6 ~ Group + Age, mask=mask, gf1)
      #Your model. The 3D image has to be the dependent variable. Here, we corrected for age.
vs1[is.na(vs1)] <- 0 
      #Setting the "0" as "missing"
summary(vs1) 
      #To get a summary of your linear model
mincFDR(vs1, mask=mask)
      #perform FDR correction
mincWriteVolume(vs1,"/home/minc/Desktop/ScansAll/Results_24-07-17/t-test_6ctlvs3pre_agecor.mnc","tvalue-GroupPre") 
      #Creating a t-map - a 3D .mnc file with the t-values 

The resulting file can then be used with MincTools.

Clone this wiki locally