User Tools

Site Tools


Calculating Voxel Overlap


by multiplying one of the existing sets of ROIs by a constant, then adding them to the other, we can calculate the count of voxels that are overlapping within the two methods.

in the following script, the freesufer volumes are multiplied by 4, resulting in L = 4, R = 8. By simply adding those to the FIRST volumes, we can use fslstats with the appropriate threshold to grab the voxel count of only the overlap. values 5 and 10 are representative of the overlap in the above graphic.

##create ROIs
fslmaths ${DATADIR}/amyg_free -mul 4 -add ${DATADIR}/amyg_first $DATADIR/tmp_amyg_union
fslmaths ${DATADIR}/hipp_free -mul 4 -add ${DATADIR}/hipp_first $DATADIR/tmp_hipp_union
fslmaths ${DATADIR}/accu_free -mul 4 -add ${DATADIR}/accu_first $DATADIR/tmp_accu_union
fslmaths ${DATADIR}/caud_free -mul 4 -add ${DATADIR}/caud_first $DATADIR/tmp_caud_union
touch $DATADIR/overlap_vols.txt
for input in tmp_amyg_union tmp_hipp_union tmp_accu_union tmp_caud_union; do
echo "$DATADIR/$input L" >> $DATADIR/overlap_vols.txt
fslstats $DATADIR/$input -l 4.9 -u 5.1 -V >> $DATADIR/overlap_vols.txt
echo "$DATADIR/$input R" >> $DATADIR/overlap_vols.txt
fslstats $DATADIR/$input -l 9.9 -u 10.1 -V >> $DATADIR/overlap_vols.txt
rm ${DATADIR}/tmp_*

by sending this value to a spreadsheet, and dividing by the average of the 2 originals counts, we get percentage of overlap.

  • Count Overlap / ((Count Free + Count First)/2) = %overlap


  • the voxel excel sheet will load in values from overlap calcuations scripts via a macro

Overlap Calculation Scripts

mirecc/mireccanat/overlap.txt · Last modified: 2023/02/23 18:43 (external edit)