Code covered by the BSD License  

Highlights from
GUI for Multivariate Image Analysis of Multispectral Images

image thumbnail
from GUI for Multivariate Image Analysis of Multispectral Images by Kateryna Artyushkova
A GUI for MIA of multispectral image data sets (PCA, Simplisma, MCR, classification).

im=vms_im_read(filename,plot);
function im=vms_im_read(filename,plot);
% im=vms_im_read(filename,plot);
% function for reading image VMS image file into data matrix
%
% im - output matrix created in the workspace
% filename - name of file in '____' format
% plot =1, image is displayed, plot=0, no display
%
% example: 
% for file name containing image: C_1.vms
% im=im_read('C_1.vms');
%
% Written by K. Artyushkova
% 6/18/2002

% Kateryna Artyushkova
% Postdoctoral Scientist
% Department of Chemical and Nuclear Engineering
% The University of New Mexico
% (505) 277-0750
% kartyush@unm.edu 


A = textread(filename,'%f',65536,'delimiter','.','headerlines',69); % read column of intensities in variable A

[m,n]=size(A);
N=sqrt(m); % number of pixels in x and y

% converting a column A into a matrix
BS=A(1:N,:)';
for n=1:N-1
   B=A((n*N+1):(n+1)*N,:)';
   BS=[BS;B];
end
im=BS; 

%displaying image
if plot==1
    imagesc(im)
    colormap(gray)
else
end

Contact us at files@mathworks.com