#!/bin/bash
cd /mnt/c/Users/gargy/OneDrive/Desktop/7TAMI/ready/
###List of ROIs
rois=("r7TAMI_L_AV.nii" \
"r7TAMI_R_AV.nii" \
"r7TAMI_L_CL.nii" \
"r7TAMI_R_CL.nii" \
"r7TAMI_L_CM.nii" \
"r7TAMI_R_CM.nii" \
"r7TAMI_L_LGN.nii" \
"r7TAMI_R_LGN.nii" \
"r7TAMI_L_MGN.nii" \
"r7TAMI_R_MGN.nii" \
"r7TAMI_L_Pu.nii" \
"r7TAMI_R_Pu.nii" \
"r7TAMI_L_MD.nii" \
"r7TAMI_R_MD.nii")
"r7TAMI_L_V.nii" \
"r7TAMI_R_V.nii")

	# Apply warp to ROI (e.g., ROI in MNI space) using nearest neighbour
	for roi in "${rois[@]}"; do
		roi_name="${roi/.nii/}"
		applywarp \
			--in="$roi" \
			--ref=$FSLDIR/data/standard/MNI152_T1_1mm.nii.gz \
			--warp=anat2mni_warp.nii.gz \
			--out="${roi_name}_MNI.nii.gz" \
			--interp=nn
	done
