function [ bil ] = normalisebil( bil )
%Reads, rangescales and registers n images, crops and rescales all 
%identically, and applies PCA.
%   
%To ensure functionality, ensure your current folder contains your images.
%OUTPUT: [.bil multispectral image,data,pc,score,latent,explain]
%INPUT: (number of images to use,topleft x,topleft y,btm right x,btm right y,scale)
xrows=size(bil,1);
xcols=size(bil,2);
ximgs=size(bil,3);
bil=reshape(bil,[],ximgs);
for i=1:ximgs
    %bil(:,i)=bil(:,i)-min(bil(:,i));
    bil(:,i)=bil(:,i)./max(bil(:,i));
end
bil=reshape(bil,xrows,xcols,ximgs);
[bil]=bil;
end