Home > Source > Irrelevant > show_n_brains.m

show_n_brains

PURPOSE ^

SYNOPSIS ^

function show_n_brains(n)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function show_n_brains(n)
0002 
0003 home_dir = cd;
0004 
0005 image_dir = 'E:\Brain\images';
0006 points_dir = 'E:\Brain\points';
0007 pos = [ 23   138   568   644];
0008 
0009 % Get the list of image files
0010 cd(image_dir);
0011 rawlist = dir('*.pnm');
0012 index = randperm(length(rawlist));
0013 rawlist = rawlist(index);
0014 for i=1:n
0015     imagefile = rawlist(i).name;
0016     [dummy1,head,dummy2,dummy3] = fileparts(imagefile);
0017      pointsfile = [points_dir,'\',head,'.pts'];
0018     if(~isempty(dir(pointsfile)))
0019         [im, map] = pnmread(imagefile);
0020         [x,y] = read_brain_points(pointsfile);
0021         imfig = figure;, imshow(im);, hold on, plot(x(1:3:length(x)),y(1:3:length(x)),'go','MarkerSize',3), xlabel(['No of points: ',num2str(length(x(:)))]);
0022         set(imfig,'Name',imagefile,'Position',pos);
0023         % Write bmp and copy points files for ASM
0024         imfile = ['H:\nrr\brain\images\',head,'.png'];
0025         pfile = ['H:\nrr\brain\points\',head,'.pts'];
0026         imfile
0027         imwrite(im,imfile,'png');
0028         copyfile(pointsfile,pfile);
0029     end
0030 end
0031 
0032 cd(home_dir);

Generated on Thu 13-May-2004 18:00:46 by m2html © 2003