
clear;clc;

cd /home/subhadip/Tumor_Network/Data/Tumor_ROIS/done/masks_on_b0/korte_hobe

input_files=dir('T1*.nii.gz');

target_files=dir('b0*.nii.gz');

matrix_files=dir('0*.mat');



for l=1:length(input_files)
    
outvol=strrep(input_files(l).name,'T1','b0_tumor');
    
[status currdir] = system(['flirt -in ' input_files(l).name ' -ref ' target_files(l).name ' -applyxfm -init ' matrix_files(l).name  ' -interp nearestneighbour -out ' outvol ])
 
end