bsltl-1.3.1/0000755000175000017500000000000013532773704011273 5ustar olafolafbsltl-1.3.1/INDEX0000644000175000017500000000113713417616462012066 0ustar olafolaf# Functions in the library BSLTL >> Bio-Speckle Laser Tool Library Data datacut datapack datapack_to_gif Extras hbpmf mwindowing threshold2d Filter datapack_conv firfilterbank firsynthesisbank firsynthesispath freqmod qmfmaker qmfmirror Graphic fujii gendiff stdcont graphavd graphim graphptd graphrvd graphmhi graphkurt graphskew Numerical avd coom inertiamoment numad rvd stscorr thsp2corr pmfad pmfrd thsp thsp_gaussian thsp_line thsp_random Quality homogeneity satdark sscont WithoutTutorial datapack_to_bmp get_fir_filter get_lux_level imagesc_with_points mwnumbering select_points thsp_points bsltl-1.3.1/TASKS0000644000175000017500000000023113417616462012076 0ustar olafolaf* We need to create datapack_from_bmp that load a struct returned by datapack_to_bmp. * We need work with the datapack struct and not with the 3D marix. bsltl-1.3.1/README.md0000644000175000017500000000037613417616462012557 0ustar olafolaf# BioSpeckle Laser Tool Library (BSLTL) To informations about the package, please visit the [doc/overview.html](./doc/overview.html) file. To install from source code, execute in the command shell of linux: make install from the current directory.bsltl-1.3.1/inst/0000755000175000017500000000000013417616462012247 5ustar olafolafbsltl-1.3.1/inst/mfiles/0000755000175000017500000000000013417616462013526 5ustar olafolafbsltl-1.3.1/inst/mfiles/undocumented/0000755000175000017500000000000013417616462016220 5ustar olafolafbsltl-1.3.1/inst/mfiles/undocumented/imagesc_with_points.m0000644000175000017500000000447713417616462022451 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function hf=imagesc_with_points(MAT, POINTS,varargin) % % This function is similar to imagesc, with the difference that this also draw % the points contained in the variable POINTS. Additionally can be selected the % color of the points. % % imagesc_with_points(MAT, POINTS); % hf=imagesc_with_points(MAT, POINTS); % hf=imagesc_with_points(MAT, POINTS,'w'); % % % Input: % MAT is a matrix that will be used like the canvas to draw the points. % POINTS is a matrix with two columns and M lines. Thus, each line represent % one point in study.(line,column). % OPTION is the color of the points, by default OPTION='r', you can try 'r', % 'g', 'b', 'w','k'. % % Output: % hf returns the figure handler. % % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: % % Date: 20 of February of 2017. % Review: 28 of March of 2017. % if (nargin>2) if(~ischar(varargin{1})) error('The third parameter should be a string.'); else OPTIONS=varargin{1}; end else OPTIONS='r'; end hf=0; SIZE=size(MAT); M = size(POINTS,1); L = size(POINTS,2); if (L==2) lin=POINTS(:,1); col=POINTS(:,2); else [lin, col] = ind2sub (SIZE, POINTS(:,1)); end hf=imagesc(MAT); hold on; scatter(col,lin,OPTIONS); hold off; end bsltl-1.3.1/inst/mfiles/undocumented/get_lux_level.m0000755000175000017500000001072713417616462021246 0ustar olafolaf% Copyright (C) 2018, 2019 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Ymean Ystd POINTS]=get_lux_level(DATA,M,varargin) % % This function creates an analysis in time of illumination level in some points % in the datpack. % A set of M points (pixels) randomly are selected in the datapack, % and through DATA(:,:,k) for all k value. These points can be selected with % uniform distribution or a gaussian distribution. % % [YMEAN YSTD POINTS]=get_lux_level(DATA,M); % [YMEAN YSTD POINTS]=get_lux_level(DATA,M,'on'); % [YMEAN YSTD POINTS]=get_lux_level(DATA,M,Sigma); % [YMEAN YSTD POINTS]=get_lux_level(DATA,M,Sigma,'on'); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % M is the number of points in analysis. % Sigma [Optional]is the standard deviation in pixels. If this variable is used % then the points are selected using a gaussian distribution. % Show [Optional] can be used in the last position of input, and its function % is used to enable a graphic output of the selected points that formed the % THSP. Show='on', Show='on-red', Show='on-red-filled', Show='on-green', % Show='on-green-filled', Show='on-blue' , Show='on-blue-filled' % Show='on-cyan', Show='on-cyan-filled', Show='on-magenta', % Show='on-magenta-filled', Show='on-yellow', Show='on-yellow-filled', % Show='on-black', Show='on-black-filled', Show='on-gray' or % Show='on-gray-filled', Show='on-white' or % Show='on-white-filled' to enable. % It is disabled in other cases, by default Show='off'. % Show='on' plot the points in the color red, in other cases are used the % specified colors. % % Output: % YMEAN is the mean illumination level in M points. % YSTD is the standard deviation value (arround) of illumination level in M points. % POINTS [Optional] is a matrix with two columns and % M lines. Thus, each line represents one point in study, (line,column). % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % % Date: 09 of December of 2018. % Review: % ENABLEG='off'; GAUSSIAN=false; Sigma=0; if nargin>=3 for II=1:length(varargin) if(isnumeric(varargin{II})) GAUSSIAN=true; Sigma=varargin{II}; elseif(ischar(varargin{II})) ENABLEG=varargin{II}; end end endif if(GAUSSIAN==true) [Ymean Ystd POINTS]=get_gaussian_lux_level(DATA,M,Sigma,ENABLEG); else [Ymean Ystd POINTS]=get_random_lux_level(DATA,M,ENABLEG); end if strcmp(ENABLEG,'on') figure(gcf+1); errorbar([1:size(DATA,3)],Ymean,Ystd,'-.'); xlim([0 size(DATA,3)]); ylim([0 1.1*(max(Ymean)+max(Ystd))]); xlabel('Image sample') ylabel('Mean illumination level') endif endfunction function [Ymean Ystd POINTS]=get_gaussian_lux_level(DATA,M,Sigma,ENABLEG) colormap(gray) GAVD=graphavd(DATA,'off'); [THSP POINTS]= thsp_gaussian(DATA,M,Sigma,GAVD,ENABLEG); Ymean=mean(THSP); Ystd=std(THSP); endfunction function [Ymean Ystd POINTS]=get_random_lux_level(DATA,M,ENABLEG) colormap(gray) [THSP POINTS]= thsp_random(DATA,M,ENABLEG); Ymean=mean(THSP); Ystd=std(THSP); endfunction bsltl-1.3.1/inst/mfiles/undocumented/thsp_points.m0000644000175000017500000000626713417616462020763 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function Y = thsp_points(DATA, POINTS); % % This function evaluates the THSP (Time History Speckle Patterns) of a set % points selected in DATA(:,:,1), and through DATA(:,:,k) % for all k value. Similarly to [1][2] the THSP is calculated. % % References: % [1] OULOMARA, G.; TRIBILLON, J.; DUVERNOY, J. Biological activity measurements % on botanical specimen surfaces using a temporal decorrelation effect of % laser speckle. Journal of Moderns Optics, London, v. 36, n. 2, p. 136-179, % Feb. 1989. % % [2] XU, Z.; JOENATHAN, C.; KHORANA, B. M. Temporal and spatial properties of % the time-varying speckles of botanical specimens. Optical Engineering, Virginia, % v. 34, n. 5, p. 1487-1502, May 1995. % % % After starting the main routine just type the following command at the % prompt: % Y = thsp_points(DATA, POINTS); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represent NLIN and % N(1,2) represent NCOL and % N(1,3) represent NTIMES. % POINTS is a matrix with two columns and M lines, % where each line represent one point in study as (line,column). % Or a column vector with M lines, % where each line represent one point in study as a linear index. % A matrix is linearly indexed moving from one column to next, % filling up all rows in each column. % % Output: % Y is the time history speckle patterns. Where Y is a 2D matrix with % M lines and NTIMES columns. % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % % Date: 08 of February of 2016. % Review: 25 of May of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); M = size(POINTS,1); L = size(POINTS,2); if ~( (L==2)||(L==1) ) error('The second parameter should be of size [M 2] or [M 1].'); end Y = zeros(M,NTIMES); for b = 1:M if (L==2) lin=POINTS(b,1); col=POINTS(b,2); else [lin, col] = ind2sub ([NLIN, NCOL], POINTS(b,1)); end for c = 1:NTIMES Y(b,c) = DATA(lin,col,c); end end end bsltl-1.3.1/inst/mfiles/undocumented/get_fir_filter.m0000644000175000017500000002542513417616462021372 0ustar olafolaf% Copyright (C) 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) % package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [h varargout]=get_fir_filter(ORDER,Wn,varargin) % % This function returns a fir filter with an order and cut-off specified. % Also can be configured the types of filter as: low pass, high pass, band pass % and band stop. The filter also can be weighted by a window. Finally exist % a parameter that indicates if should be plotted the time and frequency % impulse response. % % After starting the main routine just type the following command at the % prompt: % % % By default it is low-pass, hamming window and not display the impulse response. % h=get_fir_filter(ORDER,Wn); % [h FTYPE]=get_fir_filter(ORDER,Wn); % % % By default it uses hamming window and not display the impulse response. % h=get_fir_filter(ORDER,Wn,CTYPE); % [h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE); % % % By default it don't display the impulse response. % h=get_fir_filter(ORDER,Wn,CTYPE,WINDOW); % [h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE,WINDOW); % % % All parameters are configured. % h=get_fir_filter(ORDER,Wn,CTYPE,WINDOW,GRAPHON); % [h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE,WINDOW,GRAPHON); % % % %% Low pass filter of order ORDER=20, cut-off at frequency to a*Fs/2, Hanning % %% windows % h=get_fir_filter(20,a,'low'); % % %% High pass filter of order ORDER=20, cut-off at frequency a*Fs/2, Hanning % %% windows % h=get_fir_filter(20,a,'high'); % % %% Band pass filter of order ORDER=40, cut-off at frequencies at % %% [a1*Fs/2 a2*Fs/2], Hanning windows % h=get_fir_filter(40,[a1 a2],'bandpass'); % % %% Reject pass filter of order ORDER=40, cut-off at frequencies at [a1*Fs/2 a2*Fs/2], % %% Hanning windows % h=get_fir_filter(40,[a1 a2],'stop'); % % % Input: % ORDER is the a variable that content the order of filter, the length of % filter will be equal to ORDER+1. % Wn is a scalar variable or vector(1x2) that content the cut-off % frequencies. % CTYPE [optional] it is the cut-off type of the fir filter, it can be ser % 'low', 'high', 'bandpass' or 'stop'. By default this value is 'low'. % WINDOW [optional] it is a vector that represent the weighted values of the % the filter. % GRAPHON [optional] enable or disable the display of the frequency % impulse response. % % Output: % h it is a vector of length ORDER+1 that represent a fir filter of % order ORDER. % FTYPE [optional] returns the type of the fir filter. % http://www.mathworks.com/help/signal/ug/fir-filter-design.html % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: % % Date: 20 of August of 2016. % %Checking parameters [Wn CUTOFF_TYPE WINDOW GRAPHON]=get_additional_params(ORDER,Wn,varargin{:}); D=ORDER/2; n=linspace(-D,D,ORDER+1); if(strcmp(CUTOFF_TYPE,'low')) [h FTYPE]=get_lowpass_fir_filter(ORDER,Wn,WINDOW); elseif(strcmp(CUTOFF_TYPE,'high')) [h FTYPE]=get_highpass_fir_filter(ORDER,Wn,WINDOW); elseif(strcmp(CUTOFF_TYPE,'bandpass')) [h FTYPE]=get_bandpass_fir_filter(ORDER,Wn,WINDOW); elseif(strcmp(CUTOFF_TYPE,'stop')) [h FTYPE]=get_bandstop_fir_filter(ORDER,Wn,WINDOW); end if (GRAPHON==true) plot_filter_data(h,Wn); end if (nargout>=2) varargout{1}=FTYPE; end end % % Returns a low pass fir filter of order ORDER and cut-off Wn and window WINDOW. % function [h FTYPE]=get_lowpass_fir_filter(ORDER,Wn,WINDOW) D=ORDER/2; n=linspace(-D,D,ORDER+1); if (mod(ORDER,2)==0) FTYPE=1; else FTYPE=2; end h=sin(pi*Wn*n)./(eps+pi*n); if (mod(ORDER,2)==0) h(ORDER/2+1)=Wn; end h=h.*WINDOW; for II=1:floor(length(h)/2) h(ORDER+2-II)=h(II); end h=h/sum(h); end % % Returns a high pass fir filter of order ORDER and cut-off Wn and window WINDOW. % function [h FTYPE]=get_highpass_fir_filter(ORDER,Wn,WINDOW) if (mod(ORDER,2)==0) FTYPE=1; else fprintf('\nThis function creates a fir filte of type IV, \n'); fprintf('Please see types of fir filter in:\n'); fprintf('http://www.mathworks.com/help/signal/ug/fir-filter-design.html\n\n'); FTYPE=4; end hl=get_fir_filter(ORDER,1-Wn,'low',WINDOW); for II=1:(ORDER+1) hl(II)=hl(II)*(-1)^(II-1); end if (hl(round(ORDER/2+1))<0) hl=-hl; end h=hl; end % % Returns a band pass fir filter of order ORDER and cut-offs Wn and window WINDOW. % function [h FTYPE]=get_bandpass_fir_filter(ORDER,Wn,WINDOW) if (mod(ORDER,2)==0) %% ORDER es par hl=get_fir_filter(ORDER,Wn(2),'low' ,ones(1,ORDER+1)); hh=get_fir_filter(ORDER,Wn(1),'high',ones(1,ORDER+1)); h=conv(hl,hh); % ORDER=length1+length2-1; h=h(ORDER/2+1:3*ORDER/2+1); FTYPE=1; else %% ORDER es impar hl=get_fir_filter(ORDER ,Wn(2),'low' ,ones(1,ORDER+1)); hh=get_fir_filter(ORDER-1,Wn(1),'high',ones(1,ORDER ));%high should has even order h=conv(hl,hh); % ORDER=length1+length2-1; h=h((ORDER+1)/2:(3*ORDER+1)/2); FTYPE=2; end h=h.*WINDOW; G=freqmod(h, 10/abs(Wn(2)-Wn(1)-round(Wn(2)-Wn(1))) ); h=h/max(G); end % % Returns a band stop fir filter of order ORDER and cut-offs Wn and window WINDOW. % function [h FTYPE]=get_bandstop_fir_filter(ORDER,Wn,WINDOW) if (mod(ORDER,2)==0) %% ORDER es par h=get_fir_filter(ORDER,Wn,'bandpass' ,WINDOW); h=-h; h(ORDER/2+1)=1+h(ORDER/2+1); G=freqmod(h, 10/abs(Wn(2)-Wn(1)-round(Wn(2)-Wn(1))) ); h=h/max(G); FTYPE=1; else fprintf(sprintf('\nThis function can''t creates a band stop fir filter with order %d of types I, II, III or IV.\n',ORDER)); fprintf('Please see types of fir filter in:\n'); fprintf('http://www.mathworks.com/help/signal/ug/fir-filter-design.html\n'); warning(sprintf('Returning a band stop filter of order %d\n\n',ORDER+1)); n=[1:length(WINDOW)]; n2=linspace(min(n),max(n),length(n)+1); W = spline (n,WINDOW,n2); [h FTYPE]=get_fir_filter(ORDER+1,Wn,'stop' ,W); end end % % This function returns additional parameters to calculates the filter. % Wnout is a sort version in ascending order of Wn. % CUTOFF_TYPE is the cut-of type of filter, it can be 'low', 'high', 'bandpass' % or 'stop'. % function [Wnout CUTOFF_TYPE WINDOW GRAPHON]=get_additional_params(ORDER,Wn,varargin) if(~isscalar(ORDER)) error('The first parameter should be a scalar.'); end if(~isvector(Wn)) error('The second parameter should be a row of 1x1 or 1x2.'); elseif(size(Wn,1)~=1) error('The second parameter should be a row of 1x1 or 1x2.'); elseif(length(Wn)>2) error('The second parameter should be a row of 1x1 or 1x2.'); end Wnout=sort(Wn); GRAPHON=false; WINDOW=hamming(ORDER+1); if(length(Wnout)==1) CUTOFF_TYPE='low'; else CUTOFF_TYPE='bandpass'; end if(nargin>2) for II=1:(nargin-2) if(isvector(varargin{II})&&isnumeric(varargin{II})) if(length(varargin{II})==(ORDER+1)) WINDOW=varargin{II}; else error(['The window parameter should have the same length of ORDER+1=',num2str(ORDER+1)]); end elseif(ischar(varargin{II})) if strcmp(varargin{II},'on') GRAPHON=true; elseif strcmp(varargin{II},'off') GRAPHON=false; elseif strcmp(varargin{II},'low') CUTOFF_TYPE='low'; if(length(Wn)~=1) error('The second parameter should be a scalar number.'); end elseif strcmp(varargin{II},'high') CUTOFF_TYPE='high'; if(length(Wn)~=1) error('The second parameter should be a scalar number.'); end elseif strcmp(varargin{II},'stop') CUTOFF_TYPE='stop'; if(length(Wn)~=2) error('The second parameter should be a row of 1x2.'); end elseif strcmp(varargin{II},'bandpass') CUTOFF_TYPE='bandpass'; if(length(Wn)~=2) error('The second parameter should be a row of 1x2.'); end else error('The filter type parameter should be: ''low'',''high'',''stop'',''bandpass''.'); end else error('The additionals parameter should be or rows or strings.'); end end end if(size(WINDOW,1)~=1) WINDOW=WINDOW'; end if(length(WINDOW)~=(ORDER+1)) error('Window has different size of ORDER+1.'); end end % % This functions retuns two figures about the impulse responnse of the filter h. % function plot_filter_data(h,Wn) ORDER=length(h)-1; D=ORDER/2; n=linspace(-D,D,ORDER+1); %%%%%%plot(n,h,'-o');grid; xlim([min(n) max(n)]); if (length(Wn)==2) BW=Wn(2)-Wn(1); else BW=Wn; end %%%%%%figure(gcf+1); % if BW<0.5 then exist 20 dots in the plot until Wn. % if BW>=0.5 then exist 20 dots in the plot later of Wn. [G f]=freqmod(h,20/(abs(BW-round(BW)))); if (length(Wn)==2) plot(f,abs(G), [0 1],[0.5 0.5], ... [Wn(1) Wn(1) Wn(1) Wn(1) Wn(1)],[0 0.25 0.5 0.75 1.0], ... [Wn(2) Wn(2) Wn(2) Wn(2) Wn(2)],[0 0.25 0.5 0.75 1.0]); grid; else plot(f,abs(G),[0 1],[0.5 0.5],[Wn Wn Wn Wn Wn],[0 0.25 0.5 0.75 1.0]); grid; end xlim([0 1]);ylim([0 1.2]); end bsltl-1.3.1/inst/mfiles/undocumented/mwnumbering.m0000644000175000017500000000650113417616462020732 0ustar olafolaf% Copyright (C) 2017, 2018 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function MATW = mwnumbering(MAT,WLines,WColumns,varargin) % % This function divides the MAT matrix in windows of WLines lines and WColumns % columns, then in each one of these windows it is calculated the mean value of all % elements. % % With theirs information is created a new matrix MATW with the same % size and windows of MAT, and the mean values in the MAT matrix are replaced % in all elements, for each window, in the MATW matrix. % % In the middle of each window is write the representative value of a window, % following the matrix MATW. % % After starting the main routine just type the following command at the % prompt: % MATW = mwnumbering(MAT,WLines,WColumns); % MATW = mwnumbering(MAT,WLines,WColumns,FontSize); % % Mean values, of the elements in the window of 8x10 pixels, in the MAT matrix. % In each windows is write the value of MATW in the window. % The used font size is 10. % MATW = mwnumbering(MAT,8,10); % % Mean values, of the elements in the window of 8x10 pixels, in the MAT matrix. % In each windows is write the value of MATW in the window. % The used font size is 16. % MATW = mwnumbering(MAT,8,10,16); % % Input: % MAT is a matrix with NLIN lines and NCOL columns. % WLines is the number of lines in each analysis window. % WColumns is the number of columns in each analysis window. % FontSize [Optional] The font size of text. % % Output: % MATW is a matrix with the mean values, of the elements in % the window of WLinesxWColumns pixels, in the MAT matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % % Date: 09 of July of 2018. % NSIZE = size(MAT); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); if(nargin>3) if(isnumeric(varargin{1})) FONTSIZE=varargin{1}; else error('The fourth parameter should be a number.') end else FONTSIZE=10; end MATW = mwindowing(MAT,WLines,WColumns); %figure imagesc(MATW) C=[1:WColumns:NCOL]; L=[1:WLines:NLIN]; [LL, CC] = meshgrid (L, C); for II=1:(size(LL,1)*size(LL,2)) text( CC(II)+WColumns/2, ... LL(II)+WLines/2, ... num2str(MATW(LL(II),CC(II)),"%5.1f"), ... 'HorizontalAlignment','center','fontweight','bold','fontsize',FONTSIZE); end end bsltl-1.3.1/inst/mfiles/undocumented/datapack_to_bmp.m0000644000175000017500000000756613417616462021524 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function h=datapack_to_bmp(DATA,DIRECTORY,PRENAME) % % This function save the images inside of datapack in a set of BMP files. % The formation rule of the BMP file names is: % % NAME=fullfile(DIRECTORY,sprintf([PRENAME,'.bmp'],II)); % % Being II, the number of the saved image. % % After starting the main routine just type the following command at the % prompt: % % h = datapack_to_bmp(DATA,DIRECTORY,PRENAME); % % %% To filenames: 'seed1.bmp', 'seed2,bmp', ..., 'seed128.bmp' % h = datapack_to_bmp(DATA,'','seed%d'); % % %% To filenames: 'img1coffee.bmp', 'img2coffee,bmp', ..., 'img100coffee.bmp' % h = datapack_to_bmp(DATA,'','img%dcoffee'); % % %% To filenames: 'img0001.bmp', 'img0002,bmp', ..., 'img0123.bmp' % h = datapack_to_bmp(DATA,'','img%04d'); % % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % DIRECTORY is the address where the BMP files will be saved. % PRENAME is the format filename, example: if you search names as % 'fig1.bmp', then PRENAME='fig' or PRENAME='fig%d'. If PRENAME not % contain a format specifiers of family %d, them this format specifiers % is added at the final of PRENAME string. The format string is similar % to the function printf of others programming languages. % Only are permitted format specifiers of family %d, given that will % be replaced a decimal number. % % Output: % h returns a struct with the fields, % h.file{i}: The name of i-th bmp file, % h.format: The format filename, % h.init: The id of first element, % h.dir: The directory where the images will be saved, and % h.nel: The numbeer of images. % % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 20 of February of 2016. % Review: 28 of March of 2016. % %Checking parameters if(~(ischar(DIRECTORY)&&ischar(PRENAME))) if(~ischar(DIRECTORY)) disp('Second parameter is not a string.'); end if(~ischar(PRENAME)) disp('Third parameter is not a string.'); end error('Error in the parameters format of datapack function.'); end NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); DATA=uint8(DATA); if(length(strfind(PRENAME,'%'))==0) PRENAME=[PRENAME,'%d']; end mkdir(DIRECTORY); h.file=cell(1,NTIMES); h.format=[PRENAME,'.bmp']; h.init=1; h.dir=DIRECTORY; h.nel=NTIMES; for II=1:NTIMES h.file{II}=fullfile(DIRECTORY,sprintf(h.format,II)); imwrite(DATA(:,:,II),h.file{II}); end end bsltl-1.3.1/inst/mfiles/undocumented/select_points.m0000644000175000017500000003717513417616462021266 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [P1 varargout] = select_points(DATA,Type,varargin) % % This function select a set of M points, selected according to Type, % in DATA(:,:,1), and through DATA(:,:,k) % % After starting the main routine just type the following command at the % prompt: % P1 = select_points(DATA,Type,M); % % [P1 P2] = select_points(DATA,'gaussian',M,2); % P1 = select_points(DATA,'gaussian',M); % % [P1 P2] = select_points(DATA,'random',M,2); % P1 = select_points(DATA,'random',M); % % [P1 P2] = select_points(DATA,'region',2); % P1 = select_points(DATA,'region'); % % [P1 P2 P3]= select_points(DATA,'line',3); % P1 = select_points(DATA,'line'); % % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represent NLIN and % N(1,2) represent NCOL and % N(1,3) represent NTIMES. % Or a image where if N=size(DATA), then % N(1,1) represent NLIN and % N(1,2) represent NCOL % Type is the type of selecting points method. These can be: % 'gaussian' - Need selecting two points; center and deviation radius. % This type select M points chosen randomly (Gaussian) % around one central point. Also is needed add an additional % input parameter M, with the number of points. % 'random' - Need selecting two points; two opposite corners. % This type select M points chosen uniformly random % between two corner points. Also is needed add an additional % input parameter M, with the number of points % 'region' - Need selecting two points; two opposite corners. % This type select all the pixels between two corner points. % 'line' - Need selecting two points; begin and end. % This type select all the pixels in a line between two % corner points. % M [Optional] is the number of points randomly selected. % if Type is 'gaussian' or 'random', then M is mandatory and M will be % the third input parameter; in other case M is not necessary and the % third input parameter will be Groups. % Groups [Optional] is the number of groups of points to be selected. % if Type is 'gaussian' or 'random', Groups is the fourth input parameter % in other case, Groups is the third parameter. % the groups of points are returned as additional output parameters. % by default Groups is 1. % % Output: % P1 is a matrix with two columns and M lines. Thus, each line represent % one point in study.(line,column). % Pi is a matrix with two columns and M lines. Thus, each line represent % one point in study.(line,column). the existence of this group of points % depend of input parameter Groups. % % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % % Date: 08 of February of 2016. % Review: 25 of May of 2016. % NLIN = size(DATA,1); NCOL = size(DATA,2); NTIMES = size(DATA,3); if NTIMES>1 [C IMG E]=stdcont(DATA,'off'); else IMG=DATA(:,:,1); end Groups=1; if(~ischar(Type)) error('The second parameter should be a string char.'); end if( strcmp(Type,'gaussian')||strcmp(Type,'random') ) if (nargin<3) cadena=['The function need 3 parameters in the gaussian', ... ' and random case, See: help select_points']; error(cadena); end if ( (~isnumeric(varargin{1}))||(~isscalar(varargin{1})) ) cadena=['The third parameter should be a scalar number, ', ... 'See: help select_points']; error(cadena); end M=varargin{1}; if (nargin>=4) if ( (~isnumeric(varargin{2}))||(~isscalar(varargin{2})) ) cadena=['The fourth parameter should be a scalar number, ', ... 'See: help select_points']; error(cadena); end Groups=varargin{2}; end elseif( strcmp(Type,'region')||strcmp(Type,'line') ) if (nargin>=3) if ( (~isnumeric(varargin{1}))||(~isscalar(varargin{1})) ) cadena=['The tirth parameter should be a scalar number, ', ... 'See: help select_points']; error(cadena); end Groups=varargin{1}; end else error('The second input parameter is unknown. See: help select_points'); end for k=1:Groups %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(strcmp(Type,'gaussian')) if(k==1) [P1 Sigma]=select_points_gaussian(IMG,M); else if(nargout>=k) varargout{k-1}=select_points_gaussian(IMG,M,Sigma); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% elseif(strcmp(Type,'random')) if(k==1) [P1 DLIN DCOL]=select_points_random(IMG,M); else if(nargout>=k) varargout{k-1}=select_points_random(IMG,M,DLIN,DCOL); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% elseif(strcmp(Type,'region')) if(k==1) [P1 DLIN DCOL]=select_points_region(IMG); else if(nargout>=k) varargout{k-1}=select_points_region(IMG,DLIN,DCOL); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% elseif(strcmp(Type,'line')) if(k==1) [P1 DLIN DCOL]=select_points_line(IMG); else if(nargout>=k) varargout{k-1}=select_points_line(IMG,DLIN,DCOL); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% else error('Type option unknown.'); end end refresh hold off; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [POINTS Sigma]=select_points_gaussian(IMG,M,varargin) NLIN = size(IMG,1); NCOL = size(IMG,2); if(nargin==2) imagesc(IMG); msg='Select 2 points: center a radius.'; msgbox (msg); title(msg); P0=zeros(1,2); Pr=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); while 0==check_point1(P0(1),P0(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); end [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); while 0==check_point1(Pr(1),Pr(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); end Sigma=sqrt((Pr(2)-P0(2))^2+(Pr(1)-P0(1))^2)/(2*sqrt(2)); elseif(nargin==3) Sigma=varargin{1}; msg=['Select 1 point: center. Deviation:',num2str(Sigma)]; msgbox (msg); title(msg); P0=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); while 0==check_point1(P0(1),P0(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); end else error('Number of arguments should be 2 or 3'); end POINTS=zeros(M,2); POINTS(:,1) = round(Sigma*randn([M 1])+P0(1)); POINTS(:,2) = round(Sigma*randn([M 1])+P0(2)); %% verificando que los puntos esten dentro de la imagen for m = 1:M while ( (POINTS(m,1)<1) || (POINTS(m,1)>NLIN) || (POINTS(m,2)<1) || (POINTS(m,2)>NCOL) ) POINTS(m,1) = round(Sigma*randn(1)+P0(1)); POINTS(m,2) = round(Sigma*randn(1)+P0(2)); end end hold on; scatter(POINTS(:,2),POINTS(:,1),'r'); hold off; endfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [POINTS DLIN DCOL]=select_points_region(IMG,varargin) NLIN = size(IMG,1); NCOL = size(IMG,2); if(nargin==1) imagesc(IMG); msg='Select 2 opposite corners points.'; msgbox (msg); title(msg); P0=zeros(1,2); Pr=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); while 0==check_point1(P0(1),P0(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); end [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); while 0==check_point1(Pr(1),Pr(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); end DLIN = Pr(1)-P0(1)+1; DCOL = Pr(2)-P0(2)+1; elseif(nargin==3) DLIN=varargin{1}; DCOL=varargin{2}; msg=['Select 1 point: center. Size:',num2str(DLIN),'x',num2str(DCOL)]; msgbox (msg); title(msg); P0=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); while( (0==check_point1(P0(1),P0(2),NLIN,NCOL))||(0==check_point1(P0(1)+DLIN-1,P0(2)+DCOL-1,NLIN,NCOL)) ) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); end else error('Number of arguments should be 1 or 3'); end M=DLIN*DCOL; POINTS=zeros(M,2); m=1; for II=0:(abs(DLIN)-1) for JJ=0:(abs(DCOL)-1) POINTS(m,1) = P0(1)+II*sign(DLIN); POINTS(m,2) = P0(2)+JJ*sign(DCOL); m=m+1; endfor endfor %% verificando que los puntos esten dentro de la imagen for m = 1:M while ( (POINTS(m,1)<1) || (POINTS(m,1)>NLIN) || (POINTS(m,2)<1) || (POINTS(m,2)>NCOL) ) POINTS(m,1) = round(DLIN*rand([1 1])+P0(1)); POINTS(m,2) = round(DCOL*rand([1 1])+P0(2)); end end hold on; scatter(POINTS(:,2),POINTS(:,1),'r'); hold off; endfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [POINTS DLIN DCOL]=select_points_random(IMG,M,varargin) NLIN = size(IMG,1); NCOL = size(IMG,2); if(nargin==2) imagesc(IMG); msg='Select 2 opposite corners points.'; msgbox (msg); title(msg); P0=zeros(1,2); Pr=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); while 0==check_point1(P0(1),P0(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); end [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); while 0==check_point1(Pr(1),Pr(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); end DLIN = Pr(1)-P0(1)+1; DCOL = Pr(2)-P0(2)+1; elseif(nargin==4) DLIN=varargin{1}; DCOL=varargin{2}; msg=['Select 1 point: center. Size:',num2str(DLIN),'x',num2str(DCOL)]; msgbox (msg); title(msg); P0=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); while( (0==check_point1(P0(1),P0(2),NLIN,NCOL))||(0==check_point1(P0(1)+DLIN-1,P0(2)+DCOL-1,NLIN,NCOL)) ) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); end else error('Number of arguments should be 2 or 4'); end POINTS=zeros(M,2); POINTS(:,1) = round(DLIN*rand([M 1])+P0(1)); POINTS(:,2) = round(DCOL*rand([M 1])+P0(2)); %% verificando que los puntos esten dentro de la imagen for m = 1:M while ( (POINTS(m,1)<1) || (POINTS(m,1)>NLIN) || (POINTS(m,2)<1) || (POINTS(m,2)>NCOL) ) POINTS(m,1) = round(DLIN*rand([1 1])+P0(1)); POINTS(m,2) = round(DCOL*rand([1 1])+P0(2)); end end hold on; scatter(POINTS(:,2),POINTS(:,1),'r'); hold off; endfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [POINTS DLIN DCOL]=select_points_line(IMG,varargin) NLIN = size(IMG,1); NCOL = size(IMG,2); if(nargin==1) imagesc(IMG); msg='Select 2 opposite corners points.'; msgbox (msg); title(msg); P0=zeros(1,2); Pr=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); while 0==check_point1(P0(1),P0(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2)); P0(1)=round(P0(1)); end [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); while 0==check_point1(Pr(1),Pr(2),NLIN,NCOL) msgbox ('Wrong, point out of bounds. Select another point'); [ Pr(2) Pr(1)]=ginput(1); Pr(2)=round(Pr(2)); Pr(1)=round(Pr(1)); end DLIN = Pr(1)-P0(1)+1; DCOL = Pr(2)-P0(2)+1; NPOINTS=max(abs(DLIN),abs(DCOL)); elseif(nargin==3) DLIN=varargin{1}; DCOL=varargin{2}; NPOINTS=max(abs(DLIN),abs(DCOL)); msg=['Select 1 point: corner point. Size:',num2str(NPOINTS)]; msgbox (msg); title(msg); P0=zeros(1,2); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); while( (0==check_point1(P0(1),P0(2),NLIN,NCOL))||(0==check_point1(P0(1)+DLIN-1,P0(2)+DCOL-1,NLIN,NCOL)) ) msgbox ('Wrong, point out of bounds. Select another point'); [ P0(2) P0(1)]=ginput(1); P0(2)=round(P0(2));P0(1)=round(P0(1)); end else error('Number of arguments should be 1 or 3'); end POINTS=zeros(NPOINTS,2); D=sqrt((DCOL-1)^2+(DLIN-1)^2); ul=(DLIN-1)/D; uc=(DCOL-1)/D; for JJ=0:(NPOINTS-1) POINTS(JJ+1,1) = round(P0(1)+ul*D*JJ/(NPOINTS-1)); POINTS(JJ+1,2) = round(P0(2)+uc*D*JJ/(NPOINTS-1)); end hold on; scatter(POINTS(:,2),POINTS(:,1),'r'); hold off; endfunction function h=check_point1(x,y,nlin,ncol) % Check if (x,y) is in (1,1) -> (nlin,ncol) % return true=1 or false=0 if ((x>=1)&&(x<=nlin)&&(y>=1)&&(y<=ncol)) h=1; else h=0; end end bsltl-1.3.1/inst/mfiles/graphic/0000755000175000017500000000000013417616462015143 5ustar olafolafbsltl-1.3.1/inst/mfiles/graphic/moments/0000755000175000017500000000000013417616462016625 5ustar olafolafbsltl-1.3.1/inst/mfiles/graphic/moments/graphim.m0000644000175000017500000000655013417616462020440 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [GIM] = graphim(DATA,varargin) % % This function implements the Inertia Moment (IM) [1] method, only on a pixel-by time, % with the normalization of the co-occurrence matrix (COM) proposed by % CARDOSO, R.R. et al. [2]. The function returns the graphic IM method. % Use as input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $GIM=\frac{1}{NTIMES-1}\sum\limits_{k=1}^{NTIMES-1}(I(k)-I(k+1))^2 \approx E[(I(k)-I(k+1))^2]$ % % References: % [1] ARIZAGA, R. et al. Speckle time evolution characterization by the % co-occurrence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % [2] R.R. Cardoso, R.A. Braga, Enhancement of the robustness on dynamic speckle % laser numerical analysis, Optics and Lasers in Engineering, % Volume 63, December 2014, Pages 19-24, ISSN 0143-8166, % http://dx.doi.org/10.1016/j.optlaseng.2014.06.004. % % % After starting the main routine just type the following command at the % prompt: % GIM = graphim(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % GIM returns the Generalized Difference matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 10 of July of 2015. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough') end GIM = zeros(NLIN,NCOL); for k = 1:NTIMES-1 GIM = (DATA(:,:,k) - DATA(:,:,k+1)).^2 + GIM; end GIM=GIM/(NTIMES-1); SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(GIM); colorbar title('Graphic IM Method'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/moments/graphptd.m0000644000175000017500000000652413417616462020623 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [GPTD] = graphptd(DATA,P,varargin) % % This function implements the Parameterized form of Temporal Difference (PTD) % [1] technique. Use as input data a 3D matrix created grouping NTIMES intensity % matrices I(k), 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $PTD=\sum\limits_{k=1}^{NTIMES-1} |I(k)-I(k+1)|^P$ % % The function is normalized with the number of elements in the sum. % Thus, GPTD matrix represents the expected value of absolute difference % $|I(k)-I(k+1)|$ for any k value. % % $GPTD=\frac{PTD}{NTIMES-1} \approx E[|I(k)-I(k+1)|^P]$ % % References: % [1] Preeti D. Minz, A.K. Nirala, Intensity based algorithms for biospeckle % analysis, Optik - International Journal for Light and Electron Optics, % Volume 125, Issue 14, July 2014, Pages 3633-3636, ISSN 0030-4026, % http://dx.doi.org/10.1016/j.ijleo.2014.01.083. % % % After starting the main routine just type the following command at the % prompt: % GPTD = graphptd(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % P is a parameter whose value may be positive integer as well as fraction. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % GPTD returns the GPTD matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of August of 2015. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough') end GPTD = zeros(NLIN,NCOL); for k = 1:NTIMES-1 GPTD = abs(DATA(:,:,k) - DATA(:,:,k+1)).^P + GPTD; end GPTD=GPTD/(NTIMES-1); SHOW=''; if(nargin>=3) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(GPTD); colorbar title(['Graphic PTD Method with P=',num2str(P)]); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/moments/graphavd.m0000644000175000017500000000651713417616462020610 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [GAVD] = graphavd(DATA,varargin) % % This function implements the Absolute Value of the Differences (AVD) method [1], % only using a pixel-by time, with the normalization of the co-occurrence matrix (COM) % proposed by CARDOSO, R.R. et al. [2]. % Use as input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $GAVD=\frac{1}{NTIMES-1}\sum\limits_{k=1}^{NTIMES-1} |I(k)-I(k+1)| \approx E[|I(k)-I(k+1)|]$ % % % References: % [1] BRAGA, R.A. et al. Evaluation of activity through dynamic laser speckle % using the absolute value of the differences, Optics Communications, v. 284, % n. 2, p. 646-650, 2011. % [2] R.R. Cardoso, R.A. Braga, Enhancement of the robustness on dynamic speckle % laser numerical analysis, Optics and Lasers in Engineering, % Volume 63, December 2014, Pages 19-24, ISSN 0143-8166, % http://dx.doi.org/10.1016/j.optlaseng.2014.06.004. % % % After starting the main routine just type the following command at the % prompt: % GAVD = graphavd(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % GAVD returns the GAVD matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code adapted by: Roberto A Braga Jr % % Date: 09 of August of 2015. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough') end GAVD = zeros(NLIN,NCOL); for k = 1:NTIMES-1 GAVD = abs(DATA(:,:,k) - DATA(:,:,k+1)) + GAVD; end GAVD=GAVD/(NTIMES-1); SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(GAVD); colorbar title('Graphic AVD Method'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/moments/graphrvd.m0000644000175000017500000000610113417616462020616 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [GRVD] = graphrvd(DATA,varargin) % % This function implements the Regular Value of the Differences method [1], % only on a pixel-by time, with the normalization of the co-occurrence matrix (COM) % proposed by CARDOSO, R.R. et al. [2]. % % Use as input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $GRVD=\frac{1}{NTIMES-1}\sum\limits_{k=1}^{NTIMES-1} (I(k)-I(k+1))$ % % % References: % [1] Pujaico Rivera Fernando. Paper coming soon. % [2] CARDOSO, R.R.; BRAGA R.A. Enhancement of the robustness on dynamic speckle % laser numerical analysis. Optics and Lasers in Engineering, % 63(Complete):19-24, 2014. % % % After starting the main routine just type the following command at the % prompt: % GRVD = graphrvd(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % GRVD returns the GRVD matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of August of 2015. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough') end GRVD = zeros(NLIN,NCOL); for k = 1:NTIMES-1 GRVD = (DATA(:,:,k+1) - DATA(:,:,k)) + GRVD; end GRVD=GRVD/(NTIMES-1); SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(GRVD); colorbar title('Graphic RVD Method'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/others/0000755000175000017500000000000013417616462016447 5ustar olafolafbsltl-1.3.1/inst/mfiles/graphic/others/graphmhi.m0000644000175000017500000000715213417616462020431 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function MHI=graphmhi(DATA,U,varargin) % % This function implements the Motion History Image (MHI) technique [1-2], % and considers a pixel as in activity, where it should have an % absolute intensity jump superior to U. % % References: % [1] Davis, J.W., 'Hierarchical motion history images for recognizing human % motion,' Detection and Recognition of Events in Video, 2001. Proceedings. % IEEE Workshop on , vol., no., pp.39,46, 2001. doi: 10.1109/EVENT.2001.938864 % [2] R.P. Godinho, M.M. Silva, J.R. Nozela, R.A. Braga, 'Online biospeckle assessment % without loss of definition and resolution by motion history image', % Optics and Lasers in Engineering, Volume 50, Issue 3, March 2012, Pages 366-372, % ISSN 0143-8166, http://dx.doi.org/10.1016/j.optlaseng.2011.10.023. % % After starting the main routine just type the following command at the % prompt: % graphmhi(DATA,U); % graphmhi(DATA,U,'off'); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % U is the activity threshold. Only considered as activity, it changes the % intensity values larger than U. % SHOW [Optional] If SHOW is equal to string 'off' then not plot the result. % By default 'on'. % % Output: % MHI is the motion history image matrix of data pack. The elements, in % the matrix, with higher values pertain to most recent activities % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of July of 2015. % Review: 23 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); % subtration of two images in sequence S = cell(1,NTIMES-1); for JJ = 1 : NTIMES-1 S{JJ} = abs( DATA(:,:,JJ) - DATA(:,:,JJ+1) ); end % threshold U T = cell(1,NTIMES-1); for JJ = 1 : NTIMES-1 T{JJ} = ( S{JJ} > U ); end clear S; % composition of the final image with weighting MHI = zeros(NLIN,NCOL); k = 255 / sum(1:NTIMES-1); for JJ = 1 : NTIMES-1 MHI = MHI + T{JJ} * (k * JJ); end clear T; SHOW=''; if(nargin>=3) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) imagesc(MHI); title('Motion History Image'); daspect ([1 1 1]); end end bsltl-1.3.1/inst/mfiles/graphic/stats/0000755000175000017500000000000013417616462016301 5ustar olafolafbsltl-1.3.1/inst/mfiles/graphic/stats/graphkurt.m0000644000175000017500000000751613417616462020477 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Kurt varargout] = graphkurt(DATA,varargin) % % This function calculates the temporal speckle kurtosis matrix (K). Use as % input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $MU = \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} I(k) \approx E[I(k)]$ % % $SIGMA = \sqrt{ \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} (I(k)-MU])^2 }$ % % $K \approx E[\left(\frac{I(k)-MU}{SIGMA}\right)^4]$ % % The function additionally also returns the temporal standard deviation matrix % and temporal expected matrix. % % % After starting the main routine just type the following command at the % prompt: % K = graphkurt(DATA); % [K D] = graphkurt(DATA); % [K D E] = graphkurt(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then the result will not be plotted. % % Output: % K returns the temporal speckle kurtosis matrix of image Data Pack. % D [Optional] returns the temporal standard deviation matrix of image Data Pack. % E [Optional] returns the temporal expected matrix of image Data Pack. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % Date: 16 of July of 2015. % Review: 22 of July of 2015. % Review: 23 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough.'); end SIGMA = zeros(NLIN,NCOL); ED = zeros(NLIN,NCOL); Kurt = zeros(NLIN,NCOL); for k = 1:NTIMES ED = ED+ DATA(:,:,k) ; end ED=ED/NTIMES; for k = 1:NTIMES SIGMA = SIGMA + (DATA(:,:,k)-ED).^2; end SIGMA = sqrt(SIGMA/NTIMES) ; for k = 1:NTIMES Kurt=Kurt+((DATA(:,:,k)-ED)./SIGMA).^4; end Kurt=Kurt/NTIMES; if(nargout>=2) varargout{1}=SIGMA; end if(nargout>=3) varargout{2}=ED; end SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(ED); colorbar; title('Images: Speckle Mean'); daspect ([1 1 1]); figure imagesc(SIGMA); colorbar; title('Images: Speckle Standard Deviation'); daspect ([1 1 1]); figure imagesc(Kurt); colorbar; title('Images: Speckle Kurtosis'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/stats/graphskew.m0000644000175000017500000000771413417616462020463 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Skew varargout] = graphskew(DATA,varargin) % % This function calculates the temporal speckle skewness matrix (S). Use as % input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $MU = \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} I(k) \approx E[I(k)]$ % % $SIGMA = \sqrt{ \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} (I(k)-MU)^2}$ % % $S \approx E[\left(\frac{I(k)-MU}{SIGMA}\right)^3]$ % % The function additionally returns the temporal standard deviation matrix % and temporal expected matrix. % % % After starting the main routine just type the following command at the % prompt: % S = graphskew(DATA); % [S D] = graphskew(DATA); % [S D E] = graphskew(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then the result will % not be plotted. % % Output: % K returns the temporal speckle skewness matrix of image Data Pack. % D [Optional] returns the temporal standard deviation matrix of image Data Pack. % E [Optional] returns the temporal expected matrix of image Data Pack. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviweed by: Roberto A Braga Jr % % Date: 16 of July of 2015. % Review: 22 of July of 2015. % Review: 23 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough.'); end SIGMA = zeros(NLIN,NCOL); ED = zeros(NLIN,NCOL); Skew = zeros(NLIN,NCOL); for k = 1:NTIMES ED = ED+ DATA(:,:,k) ; end ED=ED/NTIMES; %disp('Mean matrix calculated'); for k = 1:NTIMES SIGMA = SIGMA + (DATA(:,:,k)-ED).^2; end SIGMA = sqrt(SIGMA/NTIMES) ; %disp('Deviation matrix calculated'); for k = 1:NTIMES Skew=Skew+((DATA(:,:,k)-ED)./SIGMA).^3; end Skew=Skew/NTIMES; %disp('Skewness matrix calculated'); if(nargout>=2) varargout{1}=SIGMA; end if(nargout>=3) varargout{2}=ED; end SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(ED); colorbar; title('Images: Speckle Mean'); daspect ([1 1 1]); figure imagesc(SIGMA); colorbar; title('Images: Speckle Standard Deviation'); daspect ([1 1 1]); figure imagesc(Skew); colorbar; title('Images: Speckle Skewness'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/stdcont.m0000644000175000017500000000767713417616462017020 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [C varargout] = stdcont(DATA,varargin) % % This function implements the temporal speckle contrast matrix [1], the temporal % speckle standard deviation matrix and the temporal speckle mean matrix. Use as % input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $MU= \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} I(k) \approx E[I(k)]$ % % $SIGMA = \sqrt{ \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} (I(k)-MU)^2 }$ % % With difference of proposed in [1], here is used the population standard % deviation. Finally % % $C = SIGMA/MU$ % % The function additionally also returns the deviation and expected matrices. % % Reference: % [1] R. Nothdurft and G. Yao, 'Imaging obscured subsurface inhomogeneity using % laser speckle,' Opt. Express 13, 10034-10039 (2005). % % % After starting the main routine just type the following command at the % prompt: % C = stdcont(DATA); % [C D] = stdcont(DATA); % [C D E] = stdcont(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % C returns the speckle contrast matrix of image Data Pack. % D [Optional] Returns the standard deviation matrix (SIGMA) of image Data Pack. % E [Optional] Returns the expected matrix (MU) of image Data Pack. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Jr % % Date: 16 of July of 2015. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough.'); end SIGMA = zeros(NLIN,NCOL); ED = zeros(NLIN,NCOL); for k = 1:NTIMES ED = ED+ DATA(:,:,k) ; end ED=ED/NTIMES; for k = 1:NTIMES SIGMA = SIGMA + (DATA(:,:,k)-ED).^2; end SIGMA = sqrt(SIGMA/(NTIMES)) ; C=SIGMA./(ED); if(nargout>=2) varargout{1}=SIGMA; end if(nargout>=3) varargout{2}=ED; end SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(ED); colorbar; title('Images: Speckle Mean'); daspect ([1 1 1]); figure imagesc(SIGMA); colorbar; title('Images: Speckle Standard Deviation'); daspect ([1 1 1]); figure imagesc(C); colorbar; title('Images: Speckle Contrast'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/gendiff.m0000644000175000017500000000710213417616462016723 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y] = gendiff(DATA,varargin) % % This function implements the Generalized Difference Technique [1]. Use as % input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $GD=\sum\limits_{k=1}^{NTIMES-1} \sum\limits_{l=1}^{NTIMES-k} |I(k)-I(k+l)|$ % % The function is normalized with the number of elements in the sum. % % $Y=\frac{GD}{\binom{NTIMES}{2}}$ % % Where $\binom{NTIMES}{2}$ is the binomial coefficient of NTIMES and % 2. It is the number of combinations of NTIMES items taken 2 at a time. % Thus Y matrix represents the expected value of absolute difference % $|I(k1)-I(k2)|$ for any two different k1 and k2 values. % % $Y\approx E[|I(k1)-I(k2)|]$ % % Reference: % [1] ARIZAGA, R. et al. Display of the local activity using dynamical speckle % patterns. Optical Engineering, Redondo Beach, v. 41, n. 2, p. 287-294, % June 2002. % % % After starting the main routine just type the following command at the % prompt: % Y = gendiff(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to string 'off', then do not plot the result. % % Output: % Y returns the Generalized Difference matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of May of 2013. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough') end disp('Start G.D. method ...'); Y = zeros(NLIN,NCOL); for k1 = 1:NTIMES-1 for k2 = 1:NTIMES-k1 Y = abs(DATA(:,:,k1) - DATA(:,:,k1+k2)) + Y; end if(mod(k1,round(NTIMES/10))==0) disp([num2str(k1*100/(NTIMES-1)),' %']); end end disp('[OK]'); Y=Y/nchoosek(NTIMES,2); SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(Y); colorbar title('Generalized Difference Method'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/graphic/fujii.m0000644000175000017500000000656213417616462016440 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y] = fujii(DATA,varargin) % % This function implements the Fujii Technique [1]. Use as % input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % I(k)=DATA(:,:,k) % % $FUJII=\sum\limits_{k=1}^{NTIMES-1} \frac{|I(k)-I(k+1)|}{I(k)+I(k+1)+eps}$ % % The function is normalized to: % % $Y=FUJII \frac{200}{NTIMES-1}$ % % Where (NTIMES-1) is the number of elements in the sum, 2 is a factor to % to do $(I(k)+I(k+1))/2$, a mean value, and 100 is a percentage factor. % Thus the Y matrix represents the expected percentage value of absolute difference % $|I(k)-I(k+1)|$ relative to the mean value $(I(k)+I(k+1))/2$ for any two % consecutive values. % % $Y \approx 100*E[\frac{|I(k)-I(k+1)|}{(I(k)+I(k+1))/2}]$ % % References: % [1] FUJII, H. et al. Evaluation of blood flow by laser speckle image sensing. % Applied Optics, New York, v. 26, n. 24, p. 5321-5325, 1987. % % % After starting the main routine just type the following command at the % prompt: % Y = fujii(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % SHOW [Optional] If SHOW is equal to the string 'off', then do not plot the result. % % Output: % Y returns the Fujii matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of May of 2013. % Review: 09 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if (NTIMES<2) error('Number of frames used are not enough.'); end Y = zeros(NLIN,NCOL); for k = 1:NTIMES-1 Y = abs(DATA(:,:,k) - DATA(:,:,k+1))./(DATA(:,:,k) + DATA(:,:,k+1) + eps) + Y; end Y=Y*200/(NTIMES-1); SHOW=''; if(nargin>=2) if(ischar(varargin{1})) SHOW=varargin{1}; end end if ( ~strcmp(SHOW,'off')) figure imagesc(Y);colorbar title('Fujii Method'); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/numerical/0000755000175000017500000000000013417616462015505 5ustar olafolafbsltl-1.3.1/inst/mfiles/numerical/pmf/0000755000175000017500000000000013417616462016267 5ustar olafolafbsltl-1.3.1/inst/mfiles/numerical/pmf/pmfrd.m0000644000175000017500000000571513417616462017565 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Pr varargout ]=pmfrd(COM) % % The probability mass function of regular difference (PMFRD) represents the % probabilities of a random variable W, being $W=(i-j)$. % % $Pr(w+256)=P((i-j)=w)$, $-255 \leq w \leq 255$ % % Where i is one intensity id line in COM matrix and j is one intensity id % column in COM. Thus $Pr(w+256)=P((i-j)=w)$ is the probability of happen an % intensity jump of value i to value $j=i+w$, with -255<=w<=255. This function % calculates a similar difference probability proposed in [1]. The COM matrix % need have 256x256 elements. % % References: % [1] R.M. Haralick, K. Shanmugam, and Its' Hak Dinstein. 'Textural Features % for Image Classification'. In: Systems, Man and Cybernetics, IEEE % Transactions on SMC-3.6 (Nov. 1973), pages 610-621. ISSN: 0018-9472. % % After starting the main routine just type the following command at the % prompt: % Pr = pmfrd(COM); % % Input: % COM is the Co-Occurrence matrix. A 2D matrix with 256 lines and 256 columns. % % Output: % Pr is the probability mass function, where $Pr(w+256)=P((i-j)=w)$ is the % probability of happen an intensity jump of value i to value j=i+w, with % -255<=w<=255. Pr is a vector with 511 elements. % W [OPTIONAL] is a vector with the intensities jumps $(i-j)=w$. % W=[-255:255]; % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code adapted by: Roberto A Braga Jr % % Date: 01 of July of 2015. % Review: 07 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end N=511; L=(N+1)/2; Pr=zeros(1,N); Ntot=sum(sum(COM)); for a1 = 1:Nsize(1,1) for a2 = 1:Nsize(1,2) Pr(1,round(a2-a1)+L)=Pr(1,round(a2-a1)+L)+COM(a1,a2)/Ntot; end end if(nargout>=2) varargout{1}=[-255:255]; end end bsltl-1.3.1/inst/mfiles/numerical/pmf/pmfad.m0000644000175000017500000000560113417616462017536 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Pr varargout ]=pmfad(COM) % % The probability mass function of absolute difference (PMFAD) represents the % probabilities of a random variable Z, being $Z=|i-j|$. % % $Pr(z+1)= P(|i-j|=z)$, $0 \leq z \leq 255$ % % Where i is one intensity id line in COM matrix and j is one intensity id column % in COM. Thus $Pr(z+1)= P(|i-j|=z)$ is the probability of happen an absolute % intensity jump of value z. This function calculates the difference probability [1]. % The COM matrix needs a matrix of 256x256 elements. % % References: % [1] R.M. Haralick, K. Shanmugam, and Its' Hak Dinstein. 'Textural Features % for Image Classification'. In: Systems, Man and Cybernetics, IEEE % Transactions on SMC-3.6 (Nov. 1973), pages 610-621. ISSN: 0018-9472. % % After starting the main routine just type the following command at the % prompt: % Pr = pmfad(COM); % % Input: % COM is the Co-Occurrence matrix. A 2D matrix with 256 lines and 256 columns. % % Output: % Pr is the probability mass function, where $Pr(z+1)= P(|i-j|=z)$ is the % probability of happen an absolute intensity jump of value z. 0<=z<=255 % Pr is a vector with 256 elements. % Z [OPTIONAL] is a vector with the absolute intensities jumps $|i-j|=z$. % Z=[0:255]; % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of July of 2015. % Review: 07 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end Pr=zeros(1,256); Ntot=sum(sum(COM)); for a1 = 1:Nsize(1,1) for a2 = 1:Nsize(1,2) Pr(1,round(abs(a1-a2)+1))=Pr(1,round(abs(a1-a2)+1))+COM(a1,a2)/Ntot; end end if(nargout>=2) varargout{1}=[0:255]; end end bsltl-1.3.1/inst/mfiles/numerical/avd.m0000644000175000017500000001376713417616462016453 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y, varargout] = avd(COM,varargin) % % Absolute Value of the Differences (AVD) method. This function implements % the modification proposed by BRAGA, R.A. et al. [1] that is a modification % of the Inertia Moment (IM) index. % The AVD index can be implemented using: % % $Y\approx E[|i-j|]$ % $Y2\approx E[|i-j|^2]$ % $Y3\approx E[|i-j|^2] - E[|i-j|]^2$ % % TYPE 1: The normalized co-occurrence matrix (COM) proposed by % CARDOSO, R.R. et al. [2]. The AVD first moment: $Y$. % TYPE 2: The CARDOSO, R.R. et al. [2] COM normalization with quadratic AVD % The AVD second moment: $Y2$. % TYPE 3: The AVD center second moment: $Y3$. % TYPE 4: The normalized co-occurrence matrix (COM) proposed by % ARIZAGA, R. et al. [3] (Other pseudo first moment): $Y4$. % % References: % [1] BRAGA, R.A. et al. Evaluation of activity through dynamic laser speckle % using the absolute value of the differences, Optics Communications, v. 284, % n. 2, p. 646-650, 2011. % [2] BRAGA R.A. CARDOSO, R.R. Enhancement of the robustness on dynamic speckle % laser numerical analysis. Optics and Lasers in Engineering, % 63(Complete):19-24, 2014. % [3] ARIZAGA, R. et al. Speckle time evolution characterization by the % co-occurrence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % % After starting the main routine just type the following command at the % prompt: % [Y] = avd(COM); % [Y Y2] = avd(COM,2); % [Y Y2 Y3 Y4] = avd(COM,2,3,4); % [Y Y4 Y3 Y2] = avd(COM,4,3,2); % % Input: % COM is a 2D matrix, with 256 lines and 256 columns, that represents the % Co-Occurrence Matrix of a THSP matrix. The element COM(a,b) in the % co-occurrence matrix represents the quantity of times that in two % successive columns, of THSP matrix, the intensity values jump from % a-1 to b-1. % TYPE [Optional] can be used many options. When it is used % the function returns an additional result in the same position. % If TYPE is equal to 2, the function also returns the AVD second moment, using % CARDOSO[2] COM normalization with ARIZAGA[3] value difference. % If TYPE is equal to 3, the function also returns the AVD center second moment. % If TYPE is equal to 4, the function also returns the AVD with ARIZAGA[3] % COM normalization. % % Output: % Y is the value of AVD first moment [1]. % % Ytype If TYPE is equal to 2, the function also returns the AVD second moment, using % CARDOSO[2] COM normalization with ARIZAGA[3] value difference. % If TYPE is equal to 3, the function also returns the AVD center second moment. % If TYPE is equal to 4, the function also returns the AVD with ARIZAGA[3] COM normalization. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 01 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end if( nargin~=nargout ) error('Error with the number of arguments Input/Out!!!.'); end Ntot=sum(sum(COM)); %% First moment Y=0; %% Second moment, ARIZAGA[3] value difference with CARDOSO[2] COM normalization. ENABLEavd2m=0; ENABLECALCavd2m=0; AVD2M=0; %% Center second moment, variance of AVD. ENABLEavd2c=0; AVD2C=0; %% Pseudo First moment with ARIZAGA[3] COM normalization. ENABLEavdariz=0; AVDARIZ=0; for II=2:nargin if(varargin{II-1}==2) ENABLEavd2m=1; IDOUTavd2m=II-1; elseif(varargin{II-1}==3) ENABLEavd2c=1; ENABLECALCavd2m=1; IDOUTavd2c=II-1; elseif(varargin{II-1}==4) ENABLEavdariz=1; IDOUTavdariz=II-1; else error(['Inexistent Parameter: ',num2str(varargin{II-1}),'!!!']); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for b1 = 1:Nsize(1,1) for b2 = 1:Nsize(1,2) Y = Y+ (COM(b1,b2)*abs(b1-b2)) /Ntot; %% Second moment, ARIZAGA[3] value difference with CARDOSO[2] COM normalization. if((ENABLEavd2m==1)||(ENABLECALCavd2m==1)) AVD2M = AVD2M + (COM(b1,b2)*( (b1-b2)*(b1-b2) ))/Ntot; end %% Pseudo first moment with ARIZAGA[3] COM normalization. if(ENABLEavdariz==1) norma = sum(COM(b1,:)); if norma == 0; norma= 1; end AVDARIZ = AVDARIZ + (COM(b1,b2)*abs(b1-b2) )/norma ; end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(ENABLEavd2m==1) varargout{IDOUTavd2m}=AVD2M; end if(ENABLEavd2c==1) varargout{IDOUTavd2c}=AVD2M-Y^2; end if(ENABLEavdariz==1) varargout{IDOUTavdariz}=AVDARIZ; end bsltl-1.3.1/inst/mfiles/numerical/thsp/0000755000175000017500000000000013417616462016463 5ustar olafolafbsltl-1.3.1/inst/mfiles/numerical/thsp/thsp_random.m0000644000175000017500000000762713417616462021173 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y varargout] = thsp_random(DATA, M,varargin) % % This function creates the THSP (Time History Speckle Pattern)[1][2] of a set % of M points (pixels) randomly (Uniform) selected in DATA(:,:,1), and through % DATA(:,:,k) for all k value. % % References: % [1] OULOMARA, G.; TRIBILLON, J.; DUVERNOY, J. Biological activity measurements % on botanical specimen surfaces using a temporal decorrelation effect of % laser speckle. Journal of Moderns Optics, London, v. 36, n. 2, p. 136-179, % Feb. 1989. % % [2] XU, Z.; JOENATHAN, C.; KHORANA, B. M. Temporal and spatial properties of % the time-varying speckles of botanical specimens. Optical Engineering, Virginia, % v. 34, n. 5, p. 1487-1502, May 1995. % % After starting the main routine just type the following command at the % prompt: % Y = thsp_random(DATA, M); % [Y POINTS]= thsp_random(DATA, M); % [Y POINTS]= thsp_random(DATA, M, 'on'); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % M is the number of points, randomly selected, in analysis. % Show [Optional] can be used in the last position of input, and its % function is to enable a graphic outcome of selected points in the % THSP. Show='on' to enable. And disable in other cases, by default Show='off'. % % Output: % Y is the time history speckle pattern. Where Y is a 2D matrix with % M lines and NTIMES columns. % POINTS [Optional] is a matrix with two columns and % M lines. Thus, each line represents one point under study. (line,column). % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of May of 2013. % Review: 28 of March of 2016. % a = size(DATA); NLIN =a(1,1); NCOL =a(1,2); NTIMES=a(1,3); Y = zeros(M,NTIMES); POINTS = zeros(M,2); for b = 1:M lin = randi(NLIN); col = randi(NCOL); POINTS(b,1) = lin; POINTS(b,2) = col; for c = 1:NTIMES Y(b,c) = DATA(lin,col,c); end end SHOW='off'; if(nargin>2) for II=3:nargin if(ischar(varargin{II-2})) SHOW=varargin{II-2}; end end end if(strcmp(SHOW,'on')) imagesc(DATA(:,:,1)); hold on; scatter(POINTS(:,2),POINTS(:,1),'r'); refresh hold off; end if(nargout >=2) varargout{1}=POINTS; end end bsltl-1.3.1/inst/mfiles/numerical/thsp/thsp.m0000644000175000017500000000766113417616462017631 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y] = thsp(DATA,R,S) % % This function creates the THSP (Time History Speckle Pattern)[1][2] of a set % of pixels in a line or column of a datapack (DATA). % % References: % [1] OULOMARA, G.; TRIBILLON, J.; DUVERNOY, J. Biological activity measurements % on botanical specimen surfaces using a temporal decorrelation effect of % laser speckle. Journal of Moderns Optics, London, v. 36, n. 2, p. 136-179, % Feb. 1989. % % [2] XU, Z.; JOENATHAN, C.; KHORANA, B. M. Temporal and spatial properties of % the time-varying speckles of botanical specimens. Optical Enginnering, Virginia, % v. 34, n. 5, p. 1487-1502, May 1995. % % After starting the main routine just type the following command at the % prompt: % Y = thsp(DATA,R,S); % Y = thsp(DATA,'line',100); % THSP matrix with the line 100 of datapack. % Y = thsp(DATA,1,100); % THSP matrix with the line 100 of datapack. % Y = thsp(DATA,'column',100); % THSP matrix with the column 100 of datapack. % Y = thsp(DATA,2,100); % THSP matrix with the column 100 of datapack. % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % R is a parameter of analysis: % if R is equal to 1 or 'line', you choose the lines of images to create the THSP and % if R is equal to 2 or 'column', you choose the columns of images to create the THSP. % In other cases the function returns error. % S is the line or column position used to make the time history speckle patterns. % The function do not verify if S is in the possible range, this check must be done by the user. % % Output: % Y is the time history speckle patterns matrix. Where Y is a 2D matrix with % M lines and NTIMES columns, being M equal to NCOL when R is 1 and M equal % to NLIN when R is 2. % Y is a matrix where each column is a representation of one only line or column % in the S position of DATA. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of May of 2013. % Review: 28 of March of 2016. % a = size(DATA); if ((R == 1) | strcmp(R,'line')) Y = zeros(a(1,2),a(1,3)); for b = 1:a(1,3) Y(:,b) = (DATA(S,:,b))'; end elseif ((R == 2) | strcmp(R,'column')) Y = zeros(a(1,1),a(1,3)); for b = 1:a(1,3) Y(:,b) = DATA(:,S,b); end else Y = 0; error('Error in the THSP image: No valid value of R'); end return; bsltl-1.3.1/inst/mfiles/numerical/thsp/thsp_line.m0000644000175000017500000000630713417616462020634 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y] = thsp_line(DATA,R,S) % % This function creates the THSP (Time History Speckle Pattern)[1][2] of a set % of pixels in a line in a data pack (DATA), (This function is an alias of % thsp() function). % % References: % [1] OULOMARA, G.; TRIBILLON, J.; DUVERNOY, J. Biological activity measurements % on botanical specimen surfaces using a temporal decorrelation effect of % laser speckle. Journal of Moderns Optics, London, v. 36, n. 2, p. 136-179, % Feb. 1989. % % [2] XU, Z.; JOENATHAN, C.; KHORANA, B. M. Temporal and spatial properties of % the time-varying speckles of botanical specimens. Optical Enginnering, Virginia, % v. 34, n. 5, p. 1487-1502, May 1995. % % After starting the main routine just type the following command at the % prompt: % Y = thsp_line(DATA,R,S); % % Input: % DATA is the speckle datapack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % R is a parameter of analysis: % if R is equal to 1, you choose the lines from the images to create the THSP and % if R is equal to 2, you choose the columns of images to create the THSP. % In other cases it returns error. % S is the line or column position used to create the time history speckle pattern. % The function do not verify if S is in the range, this must be checked by the user. % % Output: % Y is the time history speckle patterns matrix. Where Y is a 2D matrix with % M lines and NTIMES columns, being M equal to NCOL when R is 1 and M equal % to NLIN when R is 2. % Y is a matrix where each column is a representation of one only line or column % in the S position of DATA. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of May of 2013. % Review: 28 of March of 2016. % Y = thsp(DATA,R,S); bsltl-1.3.1/inst/mfiles/numerical/thsp/thsp_gaussian.m0000644000175000017500000002142613417616462021516 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y varargout] = thsp_gaussian(DATA, M,Sigma,varargin) % % This function creates the THSP (Time History Speckle Pattern)[1][2] % of a set of M points (pixels) randomly (Gaussian) selected in EXAMPLE_MATRIX, % and through DATA(:,:,k) for all k value. % Around a point P0, M points are selected randomly, these points are concentrated % mostly in a radius Sigma around the point P0. % % References: % [1] OULOMARA, G.; TRIBILLON, J.; DUVERNOY, J. Biological activity measurements % on botanical specimen surfaces using a temporal decorrelation effect of % laser speckle. Journal of Moderns Optics, London, v. 36, n. 2, p. 136-179, % Feb. 1989. % % [2] XU, Z.; JOENATHAN, C.; KHORANA, B. M. Temporal and spatial properties of % the time-varying speckles of botanical specimens. Optical Engineering, Virginia, % v. 34, n. 5, p. 1487-1502, May 1995. % % After starting the main routine just type the following command at the % prompt: % Y = thsp_gaussian(DATA,M,Sigma); % % [Y POINTS]= thsp_gaussian(DATA,M,Sigma,'on'); % [Y POINTS]= thsp_gaussian(DATA,M,Sigma,P0); % [Y POINTS]= thsp_gaussian(DATA,M,Sigma,P0,'on'); % [Y POINTS]= thsp_gaussian(DATA,M,Sigma,HG); % [Y POINTS]= thsp_gaussian(DATA,M,Sigma,HG,'on'); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % M is the number of points, Gaussian randomly selected, in analysis. % Sigma is the standard deviation in pixels. % P0 [Optional] is the initial point [line column], around this point, M % values are selected to create the time history speckle pattern. If this parameter % is not used, then a graphic window is enabled to the selection of a point P0. % HG [Optional] is the used graphic handler; Additionally, it is enable the graphic % selection of a point P0 in the figure pointed by the graphic handler. % MAT [Optional] is a matrix thats enable the graphic % selection of a point P0 in the figure created of imagesc the MAT. % Show [Optional] can be used in the last position of input, and its function % is used to enable a graphic output of the selected points that formed the % THSP. Show='on', Show='on-red', Show='on-red-filled', Show='on-green', % Show='on-green-filled', Show='on-blue' , Show='on-blue-filled' % Show='on-cyan', Show='on-cyan-filled', Show='on-magenta', % Show='on-magenta-filled', Show='on-yellow', Show='on-yellow-filled', % Show='on-black', Show='on-black-filled', Show='on-gray' or % Show='on-gray-filled', Show='on-white' or % Show='on-white-filled' to enable. % It is disabled in other cases, by default Show='off'. % Show='on' plot the points in the color red, in other cases are used the % specified colors. % % Output: % Y is the time history speckle pattern. Where, Y is a 2D matrix with % M lines and NTIMES columns. % POINTS [Optional] is a matrix with two columns and % M lines. Thus, each line represents one point in study, (line,column). % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % Fernando Pujaico Rivera % % Date: 09 of July of 2015. % Review: 01 of July of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); Y = zeros(M,NTIMES); POINTS = zeros(M,2); EXAMPLE_MATRIX=DATA(:,:,1); [P0 HG SHOW]=bsltl_get_point0(varargin{:},EXAMPLE_MATRIX); if( (P0(1)<1) || (P0(1)>NLIN) ) error(sprintf('The line of selected central point is out of datapack line limits. LINE:%d',P0(1))); end if( (P0(2)<1) || (P0(2)>NCOL) ) error(sprintf('The column of selected central point is out of datapack column limits. COLUMN:%d',P0(2))); end POINTS(:,1) = Sigma*randn([M 1])+P0(1); %%lines POINTS(:,2) = Sigma*randn([M 1])+P0(2); %%columns for m = 1:M POINTS(m,1)=round(POINTS(m,1)); POINTS(m,2)=round(POINTS(m,2)); while ( (POINTS(m,1)<1) || (POINTS(m,1)>NLIN) || (POINTS(m,2)<1) || (POINTS(m,2)>NCOL) ) POINTS(m,1) = round(Sigma*randn(1)+P0(1)); POINTS(m,2) = round(Sigma*randn(1)+P0(2)); end end for m = 1:M for k = 1:NTIMES Y(m,k) = DATA( POINTS(m,1) , POINTS(m,2) , k); end end bsltl_plot_points(POINTS,HG,EXAMPLE_MATRIX,SHOW); if(nargout >=2) varargout{1}=POINTS; end end %% %% Getting a point P0 and HG. %% function [P0 HG SHOW]=bsltl_get_point0(varargin) HG=0; P0=[0 0]; SHOW='off'; %% P0 and HG loaded for II=1:nargin if( isvector(varargin{II}) && (length(varargin{II})==2) && ~ischar(varargin{II}) ) P0=varargin{II}; elseif( ishghandle(varargin{II}) ) HG=figure(varargin{II}); refresh(HG); elseif( ischar(varargin{II})) SHOW=varargin{II}; elseif( (length(size(varargin{II}))==2)&&(min(size(varargin{II}))>=3)&&(HG==0) ) imagesc(varargin{II}); HG=gcf; refresh(HG); end end if ((P0(1)==0)||(P0(2)==0)) msgbox('Please select one point'); [ P0(2) P0(1)]=ginput(1); end end %% %% Getting a point P0 and HG. %% function bsltl_plot_points(POINTS,HG,EXAMPLE_MATRIX,SHOW) if(strcmp(SHOW,'off')~=1) if(HG==0) imagesc(EXAMPLE_MATRIX); end N=size(POINTS,1); hold on; if(strcmp(SHOW,'on')) scatter(POINTS(:,2),POINTS(:,1),'r'); elseif(strcmp(SHOW,'on-filled') ) scatter(POINTS(:,2),POINTS(:,1),'r','filled'); elseif(strcmp(SHOW,'on-red') ) scatter(POINTS(:,2),POINTS(:,1),'r'); elseif(strcmp(SHOW,'on-red-filled') ) scatter(POINTS(:,2),POINTS(:,1),'r','filled'); elseif(strcmp(SHOW,'on-green') ) scatter(POINTS(:,2),POINTS(:,1),'g'); elseif(strcmp(SHOW,'on-green-filled') ) scatter(POINTS(:,2),POINTS(:,1),'g','filled'); elseif(strcmp(SHOW,'on-blue') ) scatter(POINTS(:,2),POINTS(:,1),'b'); elseif(strcmp(SHOW,'on-blue-filled') ) scatter(POINTS(:,2),POINTS(:,1),'b','filled'); elseif(strcmp(SHOW,'on-black') ) scatter(POINTS(:,2),POINTS(:,1),'k'); elseif(strcmp(SHOW,'on-black-filled') ) scatter(POINTS(:,2),POINTS(:,1),'k','filled'); elseif(strcmp(SHOW,'on-gray') ) scatter(POINTS(:,2),POINTS(:,1),[],0.7*ones(N,3)); elseif(strcmp(SHOW,'on-gray-filled') ) scatter(POINTS(:,2),POINTS(:,1),[],0.7*ones(N,3),'filled'); elseif(strcmp(SHOW,'on-white') ) scatter(POINTS(:,2),POINTS(:,1),'w'); elseif(strcmp(SHOW,'on-white-filled') ) scatter(POINTS(:,2),POINTS(:,1),'w','filled'); elseif(strcmp(SHOW,'on-cyan') ) scatter(POINTS(:,2),POINTS(:,1),'c'); elseif(strcmp(SHOW,'on-cyan-filled') ) scatter(POINTS(:,2),POINTS(:,1),'c','filled'); elseif(strcmp(SHOW,'on-magenta') ) scatter(POINTS(:,2),POINTS(:,1),'m'); elseif(strcmp(SHOW,'on-magenta-filled') ) scatter(POINTS(:,2),POINTS(:,1),'m','filled'); elseif(strcmp(SHOW,'on-yellow') ) scatter(POINTS(:,2),POINTS(:,1),'y'); elseif(strcmp(SHOW,'on-yellow-filled') ) scatter(POINTS(:,2),POINTS(:,1),'y','filled'); end refresh hold off; end end bsltl-1.3.1/inst/mfiles/numerical/extras/0000755000175000017500000000000013417616462017013 5ustar olafolafbsltl-1.3.1/inst/mfiles/numerical/extras/thsp2corr.m0000644000175000017500000000721713417616462021126 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [C varargout] = thsp2corr(THSP, varargin) % % This function implements the space-time speckle correlation [1] % technique. % Use as input data a matrix THSP of M lines and NTIMES columns, that % represents the intensity time evolution of M pixels in NTIMES samples. % % CORR(i,l) = corr( THSP(:,i) , THSP(:,i+l) ) % % Correlation type 1: % $corr(A,B)=\frac{E[AB]}{\sqrt{E[A^2]E[B^2]}}$ % % Correlation type 2 (Pearson correlation): % $corr(A,B)= \frac{E[(A-\mu_A)(B-\mu_B)]}{\sqrt{E[(A-\mu_A)^2]E[(B-\mu_B)^2]}}$ % % $C(l) = \frac{1}{NTIMES/2}\sum\limits_{i=1}^{NTIMES/2} CORR(i,l)$, % % [1] ZiJie Xu, Charles Joenathan, and Brij M. Khorana. 'Temporal and spatial % properties of the time-varying speckles of botanical specimens'. % In: Optical Engineering 34.5 (1995), pages 1487-1502. % % After starting the main routine just type the following command at the % prompt: % C = thsp2corr(THSP); % C = thsp2corr(THSP,2); % [C L] = thsp2corr(THSP); % [C L] = thsp2corr(THSP,2); % % Input: % THSP is a integer 2D matrix that represents the time history speckle pattern (THSP). % This matrix can be obtained using the function THSP. It is necessary that the % THSP matrix only has values between 0 and 255, the function does not % verify. The function truncates values outside this interval. % TYPE [optional] indicates the type of correlation used. If TYPE=1 then it is used % the correlation type 1, in other case, it is used the Pearson correlation. % By default it is used the correlation type 1. % % Output: % C is the correlation vector, with elements C(j) for all 0<=j<=NTIMES/2. % L is a vector with the times j of C(j). L=[0:NTIMES/2]. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 25 of August of 2015. % Review: 28 of March of 2016. % TYPE=1; NSIZE = size(THSP); M= NSIZE(1,1); N= NSIZE(1,2); N2=floor(N/2); CMAT = zeros(N2,N2); if (nargin>1) if isnumeric(varargin{1}) TYPE=varargin{1}; end end if TYPE==1 for II=1:N2 for LL=1:N2 CMAT(II,LL)=pseudo_corr(THSP(:,II), THSP(:,II+LL) ); end end else for II=1:N2 for LL=1:N2 CMAT(II,LL)=corr(THSP(:,II), THSP(:,II+LL) ); end end end C = zeros(1,N2+1); C(1) =1.0; for LL=1:N2 C(LL+1)=mean(CMAT(:,LL)); end if (nargout>1) varargout{1} = [0:N2]; end end function C=pseudo_corr(A,B) C=sum(A.*B)/sqrt(sum(A.^2)*sum(B.^2)); end bsltl-1.3.1/inst/mfiles/numerical/extras/stscorr.m0000644000175000017500000000737213417616462020701 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [C varargout] = stscorr(DATA,Tau,K0) % % This function implements the spatial-temporal speckle correlation [1] % technique. The correlation is applied between K0 image and % all other images. % Use as input data a 3D matrix created grouping NTIMES intensity matrices I(k) % 1<=k<=NTIMES % % L = [1:NTIMES]-K0 % LTau = L * Tau % % $corr(A,B)= \frac{E[(A-\mu_A)(B-\mu_B)]}{\sqrt{E[(A-\mu_A)^2]E[(B-\mu_B)^2]}}$ % % $C(k)= corr(I(K0),I(k))$, $\forall~1 \leq k \leq NTIMES$ % % [1] ZDUNEK, A. et al. New nondestructive method based on spatial-temporal % speckle correlation technique for evaluation of apples quality during % shelf-life. International Agrophysics, v. 21, n. 3, p. 305-310, 2007. % % After starting the main routine just type the following command at the % prompt: % C = stscorr(DATA,Tau,K0) % [C LTau] = stscorr(DATA,Tau,K0) % [C LTau L] = stscorr(DATA,Tau,K0) % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % Tau is the sampling rate in seconds. % K0 is the number of the reference frame used in correlation analysis. % % Output: % C is the correlation vector. This corresponds with the C(l*tau) values used % in [1] at equation (7), with the difference that negative values of % l*tau also are calculated. % LTau [Optional] is the vector with the values of time l*tau in the vector C. This % can have negative values. % L [Optional] is the vector with the values of index l in the vector C. This % can have negative values. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 25 of August of 2013. % Review: 28 of March of 2016. % NSIZE = size(DATA); NTIMES=NSIZE(1,3); NEL=NSIZE(1,1)*NSIZE(1,2); C = zeros(1,NTIMES); LL = [1:NTIMES]-K0; LTau = LL*Tau; for KK = 1:NTIMES C(KK) = corr( reshape(DATA(:,:,K0),[NEL 1]) , reshape(DATA(:,:,KK),[NEL 1]) ); end if (nargout>=2) varargout{1}=LTau; end if (nargout>=3) varargout{2}=LL; end figure(1) plot(LTau,C,'-s');grid on; xlim([min(LTau) max(LTau)]); xlabel('k tau'); ylabel('Correlation coefficients'); title(['Spatial-Temporal Speckle Correlation Technique: k0=',num2str(K0)]); bsltl-1.3.1/inst/mfiles/numerical/coom.m0000644000175000017500000000613413417616462016624 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [C] = coom(THSP) % % This function creates the Co-occurrence matrix (COM)[1]. Also known as GLCM % (gray-level co-occurrence matrices), GLCH (gray-level co-occurrence histograms) % or spatial dependence matrix. % % References: % [1] ARIZAGA, R. et. al. Speckle time evolution characterization by the % co-occurence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % % After starting the main routine just type the following command at the % prompt: % C = coom(THSP); % % Input: % THSP is an integer 2D matrix that represents the time history speckle pattern (THSP). % This matrix can be obtained using the function THSP. It is necessary that the % THSP matrix only have values between 0 and 255, the function does not % verify. The function limits the values outside this interval. % % Output: % C is a 2D matrix, with 256 lines and 256 columns, that represents the % Co-Occurrence Matrix of a THSP matrix. The element C(a,b) in the C % co-occurrence matrix represents the quantity of times that, in two % successive columns of a THSP matrix, the intensity values changed from % a-1 to b-1. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of may of 2013. % Review: 15 of august of 2013. % Review: 22 of august of 2013. % Review: 28 of March of 2016. % a = size(THSP); C = zeros(256,256); for linea = 1:a(1,1) for col = 1:a(1,2)-1 d1 = THSP(linea,col)+1; d2 = THSP(linea,col+1)+1; d1=round(d1); d2=round(d2); %Limits the value in the range if (d1 >= 256) d1 = 256; end if (d1<=1) d1=1; end if (d2 >= 256) d2 = 256; end if (d2<=1) d2=1; end C(d1,d2) = C(d1,d2)+1; end end return; bsltl-1.3.1/inst/mfiles/numerical/numad.m0000644000175000017500000000741413417616462016775 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y, varargout] = numad(COM,varargin) % % Numerical analysis of the modified AVD method [1]. This function implements % the the numerical method [1] that is a modification % over absolute difference (Fujii method) [2] % % $Y \approx E[\frac{|i-j|}{i+j}]$ % $Y2\approx E[\frac{(i-j)^2}{(i+j)^2}]$ % % References: % [1] Renan O Reis; Roberto Braga; Hector J Rabal. % Light intensity independence during dynamic laser speckle analysis % [2] FUJII, H. et al. Evaluation of blood flow by laser speckle image sensing. % Applied Optics, New York, v. 26, n. 24, p. 5321-5325, 1987. % % After starting the main routine just type the following command at the % prompt: % [Y] = numad(COM); % [Y Y2] = numad(COM,2); % % Input: % COM is a 2D matrix, with 256 lines and 256 columns, that represents the % Co-Occurrence Matrix of THSP matrix. The element COM(a,b), in the % co-occurrence matrix, represents the quantity of times that, in two % successive columns of a THSP matrix, the intensity values jump of % a-1 to b-1. % TYPE [Optional] the function returns an additional result. % If TYPE is equal to 2, the function also returns the AD second moment. % % Output: % Y is the value of the modified AVD first moment [1]. % % Y2 if TYPE is equal to 2, the function also returns the AVD second moment. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end if nargin > 2 error('This function only accepts two parameters!!!.'); end if( nargin~=nargout ) error('Error with the number of arguments Input/Out!!!.'); end ENABLEad2m=0; if nargin > 1 if(varargin{1}==2) ENABLEad2m=1; else error(['Inexistent type: ',num2str(varargin{1}),'!!!']); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Ntot=sum(sum(COM)); %% First moment Y=0; %% Second moment AD2M =0; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for b1 = 1:Nsize(1,1) for b2 = 1:Nsize(1,2) Y = Y+ (COM(b1,b2)/Ntot)*(abs(b1-b2)/(b1+b2+eps)) ; %% Second moment with CARDOSO[2] COM normalization. if(ENABLEad2m==1) AD2M = AD2M + (COM(b1,b2)/Ntot)*( (b1-b2)^2/(b1+b2+eps)^2 ); end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(ENABLEad2m==1) varargout{1}=AD2M; end bsltl-1.3.1/inst/mfiles/numerical/rvd.m0000644000175000017500000001323213417616462016457 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y, varargout] = rvd(COM,varargin) % % Regular Value of the Differences (RVD) method [1]. This function implements the % modification proposed by over the AVD [2]. % This method can be combined with: % % $Y \approx E[(i-j)]$ % $Y2\approx E[(i-j)^2]$ % $Y3\approx E[(i-j)^2] -E[(i-j)]^2$ % % TYPE 1: The normalized co-occurrence matrix (COM) proposed by % CARDOSO, R.R. et al. [2]. The RVD first moment: $Y$. % TYPE 2: The CARDOSO, R.R. et al. [2] COM normalization with quadratic RVD % The RVD second moment: $Y2$. % TYPE 3: The RVD center second moment: $Y3$. % TYPE 4: The normalized co-occurrence matrix (COM) proposed by % ARIZAGA, R. et al. [3]: $Y4$. % % References: % [1] Pujaico Rivera Fernando. Paper coming soon. % [2] BRAGA R.A. CARDOSO, R.R. Enhancement of the robustness on dynamic speckle % laser numerical analysis. Optics and Lasers in Engineering, % 63(Complete):19-24, 2014. % [3] ARIZAGA, R. et al. Speckle time evolution characterization by the % co-occurrence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % % After starting the main routine just type the following command at the % prompt: % [Y] = rvd(COM); % [Y Y2] = rvd(COM,2); % [Y Y2 Y3 Y4] = rvd(COM,2,3,4); % [Y Y4 Y3 Y2] = rvd(COM,4,3,2); % % Input: % COM is a 2D matrix, with 256 lines and 256 columns, that represents the % Co-Occurrence Matrix of a THSP matrix. The element COM(a,b), in the % co-occurrence matrix, represents the quantity of times that, in two % successive columns of a THSP matrix, the intensity values jump of % a-1 to b-1. % TYPE [Optional] the function returns an additional result in the same position. % If TYPE is equal to 2, the function also returns the RVD second moment, using the % CARDOSO[2] COM normalization with ARIZAGA[3] value difference. % If TYPE is equal to 3, the function also returns the RVD center second moment. % If TYPE is equal to 4, the function also returns the RVD with ARIZAGA[3] % COM normalization. % % Output: % Y is the value of RVD first moment [?]. % % X If TYPE is equal to 2, the function also returns the RVD second moment, using the % CARDOSO[2] COM normalization with ARIZAGA[3] value difference. % If TYPE is equal to 3, the function also returns the RVD center second moment. % If TYPE is equal to 4, the function also returns the RVD with ARIZAGA[3] COM normalization. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end if( nargin~=nargout ) error('Error with the number of arguments Input/Out!!!.'); end Ntot=sum(sum(COM)); %% First moment Y=0; %% Second moment, ARIZAGA[3] value difference with CARDOSO[2] COM normalization. ENABLErvd2m=0; ENABLECALCrvd2m=0; RVD2M=0; %% Center second moment, variance of RVD. ENABLErvd2c=0; RVD2C=0; %% Pseudo First moment with ARIZAGA[3] COM normalization. ENABLErvdariz=0; RVDARIZ=0; for II=2:nargin if(varargin{II-1}==2) ENABLErvd2m=1; IDOUTrvd2m=II-1; elseif(varargin{II-1}==3) ENABLErvd2c=1; ENABLECALCrvd2m=1; IDOUTrvd2c=II-1; elseif(varargin{II-1}==4) ENABLErvdariz=1; IDOUTrvdariz=II-1; else error(['Inexistent Parameter: ',num2str(varargin{II-1}),'!!!']); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for b1 = 1:Nsize(1,1) for b2 = 1:Nsize(1,2) Y = Y+ (COM(b1,b2)*(b2-b1)) /Ntot; %% Second moment, ARIZAGA[3] value difference with CARDOSO[2] COM normalization. if((ENABLErvd2m==1)||(ENABLECALCrvd2m==1)) RVD2M = RVD2M + (COM(b1,b2)*( (b2-b1)*(b2-b1) ))/Ntot; end %% Pseudo first moment with ARIZAGA[3] COM normalization. if(ENABLErvdariz==1) norma = sum(COM(b1,:)); if norma == 0; norma= 1; end RVDARIZ = RVDARIZ + (COM(b1,b2)*(b2-b1) )/norma ; end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(ENABLErvd2m==1) varargout{IDOUTrvd2m}=RVD2M; end if(ENABLErvd2c==1) varargout{IDOUTrvd2c}=RVD2M-Y^2; end if(ENABLErvdariz==1) varargout{IDOUTrvdariz}=RVDARIZ; end bsltl-1.3.1/inst/mfiles/numerical/inertiamoment.m0000644000175000017500000001054613417616462020544 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y, varargout] = inertiamoment(COM,varargin) % % This function implements the Inertia Moment (IM) method [1]. % This method can be used with different normalizations over the co-occurrence % matrix. Thus, they can be: % % $Y\approx E[(i-j)^2]$ % % TYPE 1: The function uses the normalized co-occurrence matrix (COM) proposed by % CARDOSO, R.R. et al. [2]: $Y$. % TYPE 2: The function uses the normalized co-occurrence matrix (COM) proposed by % ARIZAGA, R. et al. [1]: $Y2$. % % References: % [1] ARIZAGA, R. et al. Speckle time evolution characterization by the % co-occurrence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % [2] BRAGA R.A. CARDOSO, R.R. Enhancement of the robustness on dynamic speckle % laser numerical analysis. Optics and Lasers in Engineering, % 63(Complete):19-24, 2014. % % After starting the main routine just type the following command at the % prompt: % [Y] = inertiamoment(COM); % [Y Y2] = inertiamoment(COM,2); % % Input: % COM is a 2D matrix, with 256 lines and 256 columns, that represents the % Co-Occurrence Matrix of THSP matrix. The element COM(a,b) in the % co-occurrence matrix represents the quantity of times that, in two % successive columns of a THSP matrix, the intensity values jump of % a-1 to b-1. % TYPE [Optional] the function returns an additional % result in the same position in the output. % If TYPE is equal to 2, the function also returns the inertia moment % with ARIZAGA [2] co-occurrence normalization. % % Output: % Y is the value of inertia moment [1] with CARDOSO normalization [2]. % % Ytype if TYPE is equal to 2, the function also returns the inertia moment. % ARIZAGA [2] co-occurrence normalization. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 01 of July of 2015. % Review: 28 of March of 2016. % Nsize = size(COM); if( (Nsize(1,1)~=256)||(Nsize(1,2)~=256) ) error('The co-occurrence matrix is not 256x256!!!.'); end if( nargin~=nargout ) error('Error with the number of arguments Input/Out!!!.'); end Ntot=sum(sum(COM)); %% First moment Y=0; %% Pseudo First moment with ARIZAGA[2] COM normalization. ENABLE_im_ariz=0; IM_ARIZ=0; for II=2:nargin if(varargin{II-1}==2) ENABLE_im_ariz=1; IDOUT_im_ariz=II-1; else error(['Inexistent Parameter: ',num2str(varargin{II-1}),'!!!']); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for b1 = 1:Nsize(1,1) if(ENABLE_im_ariz==1) norma = sum(COM(b1,:)); if norma == 0; norma= eps; end end for b2 = 1:Nsize(1,2) Y = Y+ (COM(b1,b2)*(b1-b2)^2) /Ntot; %% Pseudo first moment with ARIZAGA[2] COM normalization. if(ENABLE_im_ariz==1) IM_ARIZ = IM_ARIZ + (COM(b1,b2)*(b1-b2)^2 )/norma ; end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if(ENABLE_im_ariz==1) varargout{IDOUT_im_ariz}=IM_ARIZ; end bsltl-1.3.1/inst/mfiles/quality/0000755000175000017500000000000013417616462015216 5ustar olafolafbsltl-1.3.1/inst/mfiles/quality/sscont.m0000644000175000017500000000724313417616462016713 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [C,mC] = sscont(DATAFRAME,WLines,WColumns) % % Spatial speckle contrast window [1] method. This consist in test the contrast % of speckles in a window region of an image. The image DATAFRAME is % divided into windows of WLines pixel lines and WColumns pixel columns. % The contrast in a window Cw is calculated as the quotient between spatial % standard deviation (populational) and spatial mean in the window. % All the pixels in the analysed window are filled with the contrast value. % % Cw=(Spatial Deviation)/(Spatial Mean) % % [1] Cardoso, R.R. ; Braga, R.A. ; Rabal, H.J. Alternative protocols on % dynamic speckle laser analysis. SPIE 8413, V International Conference % on Speckle Metrology. 2012 % % After starting the main routine just type the following command at the % prompt: % [C,mC] = sscont(DATAFRAME,WLines,WColumns); % % Analysis window of 6x5 pixels. % [C,mC] = sscont(DATAFRAME,6,5); % % Input: % DATAFRAME is the image under analysis. % WLines is the number of lines in the analysed window. % WColumns is the number of columns in the analysed window. % % Output: % C is the spatial speckle contrast window image. % mC is the mean value of the contrast in all windows. % % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of August of 2015. % Review: 15 of March of 2016. % NSIZE = size(DATAFRAME); NLIN=NSIZE(1,1); NCOL=NSIZE(1,2); if(rem(NLIN,WLines)~=0) TEXT1=['WLines must be multiple of: ',mat2str(factor(NLIN)),'.']; TEXT2=['The last ',num2str(rem(NLIN,WLines)),' pixel lines (botom) were not processed']; warning([TEXT1,TEXT2]); %msgbox(TEXT1,TEXT2); end if(rem(NCOL,WColumns)~=0) TEXT1=['WColumns must be multiple of: ',mat2str(factor(NCOL)),'.']; TEXT2=['The last ',num2str(rem(NCOL,WColumns)),' pixel columns (right) were not processed']; warning([TEXT1,TEXT2]); end TOTAL=WLines*WColumns; C = zeros(NLIN,NCOL); for lin = 1:WLines :NLIN-(WLines-1) for col = 1:WColumns:NCOL-(WColumns-1) LINES = lin : lin+(WLines-1); COLUMNS = col : col+(WColumns-1); Z = DATAFRAME(LINES,COLUMNS); C(LINES,COLUMNS) = std(reshape(Z,1,TOTAL),1)/(mean(mean(Z))+eps); end end mC = mean(mean(C)); figure(1); imagesc(C); colorbar title(sprintf('Spatial speckle contrast method - %f.',mC)); daspect ([1 1 1]); end bsltl-1.3.1/inst/mfiles/quality/satdark.m0000644000175000017500000001564613417616462017041 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [F S D] = satdark(DATAFRAME,WLines,WColumns,MaxDark,MinSat,P) % % Saturation and sub-exposition of light[1]. Here it is tested if % an analysed windows of the image is saturated with light or is dark. % % [1] Cardoso, R.R. ; Braga, R.A. ; Rabal, H.J. Alternative protocols on % dynamic speckle laser analysis. SPIE 8413, V International Conference % on Speckle Metrology. 2012 % % After starting the main routine just type the following command at the % prompt: % [F S D] = satdark(DATAFRAME, WLines, WColumns, MaxDark, MinSat, P); % % Analysis window of 6x5 pixels and % % 50 percent of pixels in the window to declare it dark or saturated. % [F S D] = satdark(DATAFRAME, 6, 5, MaxDark, MinSat, 50); % % Input: % DATAFRAME is the image under analysis. % WLines is the number of lines in the analysed window. % WColumns is the number of columns in the analysed window. % MaxDark is the maximum gray-scale level that is considered as dark. % MinSat is the minimum gray-scale level that is considered as saturated. % P is the percentage of pixels in a window to declare it dark or saturated. % % Output: % F is an image with dark or saturated areas in analysed windows. % The dark windows are filled with 0, the saturated windows are % filled with 255. To consider a window as dark or saturated, % it should overcome a P percentage of pixels in analysis window. % S is a matrix with the same size of F, this matrix has ones in % regions with saturated windows and zeros in other regions. % D is a matrix with the same size of F, this matrix has ones in % regions with dark windows and zeros in other regions. % % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of August of 2015. % Review: 28 of March of 2016. % NSIZE = size(DATAFRAME); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); if(rem(NLIN,WLines)~=0) TEXT1=['WLines must be multiple of: ',mat2str(factor(NLIN)),'.']; TEXT2=['The last ',num2str(rem(NLIN,WLines)),' pixel lines (botom) were not processed']; warning([TEXT1,TEXT2]); %msgbox(TEXT1,TEXT2); end if(rem(NCOL,WColumns)~=0) TEXT1=['WColumns must be multiple of: ',mat2str(factor(NCOL)),'.']; TEXT2=['The last ',num2str(rem(NCOL,WColumns)),' pixel columns (right) were not processed']; warning([TEXT1,TEXT2]); end F = zeros(NLIN,NCOL); S = zeros(NLIN,NCOL); D = zeros(NLIN,NCOL); for lin = 1: WLines : ( NLIN-(WLines-1) ) for col = 1: WColumns : ( NCOL-(WColumns-1) ) LINES = lin : lin+(WLines-1); COLUMNS = col : col+(WColumns-1); [f s d] = part_sat_dark( DATAFRAME( LINES , COLUMNS ) ,MaxDark,MinSat,P); F( LINES , COLUMNS ) = f; S( LINES , COLUMNS ) = s; D( LINES , COLUMNS ) = d; end end figure(1); imagesc(F); colorbar; title('Preview'); daspect ([1 1 1]); figure(2); imagesc(S); colorbar; title('Saturation Zone Image'); daspect ([1 1 1]); figure(3); imagesc(D); daspect ([1 1 1]) colorbar; title('Dark Zone Image'); daspect ([1 1 1]); end function [F S D] = part_sat_dark(WINDOW,MaxDark,MinSat,P) % % This function analises the window tagged as WINDOW, where % a dark window is filled with 0, and a saturated window is % filled with 255. To consider a window as dark or saturated, it % should overcome a P percentage of pixels in the window. % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % Date: 09 of August of 2015. % Review: 15 of March of 2016. % % This method only implements the values when the function % is called satdark() % % Input: % WINDOW is the window under analysis. % MaxDark is the maximum gray-scale level that is considered as dark. % MinSat is the minimum gray-scale level that is considered as saturated. % P is the percentage of pixels in a window to declare dark or saturate. % % Output: % F is the dark or saturated window. % The dark windows are filled with 0, and the saturated windows are % filled with 255. To consider a window as dark or saturated, it % should overcome a P percentage of pixels in the window. % S is a matrix with the same size of F, this matrix has ones if F % is saturated and zero in other case. % D is an matrix with the same size of F, this matrix has ones if F % is dark and zero in other case. % WLines = size(WINDOW,1); WColumns = size(WINDOW,2); F = zeros(WLines,WColumns); num_pixels_sat = sum(sum( WINDOW>=MinSat )); num_pixels_dark = sum(sum( WINDOW<=MaxDark )); UMBRAL=WLines*WColumns*P/100; if ( (num_pixels_sat >= UMBRAL) && (num_pixels_dark <= UMBRAL) ) F(:,:) = 255; S=ones(WLines,WColumns); D=zeros(WLines,WColumns); elseif ( (num_pixels_sat <= UMBRAL) && (num_pixels_dark >= UMBRAL) ) F(:,:) = 0; S=zeros(WLines,WColumns); D=ones(WLines,WColumns); elseif ( (num_pixels_sat < UMBRAL) && (num_pixels_dark < UMBRAL) ) F=WINDOW; S=zeros(WLines,WColumns); D=zeros(WLines,WColumns); else for II=1:WLines for JJ=1:WColumns if( JJ<=(II*WColumns/WLines) ) F(II,JJ)=255; else F(II,JJ)=0; end end end S=ones(WLines,WColumns); D=ones(WLines,WColumns); end end bsltl-1.3.1/inst/mfiles/quality/homogeneity.m0000644000175000017500000001454313417616462017732 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [Y X] = homogeneity(DATA,WLines ,WColumns,Type) % % Homogeneity of spatial variability [1]. This function divides the % data pack (DATA) in spatial regions of WLines lines and WColumns % columns, in these regions are calculated activity indicators selected % with the variable Type, over these values are calculate the homogeneities. % Known an activity indicator value A(i,j) in the window (i,j), the homogeneity % value H(i,j) is calculated as % % $Z=\{A(i,j-1), A(i-1,j), A(i,j), A(i+1,j), A(i,j+1)\}$ % % $H(i,j) = \frac{StandardDeviation\{Z\}}{Mean\{Z\}}$ % % * Is used the populational case of standard deviation. % % References: % [1] Cardoso, R.R. ; Braga, R.A. ; Rabal, H.J. Alternative protocols on % dynamic speckle laser analysis. SPIE 8413, V International Conference % on Speckle Metrology. 2012 % % [2] BRAGA, R.A. et al. Evaluation of activity through dynamic laser speckle % using the absolute value of the differences, Optics Communications, v. 284, % n. 2, p. 646-650, 2011. % % [3] R. Nothdurft and G. Yao, 'Imaging obscured subsurface inhomogeneity using % laser speckle,' Opt. Express 13, 10034-10039 (2005). % % [4] ARIZAGA, R. et al. Speckle time evolution characterization by the % co-occurrence matrix analysis. Optics and Laser Technology, Amsterdam, % v. 31, n. 2, p. 163-169, 1999. % % [5] BRAGA R.A. CARDOSO, R.R. Enhancement of the robustness on dynamic speckle % laser numerical analysis. Optics and Lasers in Engineering, % 63(Complete):19-24, 2014. % % After starting the main routine just type the following command at the % prompt: % [Y X] = homogeneity(DATA,WLines,WColumns,Type); % % Input: % DATA is the speckle datapack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % WLines is the number of lines in the analysed window. % WColumns is the number of columns in the analysed window. % Type If Type is 1, it is used as activity indicator the AVD [2] technique. % If Type is 2, it is used as activity indicator the Temporal S. Std. Deviation [3]. % In other case it is used as activity indicator the inertia moment [4] technique. % In the cases of AVD and/or inertia moment indicators, it is used the Cardoso[5] normalization % over co-occurrence matrix. In all cases, the activity indicators % were calculated as a mean over all points of each window, not only over a line. % % Output: % Y is the homogeneity percentages in the analysed windows [1]. % The homogeneity value H(i,j) is represented as a window (matrix) % with WLines x WColumns pixels inside Y. % % X is the activity indicator value in the analysed windows. The activity % indicator value A(i,j) is represented as a window (matrix) with % WLines x WColumns pixels inside X. % % % For help, bug reports and feature suggestions, please visit: % http://www.nongnu.org/bsltl % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto Alves Braga Junior % % Date: 09 of August of 2015. % Review: 28 of March of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); if(rem(NLIN,WLines)~=0) TEXT1=['WLines must be multiple of: ',mat2str(factor(NLIN)),'.']; TEXT2=['The last ',num2str(rem(NLIN,WLines)),' pixel lines (botom) were not processed']; warning([TEXT1,TEXT2]); %msgbox(TEXT1,TEXT2); end if(rem(NCOL,WColumns)~=0) TEXT1=['WColumns must be multiple of: ',mat2str(factor(NCOL)),'.']; TEXT2=['The last ',num2str(rem(NCOL,WColumns)),' pixel columns (right) were not processed']; warning([TEXT1,TEXT2]); end if (Type==1) GMETHOD=graphavd(DATA,'off'); NAME='AVD'; elseif (Type==2) [TMP GMETHOD]=stdcont(DATA,'off'); NAME='Deviation'; else GMETHOD=graphim(DATA,'off'); NAME='Inertia Moment'; end X = zeros(NLIN,NCOL); Y = zeros(NLIN,NCOL); LINESSTEPS = 1 : WLines : NLIN-(WLines -1); COLUMNSSTEPS = 1 : WColumns : NCOL-(WColumns-1); LSTEPS=length(LINESSTEPS); CSTEPS=length(COLUMNSSTEPS); H = zeros(LSTEPS,CSTEPS); II=1; for lin = LINESSTEPS JJ=1; for col = COLUMNSSTEPS LINES = lin:lin+(WLines-1); COLUMNS = col:col+(WColumns-1); AVD = mean(mean(GMETHOD(LINES,COLUMNS))); X(LINES,COLUMNS) = AVD; H(II,JJ) = AVD; JJ=JJ+1; end II=II+1; end II=2; for lin = WLines+1: WLines : (LSTEPS-1)*WLines JJ=2; for col = WColumns+1: WColumns : (CSTEPS-1)*WColumns VEC=[H(II,JJ-1) H(II-1,JJ) H(II,JJ) H(II+1,JJ) H(II,JJ+1) ]; LINES = lin:lin+(WLines-1); COLUMNS = col:col+(WColumns-1); Y(LINES,COLUMNS) = std(VEC,1)/(mean(VEC)+eps); JJ=JJ+1; end II=II+1; end Y=100*(1.0-Y/max(max(Y))); figure(1); imagesc(X); colorbar; title(['Activity indicator: ',NAME]); daspect([1 1 1]); figure(2); imagesc(Y); colorbar; title('Homogeneity test in analysis windows'); daspect([1 1 1]); end bsltl-1.3.1/inst/mfiles/filter/0000755000175000017500000000000013417616462015013 5ustar olafolafbsltl-1.3.1/inst/mfiles/filter/datapack_conv.m0000644000175000017500000000551213417616462017771 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [DATAOUT] = datapack_conv(DATA,H) % % This function implements a convolution for each pixel of datapack. % % It convolves each pixel of signal with the function H of M elements, % so that if % H = [h0 h1 h2 ... h(M-1)] % then its Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % % Thus H represents an impulse response with sample zero in h(M2). % % After starting the main routine just type the following command at the % prompt: % DATAOUT = datapack_conv(DATA,H) % % Input: % DATA is a speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % H is a vector, where H represents a non-causal FIR filters centered in h(M2). % % % Output: % DATAOUT is obtained from the output of H FIR filter, in non-causal form, % where its input is each pixel of datapack. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 25 of February of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end M=length(H); M2=floor(M/2); %% Adding M/2 frames with zeros to datapack. %% This new datapack is called of D. D=zeros(NLIN,NCOL,M2+NTIMES+M2); D(:,:,(1+M2):(NTIMES+M2))=DATA(:,:,1:NTIMES); %% Non-causal filtering using H coefficients DATAOUT=filter(H,[1],D,[],3); DATAOUT=DATAOUT(:,:,M2+1+M2:M2+NTIMES+M2); end bsltl-1.3.1/inst/mfiles/filter/qmfmaker.m0000644000175000017500000000556713417616462017011 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [H]=qmfmaker(ORDER) % % This function returns a vector with the parameters of a FIR filter with cut-off % in pi/2 (for a 2*pi normalized frequency range). The function tries to fulfill % $D[Z] = H^2[Z]-H^2[-Z] = A Z^B$ for any A and B. % % After starting the main routine just type the following command at the % prompt: % H=qmfmaker(ORDER); % % Input: % ORDER is the order of H=[h0 h1 ... h(ORDER)] FIR filter that try fulfill % $D[Z] = H^2[Z]-H^2[-Z] = A Z^B$ for any A and B. % The number of elements of FIR filter must be even % and consequently the ORDER should be odd. % Output: % H is a vector with the parameters of a FIR filter. H is a low pass % filter with cut-off in pi/2 (for a 2*pi normalized frequency range). % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera s % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 27 of February of 2016. % if rem(ORDER+1,2)~=0 error(['The number of elements of FIR filter must be even and consequently the ORDER should be odd.']); end L=16; A=0.5; B=0.6; [A B]=findminstd(A,B,L,ORDER); [A B]=findminstd(A,B,L,ORDER); [A B]=findminstd(A,B,L,ORDER); CUTOFF=(A+B)/2; H=get_fir_filter(ORDER,CUTOFF); end % Find the cut-off interval [CUTOFF_A0 CUTOFF_B0] % smaller than the standard deviation value of D=|H^2(Z)-H^2(-Z)| with Z=exp(i w), % between the cut-off interval [CUTOFF_A CUTOFF_B]. function [CUTOFF_A0 CUTOFF_B0]=findminstd(CUTOFF_A,CUTOFF_B,L,ORDER) CUTOFF=linspace(CUTOFF_A,CUTOFF_B,L); sigma=zeros(1,L); for II=1:L H=get_fir_filter(ORDER,CUTOFF(II)); [H1 D]=qmfmirror(H,ORDER*2); sigma(II)=std(D); end [m, id] = min(sigma); if((id-1)>=1) CUTOFF_A0=CUTOFF(id-1); else CUTOFF_A0=CUTOFF(1); end if((id+1)<=L) CUTOFF_B0=CUTOFF(id+1); else CUTOFF_B0=CUTOFF(L); end end bsltl-1.3.1/inst/mfiles/filter/firfilterbank.m0000644000175000017500000001515013417616462020015 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [DATA0 DATA1] = firfilterbank(DATA,FILTER,MODE) % % This function implements a filter bank for each pixel of a datapack. % % This function uses two FIR filters (H0 and H1) of order (M-1) in non-causal % form, so that if % H = [h0 h1 h2 ... h(M-1)] % then its Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % % The function implements some modes % % MODE0: This mode uses two FIR filters (H0 and H1), thus it can accept {H0} or % {H0 , H1} as input parameter. If only the H0 filter is delivered as % input parameter, then the H1 filter is calculated as % the complement filter of H0. $H1[Z]= 1-H0[Z]$. % % MODE2: This mode uses two FIR filters (H0 and H1), and it only can accept {H0} % as input parameter; H1 filter is calculated as the quadrature mirror % filter of H0. $H1[Z]= H0[-Z]$. At end the, there will be a % down-sampler by 2. % This mode is commonly used with H0 as low pass FIR filter with cut-off % in pi/2 (for a 2*pi normalized frequency range). In order to have a perfect reconstruction % it is necessary that $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B. % % % After starting the main routine just type the following command at the % prompt: % [DATA0 DATA1] = firfilterbank(DATA,FILTER,MODE); % [DATA0 DATA1] = firfilterbank(DATA,H0,'MODE2'); % [DATA0 DATA1] = firfilterbank(DATA,H0,'MODE0'); % [DATA0 DATA1] = firfilterbank(DATA,[H0;H1],'MODE0'); % % Input: % DATA is a speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % FILTER is a matrix (with 2 lines) or a vector, where FILTER=H0 or FILTER=[H0;H1]. % H0 and H1 represent two FIR filters. % FILTER=H0 is used in the mode 'MODE2', by other side FILTER=H0 or FILTER=[H0;H1] % can be used in the mode 'MODE0'. % MODE is the type of analysis selected of a filter bank. It can be 'MODE0' or % 'MODE2'. % % Output: % DATA0 is obtained from the output of H0 FIR filter, in non-causal form, % with input each pixel of datapack. If the mode used have a % down-sampler after filtering, then DATA0 is the output of down-sampler. % DATA1 is obtained after the output of H1 FIR filter, in non-causal form, % with input each pixel of datapack. If the mode used have a % down-sampler after filtering, then DATA1 is the output of down-sampler. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 25 of February of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end MODE=upper(MODE); %% Processing the second parameter to get H0 and H1 [H0 H1]=processing_filter(FILTER,MODE); %% Non-causal filtering using H0 coefficients DATA0=datapack_conv(DATA,H0); %% Non-causal filtering using H1 coefficients DATA1=datapack_conv(DATA,H1); if ( strcmp(MODE,'MODE2')==1 ) DATA0=datapack_downsampling(DATA0,2); DATA1=datapack_downsampling(DATA1,2); elseif ( strcmp(MODE,'MODE0')==1 ) % else warning('The used mode no exist. Switching to: MODE0'); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% D is down sampling version of DATA. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function D=datapack_downsampling(DATA,N) NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end n=ceil(NTIMES/N); steps=[0:n-1]*N+1; D= DATA(:,:,steps); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Processing the second parameter. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [H0 H1]=processing_filter(FILTER,MODE) if isvector(FILTER) H0=FILTER; % Creating, H1, the quadrature mirror filter of H0. if strcmp(MODE,'MODE2') if rem(length(FILTER),2)~=0 error(['Creating, H1, the quadrature mirror filter: Number of elements ', ... 'of FIR filter must be even for creating quadrature filter.']); end %% H1 Quadrature filter of H0 H1=qmfmirror(H0); %elseif ( strcmp(MODE,'MODE0' ) ) %%<--default else % H1[Z]= 1-H0[Z]. M=length(H0); M2=floor(M/2); H1=-H0; H1(M2+1)=1-H0(M2+1); end elseif ismatrix(FILTER) if size(FILTER,1)==2 if strcmp(MODE,'MODE2') error([ 'The MODE2 only accept a H0 filter vector (1xN_even).']); end H0=FILTER(1,:); H1=FILTER(2,:); M=length(H0); else error('The second parameter should be a vector (1xN) or a matrix (2xN) with the parameters of FIR filters.'); end end end bsltl-1.3.1/inst/mfiles/filter/firsynthesisbank.m0000644000175000017500000001342013417616462020557 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function DATA=firsynthesisbank(DATA0,DATA1,H0) % % This function makes a step to synthesis filter bank for each pixel % of datapacks DATA0 and DATA1. It uses up-samplers in your inputs and % after FIR filters (G0 and G1) of order (M-1) in non-causal form. If % H0 = [h0 h1 h2 ... h(M-1)] % then your Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % % The function accepts the filter H0 as input parameter, so that the filters % G0 and G1 are calculated as $G0[Z]=H0[Z]$ and $G1[Z]= -H0[-Z]$. % H0 should be a low pass FIR filter with cut-off in pi/2 % (for a 2*pi normalized frequency range) and, DATA0 and DATA1 the outputs of % an step of a filter bank, as in the function firfilterbank() in MODE='MODE2'. % In order to get a perfect reconstruction it is necessary that % $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B. % % % After starting the main routine just type the following command at the % prompt: % DATA=firsynthesisbank(DATA0,DATA1,H0); % % Input: % DATA0 is a speckle data pack. Where DATA0 is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA0), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % DATA0 is obtained after the down-sampler of output of H0 FIR filter in % a step of a filter bank with low-pass filter H0. % DATA0 and DATA1 should have the same size. % DATA1 is a speckle data pack. Where DATA1 is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA1), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % DATA1 is obtained after the down-sampler of output of H1 FIR filter in % a step of a filter bank with low-pass filter H0. % DATA1 and DATA0 should have the same size. % H0 is a vector with the parameters of a FIR filter. H0 should be a low % pass filter with cut-off in pi/2 (for a 2*pi normalized frequency range). % In order to ger a perfect reconstruction it is necessary that % $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B. % % Output: % DATA is a synthesis of speckle datapacks DATA0 and DATA1. The number of images % inside DATA is twice of the number of images of DATA0 and DATA1. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 27 of February of 2016. % if ~isequal(size(DATA0),size(DATA1)) error('The datapacks should have the same sizes.'); end NSIZE = size(DATA0); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end [G0 G1]=processing_filter(H0); %% upsampling datapack. DATA0_UP=datapack_upsampling(DATA0,2); %% upsampling datapack. DATA1_UP=datapack_upsampling(DATA1,2); %% Non-causal filtering using G0 coefficients DATA0_UP = datapack_conv(DATA0_UP,2*G0); %% Non-causal filtering using G1 coefficients DATA1_UP = datapack_conv(DATA1_UP,2*G1); DATA=DATA0_UP+DATA1_UP; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Processing the third parameter. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [G0 G1]=processing_filter(H0) if rem(length(H0),2)~=0 error(['Creating, [G0 G1], the synthesis quadrature mirror filter: ', ... 'Number of elements of FIR filter must be even.']); end % Creating, G0= H0( Z), G0=H0; % Creating, G1=-H0(-Z), G1=-qmfmirror(H0); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% D is up sampling version of DATA. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function D=datapack_upsampling(DATA,N) NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end D=zeros(NLIN,NCOL,N*NTIMES); steps=[0:(NTIMES-1)]*N+2; D(:,:,steps)= DATA; end bsltl-1.3.1/inst/mfiles/filter/freqmod.m0000644000175000017500000000451313417616462016631 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [AH varargout]=freqmod(H,N) % This function returns the modulus of frequency response of function H. % Frequently H will be a FIR filter. % % If H = [h0 h1 h2 ... h(M-1)] then your Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % and the function return $AH=|H[Z=e^{jW}]|$ for W from 0 to pi. % % % After starting the main routine just type the following command at the % prompt: % AH=freqmod(H,N) % [AH FREQN]=freqmod(H,N); % % Input: % H is a vector with the parameters of H function. % N is the number of analysis points in the frequency response. % Output: % AH is the modulus of frequency response of function H. % $AH=|H[Z=e^{jW}]|$ for W from 0 to pi. % FREQN [OPTIONAL] is the normalized frequency of points in AH, thus for the % point AH(id) we have W=FREQN(id)*pi. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 27 of February of 2016. % M =length(H); TETA=[0:(N-1)]*pi/(N-1); AH=0; for II=1:M AH=AH+H(II)*exp(i*TETA*(II-1)); end AH=abs(AH); if nargout>1 %FREQN=[0:(N-1)]/(N-1); varargout{1}=[0:(N-1)]/(N-1); end end bsltl-1.3.1/inst/mfiles/filter/firsynthesispath.m0000644000175000017500000001345513417616462020610 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function DATAOUT=firsynthesispath(DATA,H0,SEQ) % % This function makes a synthesis of a path in a filter bank, for each pixel % of datapack DATA. % % It uses in cascade of reconstruction blocks Bi with i=1 to i=L=length(SEQ). % Each reconstruction block Bi is formed by: % 1) up-sampler by 2 % 2) gain of 2 % 3) Gj FIR FILTER, so that j=SEQ(L+1-i) % % The function accepts the filter H0 as input parameter, so that the filters % G0 and G1 are calculated as $G0[Z]=H0[Z]$ and $G1[Z]= -H0[-Z]$. % If % H0 = [h0 h1 h2 ... h(M-1)] % then your Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % % H0 should be a low pass FIR filter with cut-off in pi/2 % (for a 2*pi normalized frequency range). % In order to get a perfect reconstruction it is necessary that % $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^C$ for any A and C. % % % After starting the main routine just type the following command at the % prompt: % DATAOUT=firsynthesispath(DATA,H0,SEQ); % % Input: % DATA is a speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA0), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % DATA is obtained after the down-sampler of output of H0 FIR filter in % a step of a filter bank with low-pass filter H0. % H0 is a vector with the parameters of a FIR filter. H0 should be a low % pass filter with cut-off in pi/2 (for a 2*pi normalized frequency range). % In order to get a perfect reconstruction is necessary that % $D[Z]=H0^2[Z]-H0^2[-Z]=A Z^B$ for any A and B. % SEQ is a vector with binary values. These values indicates the path % in the decomposition scheme used to get the datapack DATA. % % Output: % DATAOUT is a synthesis of the speckle datapack DATA. The number of images % inside DATAOUT is 2^{L=length(SEQ)} times of the number of images of DATA. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 27 of February of 2016. % NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end [G0 G1]=processing_filter(H0); L=length(SEQ); for II=L:-1:1 if(SEQ(II)==0) DATA=reconstruction(DATA,G0); else DATA=reconstruction(DATA,G1); end end DATAOUT=DATA; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% DATA -> UP2 -> 2-> G -> DATA_UP %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function DATA_UP=reconstruction(DATA,G) NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); M=length(G); M2=floor(M/2); %% Upsampling datapack. DATA_UP=datapack_upsampling(DATA,2); %% Non-causal filtering using G coefficients DATA_UP = datapack_conv(DATA_UP,2*G); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Processing the third parameter. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [G0 G1]=processing_filter(H0) if rem(length(H0),2)~=0 error(['Creating, [G0 G1], the synthesis quadrature mirror filter: ', ... 'Number of elements of FIR filter must be even.']); end % Creating, G0= H0( Z), G0=H0; % Creating, G1=-H0(-Z), G1=-qmfmirror(H0); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% D is up sampling version of DATA. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function D=datapack_upsampling(DATA,N) NSIZE = size(DATA); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); if length(NSIZE)~=3 error('The datapack should have 3 dimensions.'); end if (NTIMES<2) error('Number of frames used are not enough.'); end D=zeros(NLIN,NCOL,N*NTIMES); steps=[0:(NTIMES-1)]*N+2; D(:,:,steps)= DATA; end bsltl-1.3.1/inst/mfiles/filter/qmfmirror.m0000644000175000017500000000527013417616462017213 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [H1 varargout]=qmfmirror(H0,varargin) % This function returns the vector H1, the quadrature mirror filter % of H0. If H0 = [h0 h1 h2 ... h(M-1)] then your Z transform is: % M2=floor(M/2); % $H[Z] = h0 Z^{+M2} + h1 Z^{+M2-1} + ... h(M-1) Z^{+M2-(M-1)}$ % and % $H1[Z]=H0[-Z]$ % % Additionally, the function returns $|D[Z=e^{i*W}]|$, where $D[Z] = H0^2[Z]-H0^2[-Z]$ % for W from 0 to pi. % % % After starting the main routine just type the following command at the % prompt: % H1=qmfmirror(H0); % [H1 AD]=qmfmirror(H0); % [H1 AD]=qmfmirror(H0,N); % [H1 AD FREQN]=qmfmirror(H0); % [H1 AD FREQN]=qmfmirror(H0,N); % % Input: % H0 is a vector with the parameters of a FIR filter. % N [Optional] is the number of analyzed points in AD. % Output: % H1 is the quadrature mirror filter of H0. H0[Z]=H1[-Z] % AD [Optional] is a modulus of $D[Z=e^{i*W}]$, where $D[Z] = H0^2[Z]-H0^2[-Z]$. % The number of analyzed points in AD is equal to N. % FREQN [Optional] is the normalized frequency of points in AD, thus for the % point AD(id) we have W=FREQN(id)*pi. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 01 of December of 2015. % Review: 27 of February of 2016. % M =length(H0); H1=zeros(1,M); M2=floor(M/2); for II=1:M H1(II)=((-1)^(+M2+1-II) )*H0(II); end if nargout>1 D=(conv(H0,H0)-conv(H1,H1)); if nargin>1 N=varargin{1}; else N=65; end [varargout{1} FREQN]=freqmod(D,N); if nargout>2 varargout{2}=FREQN; end end end bsltl-1.3.1/inst/mfiles/extras/0000755000175000017500000000000013417616462015034 5ustar olafolafbsltl-1.3.1/inst/mfiles/extras/hbpmf.m0000644000175000017500000000374513417616462016317 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function H=hbpmf(Pr) % % The function returns the binary entropy of a probability mass function. % % $H=-\sum\limits_i Pr(i)*log_2(Pr(i))$ % $H=-\sum\limits_{ij} Pr(i,j)*log_2(Pr(i,j))$ % % After starting the main routine just type the following command at the % prompt: % H=hbpmf(Pr); % % Input: % Pr is a probability mass function. The sum of all values Pr(a) could be 1.0. % Pr can be a vector or matrix. % % Output: % H The binary entropy of a probability mass function. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 08 of July of 2015. % Review: 25 of February of 2016. % if(length(size(Pr))~=2) error('Pr only can be a 1D vector or 2D marix.'); end if(abs(sum(sum(Pr))-1.0)>128*eps) error('Sum Probability is not 1.0'); end N=size(Pr); H=0; for II=1:N(1,1) for JJ=1:N(1,2) if(Pr(II,JJ)>0) H=H-Pr(II,JJ)*log2(Pr(II,JJ)); end end end end bsltl-1.3.1/inst/mfiles/extras/threshold2d.m0000644000175000017500000000450413417616462017437 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [X1 varargout]=threshold2d(X,U) % % It is a function that returns a matrix X with elements smaller than U. % For this purpose all elements superior to U are truncated to U. % % After starting the main routine just type the following command at the % prompt: % X1=threshold2d(X,U); % [X1 X2]=threshold2d(X,U); % % Input: % X is a 2D matrix that needs be truncated. % U is the threshold of matrix X. He makes all values higher than U are set to U. % U can be the matrix X or a scalar value. % % Output: % X1 is the truncated matrix to threshold U. % X2 [Optional] is the complement of the truncated matrix to threshold U. % X2 + X1 = X % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 08 of July of 2015. % Review: 25 of February of 2016. % if (length(size(X))~=2) error('threshold2d() only work with 2D matrices.'); end if (max(size(U))~=1) if (size(U)~=size(X)) error('The second parameter only can be a scalar value or a matrix with the same size as the first parameter.'); end end X_MENOR =(X<=U); X_MAYOR =1-X_MENOR; %values smaller than U X1=X.*X_MENOR + X_MAYOR.*U; if(nargout>=2) %complement with values higher than U. varargout{1}=X-X1; end end bsltl-1.3.1/inst/mfiles/extras/mwindowing.m0000644000175000017500000000623013417616462017375 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function MATW = mwindowing(MAT,WLines,WColumns) % % This function divides the MAT matrix in windows of WLines lines and WColumns % columns, then in each one of these windows it is calculated the mean value of all % elements. % % With theirs information is created a new matrix MATW with the same % size and windows of MAT, and the mean values in the MAT matrix are replaced % in all elements, for each window, in the MATW matrix. % % After starting the main routine just type the following command at the % prompt: % MATW = mwindowing(MAT,WLines,WColumns); % Mean values, of the elements in the window of 8x10 pixels, in the MAT matrix. % MATW = mwindowing(MAT,8,10); % % Input: % MAT is a matrix with NLIN lines and NCOL columns. % WLines is the number of lines in each analysis window. % WColumns is the number of columns in each analysis window. % % Output: % MATW is a matrix with the mean values, of the elements in % the window of WLinesxWColumns pixels, in the MAT matrix. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of August of 2015. % Review: 25 of February of 2016. % NSIZE = size(MAT); NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); if(rem(NLIN,WLines)~=0) TEXT1=['WLines must be multiple of: ',mat2str(factor(NLIN)),'.']; TEXT2=['The last ',num2str(rem(NLIN,WLines)),' pixel lines (botom) were not processed']; warning([TEXT1,TEXT2]); end if(rem(NCOL,WColumns)~=0) TEXT1=['WColumns must be multiple of: ',mat2str(factor(NCOL)),'.']; TEXT2=['The last ',num2str(rem(NCOL,WColumns)),' pixel columns (right) were not processed']; warning([TEXT1,TEXT2]); end MATW = zeros(NLIN,NCOL); LINESSTEPS = 1 : WLines : NLIN-(WLines -1); COLUMNSSTEPS = 1 : WColumns : NCOL-(WColumns-1); for lin = LINESSTEPS for col = COLUMNSSTEPS LINES = lin:lin+(WLines-1); COLUMNS = col:col+(WColumns-1); MEANVAL = mean(mean(MAT(LINES,COLUMNS))); MATW(LINES,COLUMNS) = MEANVAL; end end end bsltl-1.3.1/inst/mfiles/Contents.m0000644000175000017500000001024713417616462015505 0ustar olafolaf% Bio Speckle Laser Tool Library % % Version: 1.0.0 % % Code developers: Roberto Alves Braga Junior % Fernando Pujaico Rivera % Junio Moreira % % data/ * Functions for to work with data packages. % % datacut.m - Cuts an image portion of a data package. % datapack.m - Creates a data package from a image set. % datapack_to_gif.m - Creates a gif file from a image set. % % extras/ * Free functions without category. % % hbpmf.m - Returns the entropy of a probability mass function. % stscorr.m - Implements a correlation between images. % threshold2d.m - Implements a threshold over a 2D matrix. % % filter/ * Functions to the frequency processing. % % datapack_conv.m - No-Causal convolution. % firfilterbank.m - FIR Filter Bank. % firsynthesisbank.m- FIR Synthesis Bank. % firsynthesispath.m- FIR Synthesis Path. % freqmod.m - Frequency Module. % qmfmaker.m - Quadrature Mirror Filter maker. % qmfmirror.m - Mirror of Quadrature Mirror Filter. % % graphic/ * Graphic functions of activity indicators. % % moments/ * Graphical functions relative to inertia moment. % % graphavd.m - Implements the graphic AVD technique. % graphim.m - Implements the graphic inertia moment technique. % graphptd.m - Implements the graphic PTD technique. % graphrvd.m - Implements the graphic RVD technique. % % others/ * Free graphical functions without category. % % graphmhi.m - Implements the MHI technique. % % stats/ * Graphical functions relative to statistical moments % % graphkurt.m - Implements the graphic kurtosis technique. % graphskew.m - Implements the graphic skewness technique. % % fujii.m - Implements the Fujii technique. % gendiff.m - Implements the generalized differences technique. % stdcont.m - Implements the contrast, std and mean technique. % % numerical/ * Numerical functions of activity indicators. % % extras/ * Extra functions % % stscorr.m - Correlation. % thsp2corr.m - THSP to Correlation. % % pmf/ * Probability mass function. % % pmfad.m - Returns the probability mass function of AVD. % pmfrd.m - Returns the probability mass function of RVD. % % thsp/ * Time history speckle pattern. % % thsp.m - Returns the time history speckle pattern (THSP). % thsp_gaussian.m - Returns the THSP of a set of Gaussian points. % thsp_line.m - Returns the THSP of a line of points. % thsp_random.m - Returns the THSP of a set of random points. % % avd.m - Implements the absolute value of differences. % coom.m - Implements the co-occurrence. % inertiamoment.m - Implements the inertia moment. % numad.m - Implements the numerical average difference. % rvd.m - Implements the regular value of differences. % % quality/ * Functions for the quality test. % % homogeneity.m - Implements a study of homogeneity. % satdark.m - Implements a study of saturated and dark sections. % sscont.m - Implements a study of spatial speckle contrast. % % undocumented/ * Functions without description in the reference and user manual. % % datapack_to_bmp.m - Saves the images inside of datapack in a set of BMP files % get_fir_filter.m - Get a finite impulse response filter. Similar to fir function. % mwnumbering.m - Graphics with colors and values the content of the input matrix. Uses internally mwindowing.m. % select_points.m - Select graphically a set of points. % thsp_points.m - Made a THSP from a set of points. % imagesc_with_points.m - Graphic using imagesc a set of points. % bsltl-1.3.1/inst/mfiles/data/0000755000175000017500000000000013417616462014437 5ustar olafolafbsltl-1.3.1/inst/mfiles/data/datacut.m0000644000175000017500000000607613417616462016253 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [DATACUT varargout]=datacut(DATA) % % DATACUT is a function in graphic mode that selects and cuts a portion of % data pack (DATA). % % After starting the main routine just type the following command at the % prompt: % DATACUT=datacut(DATA); % [DATACUT LINES COLUMNS]=datacut(DATA); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represent NLIN and % N(1,2) represent NCOL and % N(1,3) represent NTIMES. % % Output: % DATACUT Is the cut part of speckle data pack. Where DATACUT is a 3D matrix % created grouping NTIMES cut parts of DATA. % LINES [Optional] Is a vector with two elements, these are the first line % and the last line in the cut of DATA. % COLUMNS [Optional] Is a vector with two elements, these are the first column % and the last column in the cut of DATA. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A. Braga Jr % Date: 08 of July of 2015. % Review: 25 of February of 2016. % NSIZE = size(DATA); if (length(NSIZE)~=3) error('This function need a 3D matrix.'); end NLIN = NSIZE(1,1); NCOL = NSIZE(1,2); NTIMES= NSIZE(1,3); SIGMA = zeros(NLIN,NCOL); ED = zeros(NLIN,NCOL); for k = 1:NTIMES ED = ED+ DATA(:,:,k); end ED=ED/NTIMES; for k = 1:NTIMES SIGMA = SIGMA + (DATA(:,:,k)-ED).^2; end SIGMA = sqrt(SIGMA/(NTIMES-1)); ALERTA='<< CHOOSE A REGION CLICKING WITH MOUSE IN TWO POINTS >>'; warndlg(ALERTA); figure; imagesc(SIGMA); title(ALERTA); [COL,LIN]=ginput(2); COL=round(sort(COL)); LIN=round(sort(LIN)); rectangle('Position',[COL(1), LIN(1), COL(2)-COL(1), LIN(2)-LIN(1)], 'LineWidth',3, 'EdgeColor','b'); DATACUT=DATA(LIN(1):LIN(2),COL(1):COL(2),:); if(nargout>=2) varargout{1}=COL; end if(nargout>=3) varargout{2}=LIN; end end bsltl-1.3.1/inst/mfiles/data/datapack.m0000644000175000017500000001700213417616462016365 0ustar olafolaf% Copyright (C) 2015, 2016 Roberto Alves Braga Junior % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function [DATA] = datapack(IMGDIR,IMGNAME,IMGN1,IMGN2,IMGFMT,varargin) % This function creates a data pack (3D matrix) from a set of images in a directory. % All images should have the same number of lines and columns, and similar format. % % After starting the main routine just type the following command at the % prompt: % DATA = datapack(IMGDIR,IMGNAME,IMGN1,IMGN2,IMGFMT); % % %% To filenames: 'seed1.bmp', 'seed2,bmp', ..., 'seed128.bmp' % DATA = datapack('/user/images/sample1','seed',1,128,'bmp'); % % %% To filenames: 'img1coffee.bmp', 'img2coffee,bmp', ..., 'img100coffee.bmp' % DATA = datapack('/user/images/sample1','img%dcoffee',1,100,'bmp'); % % %% To filenames: 'img0001.bmp', 'img0002,bmp', ..., 'img0123.bmp' % DATA = datapack('/user/images/sample1','img%04d',1,123,'bmp'); % % Input: % IMGDIR is a directory path where the images are, with format names as % NAME=[IMGNAME,'.',IMGFMT]. % IMGNAME is the format filename, example: if the files in IMGDIR have names as % 'fig1.bmp', then IMGNAME='fig' or IMGNAME='fig%d'. If IMGNAME not % contain a format specifiers of family %d, them this format specifiers % is added at the final of IMGNAME string. The format string is similar % to the function printf of others programming languages. % Only are permitted format specifiers of family %d, given that will % be replaced a decimal number. % IMGN1 is the index of the first image, example: if the files have names from % 'fig1.bmp' until 'fig4.bmp', then IMGN1=1. % IMGN2 is the index of the last image, example: if the files have names from % 'fig1.bmp' until 'fig4.bmp', then IMGN2=4. % IMGFMT is the filetype of the image files, example: if the files have names % as 'fig1.bmp', then IMGFMT='bmp'. Current is only permitted IMGFMT='bmp'. % LPOS [Optional] This value is optional. It is the first line position for a window % analysis. % CPOS [Optional] This value is optional. It is the first column position for a window % analysis. % NLIN [Optional] This value is optional. It is the number of lines of a window under analysis. % NCOL [Optional] This value is optional. It is the number of columns of a window under analysis. % % Output: % DATA is the speckle data. Where DATA is a 3D matrix created grouping NTIMES=IMGN2-IMGN1+1 % matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Roberto Alves Braga Junior % Code adapted by: Junio Moreira % Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of May of 2013. % Review: 13 of March of 2016. % % Verify the presence of 9 parameters if((nargin==6)||(nargin==7)||(nargin==8)) error('For window mode it is necessary 9 parameters: datapack(IMGDIR,IMGNAME,IMGN1,IMGN2,IMGFMT,LPOS,CPOS,NLIN,NCOL);'); end %Verify if the obligatory parameters are correct if(~(ischar(IMGDIR)&&ischar(IMGNAME)&&isnumeric(IMGN1)&&isnumeric(IMGN2)&&ischar(IMGFMT))) if(~ischar(IMGDIR)) disp('First parameter is not a string.'); end if(~ischar(IMGNAME)) disp('Second parameter is not a string.'); end if(~isnumeric(IMGN1)) disp('Third parameter is not a integer.'); end if(~isnumeric(IMGN2)) disp('4th parameter is not a integer.'); end if(~ischar(IMGFMT)) disp('5th parameter is not a string.'); end error('Error in the parameters format of datapack function.'); end if(strcmp(IMGFMT,'bmp')==0) error('5th parameter should be equal to string: bmp'); end IMGN1=round(IMGN1); IMGN2=round(IMGN2); IMGDIR=replace_tild_home(IMGDIR); %Verify the existence of the directory if(exist(IMGDIR)~=7) error(['No exist directory: ', IMGDIR]); end if(length(strfind(IMGNAME,'%'))==0) IMGNAME=[IMGNAME,'%d']; end PRENAME=[IMGNAME,'.',IMGFMT]; FIRSTFILE=fullfile(IMGDIR,sprintf(PRENAME,IMGN1)); %Verify if at least the first file exists if(exist(FIRSTFILE)~=2) error(['No exist the file: ',FIRSTFILE]); end IMGTEMP = imread (FIRSTFILE); SizeIMG = size(IMGTEMP); if(size(IMGTEMP,3)~=1) error('The image should be a grayscale image!!!.'); end Nlines = SizeIMG(1,1); Ncolumns = SizeIMG(1,2); if(nargin>=9) % Verify if the optional input is integer if(~(isnumeric(varargin{1})&&isnumeric(varargin{2})&&isnumeric(varargin{3})&&isnumeric(varargin{4}))) error('The optional arguments should be integers'); end LPOS=varargin{1}; CPOS=varargin{2}; NLIN=varargin{3}; NCOL=varargin{4}; if((LPOS+NLIN-1)>Nlines) error('Selected line in window out of range.'); end if((CPOS+NCOL-1)>Ncolumns) error('Selected column in window out of range.'); end WINDOW=1; else WINDOW=0; end numImages=IMGN2-IMGN1+1; % Begin disp(['Loading images from:',IMGDIR]); disp('Please wait...'); if WINDOW == 0 DATA = zeros(Nlines,Ncolumns,numImages); for II = 1:numImages nome = fullfile(IMGDIR,sprintf(PRENAME,IMGN1+II-1)); DATA(:,:,II) = imread(nome); end else DATA = zeros(NLIN,NCOL,numImages); for II = 1:numImages nome = fullfile(IMGDIR,sprintf(PRENAME,IMGN1+II-1)); TODO= imread(nome); DATA(:,:,II) = TODO(LPOS:(NLIN+LPOS-1),CPOS:(NCOL+CPOS-1)); end end disp('DATA Pack loaded...[OK]'); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function newpath=replace_tild_home(oldpath) %% Replaces the initial text '~/' in the variable oldpath, by the home path in %% gnu-linux or win, the function returns the result in the newpath variable. newpath=oldpath; if(length(oldpath)>=2) if(strcmp(oldpath(1:2),'~/')) if ( length(getenv('HOME'))>0 ) if(length(oldpath)>2) newpath=fullfile(getenv('HOME'),oldpath(3:end)); else newpath=fullfile(getenv('HOME')); end elseif( length(getenv('HOMEPATH'))>0 ) if(length(oldpath)>2) newpath=fullfile(getenv('HOMEDRIVE'),getenv('HOMEPATH'),oldpath(3:end)); else newpath=fullfile(getenv('HOMEDRIVE'),getenv('HOMEPATH')); end else newpath=oldpath; end end end end bsltl-1.3.1/inst/mfiles/data/datapack_to_gif.m0000644000175000017500000000622013417616462017714 0ustar olafolaf% Copyright (C) 2015, 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . function h=datapack_to_gif(DATA,Filename,Frames,varargin) % % This function creates a gif file from the data pack (DATA). % % After starting the main routine just type the following command at the % prompt: % datapack_to_gif(DATA,Filename,Frames); % datapack_to_gif(DATA,Filename,Frames,Map); % datapack_to_gif(DATA,Filename,Frames,Map,Time); % % Input: % DATA is the speckle data pack. Where DATA is a 3D matrix created grouping NTIMES % intensity matrices with NLIN lines and NCOL columns. When N=size(DATA), then % N(1,1) represents NLIN and % N(1,2) represents NCOL and % N(1,3) represents NTIMES. % Filename is the name of gif file. % Frames is the number of frames in the gif file. In the number of images (NTIMES) % is less than the number of frames (Frames), then overwrite Frames=NTIMES; % Map [Optional] is the colormap, this value can be: jet, gray, hsv, ..., etc. % By default: jet. See: colormap('list') % Time [Optional] is the time between frames in the gif file. By default: 0.5 sec. % % Output: % h is the name of gif file. % % % For help, bug reports and feature suggestions, please visit: % http://nongnu.org/bsltl/ % % Code developed by: Fernando Pujaico Rivera % Code documented by: Fernando Pujaico Rivera % Code reviewed by: Roberto A Braga Jr % % Date: 09 of July of 2015. % Review: 25 of February of 2016. % NTIMES = size(DATA,3); Step = round(NTIMES/Frames); if(Step == 0) Step=1; end Max=max(max(max(DATA))); D=(DATA*64/Max); if (nargin<4) map = jet; else if( (length(size(varargin{1}))==2)&&(size(varargin{1},1)>1)&&(size(varargin{1},2)>1) ) %if(ismatrix(varargin{1})) map=varargin{1}; else map=jet; end end Time=0.5; if(nargin>4) if(isscalar(varargin{2})) Time=varargin{2}; end end %Write the first frame to a file named animGif.gif imwrite( D(:,:,1),map,Filename,'gif','LoopCount',... inf,'DelayTime',Time); NFRAMES=1; %Loop through and write the rest of the frames for ii=2:Step:NTIMES imwrite(D(:,:,ii),map,Filename,'gif','writemode',... 'append','DelayTime',Time); NFRAMES=NFRAMES+1; if(NFRAMES == Frames) break; end h=Filename; end bsltl-1.3.1/inst/__bsltl_package_register__.m0000644000175000017500000000352313417616462017723 0ustar olafolaf% Copyright (C) 2016 Carnë Draug % Copyright (C) 2016 Fernando Pujaico Rivera % % This file is a part of the Bio Speckle Laser Tool Library (BSLTL) package. % % This BSLTL computer package is free software; you can redistribute it % and/or modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 3 of the % License, or (at your option) any later version. % % This BSLTL computer package is distributed hoping that it could be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, please download it from % . % Undocumented internal function % Adapted-by: Fernando Pujaico Rivera % original-work: __geometry_package_register__.m Carnë Draug %% PKG_ADD: __bsltl_package_register__ (1); %% PKG_DEL: __bsltl_package_register__ (-1); function subdir_paths = __bsltl_package_register__ (loading = 0) %% loading = 0 : Returns the installation paths of BSLTL pakage. %% loading > 0 : Add the BSLTL installation paths and %% returns the installation paths of BSLTL pakage. %% loading < 0 : Remove the BSLTL installation paths and %% returns the the remove paths of BSLTL pakage. %% Get full path, with luck we can retreive the package name from here base_pkg_path = fileparts (make_absolute_filename (mfilename ('fullpath'))); subdir_paths = genpath(fullfile (base_pkg_path, 'mfiles')); if (loading > 0) addpath (subdir_paths); elseif (loading < 0) rmpath (subdir_paths); endif end bsltl-1.3.1/DESCRIPTION0000644000175000017500000000123013417616462012774 0ustar olafolafName: bsltl Version: 1.3.1 Date: 2019-01-14 Author: Roberto Alves Braga Junior , Fernando Pujaico Rivera , Junio Moreira Maintainer: Fernando Pujaico Rivera Title: Biospeckle Laser Tool Library. Description: The BSLTL package is a free collection of OCTAVE/MATLAB routines for working with the biospeckle laser technique. Categories: Biospeckle Laser, Dynamic Laser Speckle, Processing Images #Problems: Nothing that I know Url: http://www.nongnu.org/bsltl/ Depends: octave (>= 4.0.0) License: GPLv3+ #SystemRequirements: #BuildRequires: bsltl-1.3.1/COPYING0000644000175000017500000010451313417616462012331 0ustar olafolaf GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . bsltl-1.3.1/NEWS0000644000175000017500000001021113532773704011765 0ustar olafolaf=============================================================================== bsltl-1.3.1 Release Date: 2019-01-16 Release Manager: Fernando Pujaico R. =============================================================================== ** Improving documentation. =============================================================================== bsltl-1.3.0 Release Date: 2019-01-14 Release Manager: Fernando Pujaico R. =============================================================================== ** get_lux_level.m added. ** select_points.m: Improve DARA input, now can be only an image. ** thsp_gaussian.m: Adding gray color in the scatter plot. ** imagesc_with_points.m: Improve documentacion. =============================================================================== bsltl-1.2.0 Release Date: 2018-07-19 Release Manager: Fernando Pujaico R. =============================================================================== ** mwnumbering.m added. ** imagesc_with_points.m: Improving the documentation. ** thsp_gaussian: Adding on-*-filled parameter. ** thsp_gaussian: Adding dot colors cyan, magenta,yellow, black and white. ** thsp_gaussian.m: Improving the visualization of point in the plot. ** thsp2corr.m: fixed error when the number of the analyzed images are odd. =============================================================================== bsltl-1.1.1 Release Date: 2016-10-10 Release Manager: Fernando Pujaico R. =============================================================================== ** thsp.m fixed. thsp.m: Fixing the second input parameter in matlab, now accept correctly 'line' and 'column'. ** thsp_gaussian.m fixed. thsp_gaussian.m: Improving the function to accept extra parameters in any position. =============================================================================== bsltl-1.1.0 Release Date: 2016-08-14 Release Manager: Fernando Pujaico R. =============================================================================== ** select_points.m and thsp_points.m added. select_points.m: select a set of points and return a matrix with these values. thsp_points.m: return a THSP from a set of points delivered from a matrix with these values. ** get_fir_filter.m added get_fir_filter.m: function similar to fir1 of signal package. =============================================================================== bsltl-1.0.2 Release Date: 2016-07-14 Release Manager: Fernando Pujaico R. =============================================================================== ** datapack.m fixed error when the address does not initialize with '~/'. =============================================================================== bsltl-1.0.1 Release Date: 2016-06-30 Release Manager: Fernando Pujaico R. =============================================================================== ** datapack_to_bmp.m function change the type of the return value. Now is returned a datapack struct with the fields: {file, format, init, dir, nel}. ** datapack.m function now expand images dir with '~/', with the home path value. ** thsp_gaussian.m function got a new characteristic in your fourth parameter. Now is accepted, optionally, a graphic handler as fourth parameter; also can be selected the color of the plotted points. ** Added texinfo overview and consequently overview.html. ** datapack_to_bmp.m function got a new characteristic in your second parameter. this is equal to improve in datapack.m. ** datapack.m function got a new characteristic in your second parameter. Now is possible load images with the format: img0001.bmp, img0002.bmp, ..., img0009.bmp, img0010.bmp, img0011.bmp. using the command: DATA=datapack(IMAGESDIR,'img%04d',1,12,'bmp'); ** thsp.m function got a new characteristic in your second parameter. Now R=1 and R='line' select a line in the datapack. Similarly, R=2 and R='column' select a column in the datapack. =============================================================================== bsltl-1.0.0 Release Date: 2016-04-22 Release Manager: Fernando Pujaico R. =============================================================================== ** Begin - version 1.0.0 of BSLTL. bsltl-1.3.1/CITATION0000644000175000017500000000123613417616462012431 0ustar olafolafTo cite the BSLTL package in publications use: Roberto Alves Braga Júnior, Fernando Pujaico Rivera and Junio Moreira (2016). BSLTL: Biospeckle Laser Tool Library. URL http://www.nongnu.org/bsltl/ A BibTeX entry for LaTeX users is: @misc{BSLTL, author = { Braga J\'unior, Roberto Alves and Pujaico Rivera, Fernando and Moreira, Junio}, title = {{BSLTL:} Biospeckle Laser Tool Library}, year = {2016}, url = {http://www.nongnu.org/bsltl/} } We have invested a lot of time and effort in creating BSLTL package, please cite it when using it. See also `citation pkgname' for citing other Octave package with pkgname name. bsltl-1.3.1/doc/0000755000175000017500000000000013417616462012037 5ustar olafolafbsltl-1.3.1/doc/overview.init0000644000175000017500000000147113417616462014575 0ustar olafolafuse strict; set_from_init_file('AFTER_BODY_OPEN', "\
\n\n"); set_from_init_file('EXTRA_HEAD', "\ \ "); bsltl-1.3.1/doc/manual.css0000644000175000017500000001152013417616462014025 0ustar olafolaf/* This is part of the GNU Octave Interval Package Manual. Copyright 2015-2016 Oliver Heimlich. See the file manual.texinfo for copying conditions. */ /* Modified by: Fernando Pujaico Rivera 04 may 2016. */ @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/4b8b4b377e8cb358cf886d13c7bb287c/RobotoCondensedBold.ttf') format('truetype'); font-weight: bold; font-style: normal; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/9b1d05d1b332e5b95ad86e71ca8404fb/RobotoCondensedBoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/d02fffb6890e4f28023dd149916d1b8a/RobotoCondensedItalic.ttf') format('truetype'); font-weight: normal; font-style: italic; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/b0b1845ecce8ab6a503971e808a8409c/RobotoCondensedRegular.ttf') format('truetype'); font-weight: normal; font-style: normal; } @font-face { font-family: 'Fantasque Sans Mono'; src: local('Fantasque Sans Mono'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/db52617ba875d08cbd8e080ca3d9f756/b145f0e884b2da8f1b112d26e7cefd3d/FantasqueSansMonoBold.ttf') format('truetype'); font-weight: bold; font-style: normal; } @font-face { font-family: 'Fantasque Sans Mono'; src: local('Fantasque Sans Mono'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/db52617ba875d08cbd8e080ca3d9f756/49319cbd53210c32099631ac89b1e70a/FantasqueSansMonoBoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; } @font-face { font-family: 'Fantasque Sans Mono'; src: local('Fantasque Sans Mono'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/db52617ba875d08cbd8e080ca3d9f756/5c07fe59e84e4594ffa87ae1a72b130d/FantasqueSansMonoItalic.ttf') format('truetype'); font-weight: normal; font-style: italic; } @font-face { font-family: 'Fantasque Sans Mono'; src: local('Fantasque Sans Mono'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/db52617ba875d08cbd8e080ca3d9f756/cc70dc22137e92aaef169e1de38a6ec7/FantasqueSansMonoRegular.ttf') format('truetype'); font-weight: normal; font-style: normal; } body > * { max-width: 42em; } div.header { max-width: 100%; } hr { margin-left: 0; border: none; border-top: 3px double #657b83; } div.header, div.float-caption { color: #657b83; } ul, ol { max-width: 39.5em; padding-left: 2.5em; } div.example, div.display, div.indentedblock, div.smalldisplay, div.lisp, div.smallindentedblock, div.smallexample, div.smalllisp { max-width: 38.8em; margin-left: 3.2em; } blockquote { margin-left: 3.2em; margin-right: 3.2em; max-width: 35.6em; } body, span.roman { font-family: 'Roboto Condensed', sans-serif; } body { padding-left: 7.5em; padding-right: 7.5em; } h1, h2, h3, h4, h5, pre.menu-comment { font-family: 'Roboto Condensed', serif; text-align: left !important; } div.float table, img { margin-left: auto; margin-right: auto; } div.float table { width: 38em; } div.float table, div.float th { border-collapse: collapse; border-top: 1px solid black; border-bottom: 1px solid black; } div.float th, div.float td { padding: 0.5em; } dd > p:first-child { margin-top: 0; } a { color: #268bd2; } a:visited { color: #d33682; } div.alpha-list + ol { list-style-type:lower-alpha; } div.zero-list + ol { counter-reset: item -1; } div.zero-list + ol > li { display:block; } div.zero-list + ol > li:before { content: counter(item) "."; counter-increment: item; display:inline-block; margin-left: -2.5em; min-width: 2em; margin-right: 0.2em; text-align: right; } .sf-logo { display:block; text-align: center; padding-top: 2em; padding-bottom: 2em; } code, samp { font-family: 'Fantasque Sans Mono', monospace; padding: 0 0.1em; font-style: italic; } pre.example, pre.smallexample, pre.verbatim { font-family: 'Fantasque Sans Mono', monospace; } pre.example { background-color: #fdf6e3; color: #657b83; padding: 0.5em; } pre.verbatim { background-color: #000000; color: #00FF00; padding: 0.5em; } .example { margin-bottom: 1em; } .example + .example { margin-top: -0.5em } .top-nav { float: right; font-weight: bold; padding: 8px; margin: 5px; } .top-nav a { color: white; text-decoration: none; text-shadow: 1px 1px 5px black; padding: 8px; } .darkblock { border-radius: 10px; -webkit-border-radius: 10px; -moz-border-radius: 10px; background: #111E0D; background: #111E0D -webkit-gradient(linear, left top, left 280%, from(#111E0D), to(#7C896F)); color: white; } bsltl-1.3.1/doc/overview.html0000644000175000017500000005603113417616462014600 0ustar olafolaf Biospeckle Laser Tool Library

Biospeckle Laser Tool Library

Table of Contents

Next: , Up: (dir)   [Contents][Index]

Introduction

The BSLTL package is a free collection of OCTAVE/MATLAB routines for working with the biospeckle laser technique.(version 1.3.1).

Implemented technics:

  • Graphical methods: Fujii, GD, Std, Mean, Contrast, PTD, MHI, Kurtosis, Skewness, etc.
  • Numerical methods: AVD, IM, NCOM, THSP, RVD, Corr, etc.
  • Filtering
  • Quality test
  • etc

Next: , Previous: , Up: Top   [Contents][Index]

1 Citations

To cite the BSLTL package in publications use:

Roberto Alves Braga Júnior, Fernando Pujaico Rivera and Junio Moreira (2016).
BSLTL: Biospeckle Laser Tool Library.
URL http://www.nongnu.org/bsltl/

A BibTeX entry for LaTeX users is:

@misc{BSLTL1,
    author    = {Braga J\'unior, Roberto Alves and 
                 Pujaico Rivera, Fernando and 
                 Moreira, Junio},
    title     = {{BSLTL:} Biospeckle Laser Tool Library},
    year      = {2016},
    url       = {http://www.nongnu.org/bsltl/}
}

We have invested a lot of time and effort in creating BSLTL package, please cite it when using it. See also ‘citation pkgname’ for citing other Octave package with pkgname name.


Next: , Previous: , Up: Top   [Contents][Index]

2 Installation

2.1 Method 1: Online - Only in OCTAVE

The next OCTAVE code, install the last version of BSLTL package directly from octave-forge website in the default install directory.

pkg install -forge -auto bsltl

With this method the package is configured for be loaded automatically when OCTAVE start.

2.2 Method 2: Offline - Only in OCTAVE

If the BSLTL package (bsltl-1.3.1.tar.gz) was downloaded in the directory: /download_path The next OCTAVE code, install the BSLTL package, in the directory: ~/lib/octmat

pkg prefix ~/lib/octmat
pkg install -auto /download_path/bsltl-1.3.1.tar.gz

With this method the package is configured for be loaded automatically when OCTAVE start.

2.3 Method 3: Offline - In MATLAB or OCTAVE

If the BSLTL package (bsltl-1.3.1.zip or bsltl-1.3.1.tar.gz) was uncompressed in the directory '/home/user/lib/octmat/bsltl'. For that this package can be used by a source file, it needs add the next code in the top of source file.

BSLTL_DIR='/home/user/lib/octmat/bsltl';
addpath(genpath(BSLTL_DIR));

The function genpath generates a list with the directories and sub directories. The function addpath add directories to OCTAVE system path.

In this method we install (add to Octave system path) the BSLTL package each time that we call our source files.


3 Using the BSLTL package

3.1 Example code of installation method 1 and 2 - Getting the AVD value of line 240

The next code load 129 images from the directory pointed by the variable IMAGES_DIR; the images are called 'img001.bmp', 'img002.bmp', ..., 'img128.bmp' and 'img129.bmp'. The images are joined in a 3D matrix called DATA.

IMAGES_DIR = '/home/user/data/speckle/test1';
DATA = datapack(IMAGES_DIR,'img%03d',1,129,'bmp');

THSP = thsp(DATA,'line',240);   % Getting the time history speckle pattern.
COM  = coom(THSP);              % Getting the co-occurrence matrix.
AVD  = avd(COM);                % Getting the AVD value.

Finally are calculated the time history speckle pattern (of pixels in the line number 240 of DATA),the co-occurrence matrix and the AVD value, and your values are stored in the variables THSP, COM and AVD respectively.

3.2 Example code of installation method 3 - Getting the AVD value of column 100

The next code load to octave enviroment all the code functions located in the address pointed by the variable BSLTL_DIR, including subdirectories.

Later the code load 129 images from the directory pointed by the variable IMAGES_DIR; the images are called 'img1.bmp', 'img2.bmp', ..., 'img128.bmp' and 'img129.bmp'. The images are joined in a 3D matrix called DATA.

BSLTL_DIR = '/home/user/lib/octmat/bsltl';
addpath(genpath(BSLTL_DIR));

IMAGES_DIR = '/home/user/data/speckle/test1';
DATA = datapack(IMAGES_DIR,'img%d',1,129,'bmp');

THSP = thsp(DATA,'column',100); % Getting the time history speckle pattern.
COM  = coom(THSP);              % Getting the co-occurrence matrix.
AVD  = avd(COM);                % Getting the AVD value.

Finally are calculated the time history speckle pattern (of pixels in the column number 100 of DATA), the co-occurrence matrix and the AVD value, and your values are stored in the variables THSP, COM and AVD respectively.

3.3 More code examples

Many code examples can be found in the examples page of BSLTL library.


Next: , Previous: , Up: Top   [Contents][Index]

4 Contributing to the package

In the case that you want to include a new function in the library, submissions will only be accepted when they have the source code documented and they are accompanied by a tutorial (all these should be below General Public License or any compatible). The tutorial can be made with Latex, Texinfo, Markdown, or any support that uses plain text.

4.1 Contributing from mailing list

To contribute to the BSLTL package using your email account, you can send your proposal to the mailing list

4.2 Contributing through a patch

To contribute to the BSLTL package through a patch:

  • Clone the package; making a local copy of BSLTL source repository;
    git clone http://git.savannah.gnu.org/r/bsltl.git
    
    cd bsltl
    
  • Make your changes in the source code;
  • Commit the changeset into your local repository;
    git add *
    
    git commit -m "Here, you describe the modification made."
    
  • Create the patch; export the last changeset (commit) to a diff file;
    git format-patch -1 -o ../
    
  • Submit it to the patch tracker.

Next: , Previous: , Up: Top   [Contents][Index]

5 Copyright

Copyright (c) 2016 BSLTL project group.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
	 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
	
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.

Next: , Previous: , Up: Top   [Contents][Index]

6 Versions

The increment in the version number has a meaning. To a version number with the format ’va.b.c’ (by example: v1.3.1).

  • An increment in ’c’ indicates a modification or correction in the code.
  • An increment in ’b’ indicates that at least a new function was added in the code.
  • An increment in ’c’ is reserved to great modifications in the code.

Next: , Previous: , Up: Top   [Contents][Index]

7 BSLTL project group


Next: , Previous: , Up: Top   [Contents][Index]

8 Support or Contact

Having trouble with the package? Check out our documentation or contact support.

Please, also visit the Home page of BSLTL project.


Previous: , Up: Top   [Contents][Index]

Index

Jump to:   C   M  
Index Entry  Section

C
Citations as bibtex: Citations
Citations as plain: Citations

M
Method 1: Installation
Method 1: Using the BSLTL package
Method 2: Installation
Method 2: Using the BSLTL package
Method 3: Installation
Method 3: Using the BSLTL package

Jump to:   C   M  

bsltl-1.3.1/doc/overview.texi0000644000175000017500000002660613417616462014612 0ustar olafolaf\input texinfo @c ############################################################################# @c @c makeinfo --html overview.texi --no-split --css-ref=manual.css --init-file=overview.init @c @c ############################################################################# @set VERSION 1.3.1 @settitle Biospeckle Laser Tool Library @copying The BSLTL package is a free collection of OCTAVE/MATLAB routines for working with the biospeckle laser technique. Copyright @copyright{} 2016 Fernando Pujaico Rivera @end copying @documentencoding utf-8 @titlepage @title Biospeckle Laser Tool Library (BSLTL) @page @vskip 0pt plus 1filll @insertcopying @end titlepage @c Output the table of the contents at the beginning. @contents @ifnottex @node Top @top Introduction The BSLTL package is a free collection of OCTAVE/MATLAB routines for working with the biospeckle laser technique.(version @value{VERSION}). Implemented technics: @itemize @bullet @item Graphical methods: Fujii, GD, Std, Mean, Contrast, PTD, MHI, Kurtosis, Skewness, etc. @c @math{FUJII=\frac{200}{NTIMES-1} \sum \limits_{k=1}^{NTIMES-1} \frac{|I_{k}-I_{k+1}|}{I_{k}+I_{k+1}}} @c @math{GD=\frac{1}{\binom{NTIMES}{2}} \sum\limits_{k=1}^{NTIMES-1} \sum\limits_{l=1}^{NTIMES-k} |I(k)-I(k+l)|} @c @math{Mean= \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} I(k) \approx E[I(k)]} @c @math{Std = \sqrt{ \frac{1}{NTIMES} \sum\limits_{k=1}^{NTIMES} (I(k)-Mean)^2 }} @item Numerical methods: AVD, IM, NCOM, THSP, RVD, Corr, etc. @c @math{AVD=\sum \limits_{ij} NCOM(i,j)|i-j|} @c @math{IM=\sum \limits_{ij} NCOM(i,j)|i-j|^2} @c @math{RVD=\sum \limits_{ij} NCOM(i,j)(i-j)} @item Filtering @item Quality test @item etc @end itemize @end ifnottex @menu * Citations:: How to cite the library. * Installation:: About the intallation methods. * Using the BSLTL package:: About as to use the BSLTL package. * Contributing to the package:: How contribute with the package * Copyright:: Legal notice copyright. * Versions:: Labeling criteria. * BSLTL project group:: Authors. * Support or Contact:: Links of interest. * Index:: Complete index. @end menu @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Citations @chapter Citations To cite the BSLTL package in publications use: @display Roberto Alves Braga Júnior, Fernando Pujaico Rivera and Junio Moreira (2016). BSLTL: Biospeckle Laser Tool Library. URL http://www.nongnu.org/bsltl/ @end display @cindex Citations as plain A BibTeX entry for LaTeX users is: @verbatim @misc{BSLTL1, author = {Braga J\'unior, Roberto Alves and Pujaico Rivera, Fernando and Moreira, Junio}, title = {{BSLTL:} Biospeckle Laser Tool Library}, year = {2016}, url = {http://www.nongnu.org/bsltl/} } @end verbatim @cindex Citations as bibtex We have invested a lot of time and effort in creating BSLTL package, please cite it when using it. See also `citation pkgname' for citing other Octave package with pkgname name. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Installation @chapter Installation @section Method 1: Online - Only in OCTAVE @cindex Method 1 The next OCTAVE code, install the last version of BSLTL package directly from octave-forge website in the default install directory. @example pkg install -forge -auto bsltl @end example With this method the package is configured for be loaded automatically when OCTAVE start. @section Method 2: Offline - Only in OCTAVE @cindex Method 2 If the BSLTL package (@url{http://download.savannah.gnu.org/releases/bsltl/, bsltl-@value{VERSION}.tar.gz}) was downloaded in the directory: /download_path The next OCTAVE code, install the BSLTL package, in the directory: ~/lib/octmat @example pkg prefix ~/lib/octmat pkg install -auto /download_path/bsltl-@value{VERSION}.tar.gz @end example With this method the package is configured for be loaded automatically when OCTAVE start. @section Method 3: Offline - In MATLAB or OCTAVE @cindex Method 3 If the BSLTL package (@url{http://download.savannah.gnu.org/releases/bsltl/, bsltl-@value{VERSION}.zip} or @url{http://download.savannah.gnu.org/releases/bsltl/, bsltl-@value{VERSION}.tar.gz}) was uncompressed in the directory @code{'/home/user/lib/octmat/bsltl'}. For that this package can be used by a source file, it needs add the next code in the top of source file. @example BSLTL_DIR='/home/user/lib/octmat/bsltl'; addpath(genpath(BSLTL_DIR)); @end example The function genpath generates a list with the directories and sub directories. The function addpath add directories to OCTAVE system path. In this method we install (add to Octave system path) the BSLTL package each time that we call our source files. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Using the BSLTL package @chapter Using the BSLTL package @section Example code of installation method 1 and 2 - Getting the AVD value of line 240 @cindex Method 1 @cindex Method 2 The next code load 129 images from the directory pointed by the variable @code{IMAGES_DIR}; the images are called @code{'img001.bmp'}, @code{'img002.bmp'}, ..., @code{'img128.bmp'} and @code{'img129.bmp'}. The images are joined in a 3D matrix called @code{DATA}. @example IMAGES_DIR = '/home/user/data/speckle/test1'; DATA = datapack(IMAGES_DIR,'img%03d',1,129,'bmp'); THSP = thsp(DATA,'line',240); % Getting the time history speckle pattern. COM = coom(THSP); % Getting the co-occurrence matrix. AVD = avd(COM); % Getting the AVD value. @end example Finally are calculated the time history speckle pattern (of pixels in the line number 240 of @code{DATA}),the co-occurrence matrix and the AVD value, and your values are stored in the variables @code{THSP}, @code{COM} and @code{AVD} respectively. @section Example code of installation method 3 - Getting the AVD value of column 100 @cindex Method 3 The next code load to octave enviroment all the code functions located in the address pointed by the variable @code{BSLTL_DIR}, including subdirectories. Later the code load 129 images from the directory pointed by the variable @code{IMAGES_DIR}; the images are called @code{'img1.bmp'}, @code{'img2.bmp'}, ..., @code{'img128.bmp'} and @code{'img129.bmp'}. The images are joined in a 3D matrix called @code{DATA}. @example BSLTL_DIR = '/home/user/lib/octmat/bsltl'; addpath(genpath(BSLTL_DIR)); IMAGES_DIR = '/home/user/data/speckle/test1'; DATA = datapack(IMAGES_DIR,'img%d',1,129,'bmp'); THSP = thsp(DATA,'column',100); % Getting the time history speckle pattern. COM = coom(THSP); % Getting the co-occurrence matrix. AVD = avd(COM); % Getting the AVD value. @end example Finally are calculated the time history speckle pattern (of pixels in the column number 100 of @code{DATA}), the co-occurrence matrix and the AVD value, and your values are stored in the variables @code{THSP}, @code{COM} and @code{AVD} respectively. @section More code examples Many code examples can be found in the @url{http://www.nongnu.org/bsltl/examples.html, examples page} of BSLTL library. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Contributing to the package @chapter Contributing to the package In the case that you want to include a new function in the library, submissions will only be accepted when they have the source code documented and they are accompanied by a tutorial (all these should be below General Public License or any compatible). The tutorial can be made with Latex, Texinfo, Markdown, or any support that uses plain text. @section Contributing from mailing list To contribute to the BSLTL package using your email account, you can send your proposal to the @url{https://savannah.nongnu.org/mail/?group=bsltl, mailing list} @section Contributing through a patch To contribute to the BSLTL package through a patch: @itemize @bullet @item Clone the package; making a local copy of BSLTL source repository; @verbatim git clone http://git.savannah.gnu.org/r/bsltl.git cd bsltl @end verbatim @item Make your changes in the source code; @item Commit the changeset into your local repository; @verbatim git add * git commit -m "Here, you describe the modification made." @end verbatim @item Create the patch; export the last changeset (commit) to a diff file; @verbatim git format-patch -1 -o ../ @end verbatim @item Submit it to the @url{https://savannah.nongnu.org/patch/?func=additem&group=bsltl, patch tracker}. @end itemize @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Copyright @chapter Copyright @display Copyright (c) 2016 BSLTL project group. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @end display @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Versions @chapter Versions The increment in the version number has a meaning. To a version number with the format 'va.b.c' (by example: v@value{VERSION}). @itemize @bullet @item An increment in 'c' indicates a modification or correction in the code. @item An increment in 'b' indicates that at least a new function was added in the code. @item An increment in 'c' is reserved to great modifications in the code. @end itemize @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node BSLTL project group @chapter BSLTL project group @itemize @bullet @item Roberto Alves Braga Júnior @email{robertobraga@@deg.ufla.br} @item Fernando Pujaico Rivera @email{fernando.pujaico.rivera@@gmail.com} @item Junio Moreira @email{juniomoreira@@iftm.edu.br} @end itemize @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Support or Contact @chapter Support or Contact Having trouble with the package? Check out our @url{http://www.nongnu.org/bsltl/documentation.html, documentation} or @url{https://savannah.nongnu.org/mail/?group=bsltl, contact support}. Please, also visit the @url{http://www.nongnu.org/bsltl/, Home page of BSLTL project}. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node Index @unnumbered Index @printindex cp @bye