tomwalters@0: % Function to calculate the size-shape image (SSI) tomwalters@0: % tomwalters@0: % (c) 2003-2008, University of Cambridge, Medical Research Council tomwalters@0: % tomwalters@0: % Marc A. Al-Hames tomwalters@0: % April 2003 tomwalters@0: % bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function ssi=gen_ssi(sai,options) tomwalters@0: tomwalters@0: %user information; open the 'calculation in progress' dialog box tomwalters@0: waithand=waitbar(0,'reading in SAI'); tomwalters@0: disp('running the SSI function...'); tomwalters@0: tomwalters@0: %read in all of the frames in the SAI array - converting them into Irino's tomwalters@0: %3d matrix tomwalters@0: tomwalters@0: no_frames=size(sai); tomwalters@0: SAI3d=[]; tomwalters@0: tomwalters@0: for ii=1:no_frames(2); tomwalters@0: fraction_complete=ii/no_frames(2); tomwalters@0: waitbar(fraction_complete); tomwalters@0: current_frame=sai{ii}; tomwalters@0: SAI3d(:,:,ii)=getvalues(current_frame); tomwalters@0: if (options.flipimage == 1) tomwalters@0: SAI3d(:,:,ii) = fliplr(SAI3d(:,:,ii)); tomwalters@0: end; tomwalters@0: end; tomwalters@0: tomwalters@0: %close the dialog box tomwalters@0: close(waithand); tomwalters@0: tomwalters@0: %assume that the sample rate is constant tomwalters@0: sample_rate=getsr(sai{1}); tomwalters@0: tomwalters@0: SSI3d=Calssi(SAI3d,options,sample_rate); tomwalters@0: tomwalters@0: %finally we output everything into frames tomwalters@0: %we have to take the transpose to put it in the correct form for the tomwalters@0: %display function tomwalters@0: tomwalters@0: maxfreval=max(max(sum(SSI3d,2))); tomwalters@0: tomwalters@0: for jj=1:no_frames(2); tomwalters@0: current_frame=SSI3d(:,:,jj); tomwalters@0: ssi{1,jj}=frame(current_frame); tomwalters@0: %set the sample rate of the frames tomwalters@0: ssi{1,jj}=setsr(ssi{1,jj},sample_rate); tomwalters@0: ssi{1,jj}=setxaxisname(ssi{1,jj},'0'); tomwalters@0: ssi{1,jj}=setscalefrequency(ssi{1,jj},maxfreval); tomwalters@0: end; tomwalters@0: tomwalters@0: tomwalters@0: