====== Calculating Voxel Overlap ====== {{:mirecc:mireccanat:mirecc_free_first_union.jpg|:mirecc:mireccanat:mirecc_free_first_union.jpg}} 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. #!/bin/bash SUBJ=$1 DATADIR=~/path/to/your/ROIs/$SUBJ ##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 done 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 [[\\Selye\Data\MIRECC.03\Analysis\ROI\FF_voxel_counts.xls]] * the voxel excel sheet will load in values from overlap calcuations scripts via a macro ==== Overlap Calculation Scripts ==== * [[mirecc:mireccanat:calc_FF_overlap|Calculate Freesurfer-First Overlap]] * [[mirecc:mireccanat:calc_hipp_overlap|Calculate Hippocampus Manual/Free/First Overlap]] * [[mirecc:mireccanat:calc_amyg_overlap|Calculate Amygdala Manual/Free/First Overlap]]