function chg_vx;
Timg   = spm_get(1,'*.img','Please select the template image.');
ROIimg = spm_get(inf,'*.img','Please select the image(s) to be changed.');

   for r=1:size(ROIimg,1)
        Vi = spm_vol(Timg(1,:));   di = spm_read_vols(Vi);
        Vr = spm_vol(ROIimg(r,:)); dr = spm_read_vols(Vr);

        %interpolate, if dimensions are different
        step = Vr.dim(1:3) ./ Vi.dim(1:3);
        if any(step~=1)
            dr=zeros(Vi.dim(1:3));
            for slice=1:Vi.dim(3)
                M  = inv(spm_matrix([0 0 -slice 0 0 0 1 1 1])*inv(Vi.mat)*Vr.mat);
                dr(:,:,slice)=spm_slice_vol(Vr,M,Vi.dim(1:2),1); %0 -> nearest neighbour, 1-> trilinear interpolation -3 -> sinc interpolation
            end

            %save remapped image
            [prname frname rext]=fileparts(ROIimg(r,:));
            nname=fullfile(prname,[frname 'i' rext]);
            Vo=Vi;
            Vo.fname=nname;
            spm_write_vol(Vo,dr);
        else
            'no need to modify file'
        end
        
    end