sizenew10m = size(tci)
centerxnew10m = round(sizenew10m(1)/2)
centerynew10m = round(sizenew10m(2)/2)
xstartnew = centerxnew10m-round(FieldLatLength/2)-20
xendnew = centerxnew10m+round(FieldLatLength/2)+20
ystartnew = centerynew10m-round(FieldLongLength/2)-20
yendnew = centerynew10m+round(FieldLongLength/2)+20


tci = tci(xstartnew:xendnew,ystartnew:yendnew,:);
etci = etci(xstartnew:xendnew,ystartnew:yendnew,:);
ndvi = ndvi(xstartnew:xendnew,ystartnew:yendnew,:);
mndvi = mndvi(xstartnew:xendnew,ystartnew:yendnew,:);


sizenew20m = size(ndwi)
centerxnew20m = round(sizenew20m(1)/2)
centerynew20m = round(sizenew20m(2)/2)
xstartnew = centerxnew20m-round(FieldLatLength/4)-10
xendnew = centerxnew20m+round(FieldLatLength/4)+10
ystartnew = centerynew20m-round(FieldLongLength/4)-10
yendnew = centerynew20m+round(FieldLongLength/4)+10

ndwi = ndwi(xstartnew:xendnew,ystartnew:yendnew,:);
mndwi = mndwi(xstartnew:xendnew,ystartnew:yendnew,:);
etcindwi = etcindwi(xstartnew:xendnew,ystartnew:yendnew,:);



imwrite(tci,filenametci);
imwrite(etci,filenameetci);
imwrite(ndvi,filenamendvi);
imwrite(ndwi,filenamendwi);
imwrite(mndvi,filenamemndvi);
imwrite(mndwi,filenamemndwi);
imwrite(etcindwi,filenameetcindwi);


