Browse Source

Initial class construction

master
João Narciso 3 years ago
parent
commit
431ff5f7d4
  1. 62
      Code/CardiacPhase.m
  2. 98
      Code/Phase.m
  3. 55
      Code/RespiratoryPhase.m
  4. 306
      Code/rParabEmd__L.m
  5. 48
      Code/test_OOP.m
  6. 360
      Git/LICENSE.txt
  7. 2396
      Git/ReleaseNotes.html
  8. BIN
      Git/bin/bash.exe
  9. BIN
      Git/bin/git.exe
  10. BIN
      Git/bin/sh.exe
  11. BIN
      Git/cmd/git-gui.exe
  12. BIN
      Git/cmd/git-lfs.exe
  13. BIN
      Git/cmd/git.exe
  14. BIN
      Git/cmd/gitk.exe
  15. 85
      Git/cmd/start-ssh-agent.cmd
  16. 63
      Git/cmd/start-ssh-pageant.cmd
  17. BIN
      Git/dev/fd
  18. BIN
      Git/dev/stderr
  19. BIN
      Git/dev/stdin
  20. BIN
      Git/dev/stdout
  21. 204
      Git/etc/DIR_COLORS
  22. 15
      Git/etc/bash.bash_logout
  23. 65
      Git/etc/bash.bashrc
  24. 70
      Git/etc/docx2txt.config
  25. 6
      Git/etc/fstab
  26. 45
      Git/etc/hosts
  27. 83
      Git/etc/inputrc
  28. 10
      Git/etc/install-options.txt
  29. 53
      Git/etc/msystem
  30. BIN
      Git/etc/mtab
  31. 307
      Git/etc/nanorc
  32. 16
      Git/etc/networks
  33. 12
      Git/etc/nsswitch.conf
  34. 159
      Git/etc/package-versions.txt
  35. 9
      Git/etc/pkcs11/pkcs11.conf.example
  36. BIN
      Git/etc/pki/ca-trust/extracted/java/cacerts
  37. 4407
      Git/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
  38. 3075
      Git/etc/pki/ca-trust/extracted/pem/email-ca-bundle.pem
  39. 0
      Git/etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem
  40. 3673
      Git/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
  41. 180
      Git/etc/profile
  42. 21
      Git/etc/profile.d/aliases.sh
  43. 11
      Git/etc/profile.d/bash_profile.sh
  44. 16
      Git/etc/profile.d/env.sh
  45. 39
      Git/etc/profile.d/git-prompt.sh
  46. 19
      Git/etc/profile.d/lang.sh
  47. 15
      Git/etc/profile.d/perlbin.csh
  48. 17
      Git/etc/profile.d/perlbin.sh
  49. 28
      Git/etc/protocols
  50. 285
      Git/etc/services
  51. 428
      Git/etc/ssh/moduli
  52. 48
      Git/etc/ssh/ssh_config
  53. 116
      Git/etc/ssh/sshd_config
  54. 445
      Git/etc/tigrc
  55. 55
      Git/etc/vimrc
  56. BIN
      Git/git-bash.exe
  57. BIN
      Git/git-cmd.exe
  58. BIN
      Git/mingw64/bin/WhoUses.exe
  59. BIN
      Git/mingw64/bin/acountry.exe
  60. BIN
      Git/mingw64/bin/adig.exe
  61. BIN
      Git/mingw64/bin/ahost.exe
  62. BIN
      Git/mingw64/bin/antiword.exe
  63. BIN
      Git/mingw64/bin/blocked-file-util.exe
  64. BIN
      Git/mingw64/bin/bunzip2.exe
  65. BIN
      Git/mingw64/bin/bzcat.exe
  66. 76
      Git/mingw64/bin/bzcmp
  67. 76
      Git/mingw64/bin/bzdiff
  68. 132
      Git/mingw64/bin/bzegrep
  69. 132
      Git/mingw64/bin/bzfgrep
  70. 132
      Git/mingw64/bin/bzgrep
  71. BIN
      Git/mingw64/bin/bzip2.exe
  72. BIN
      Git/mingw64/bin/bzip2recover.exe
  73. 61
      Git/mingw64/bin/bzless
  74. 61
      Git/mingw64/bin/bzmore
  75. BIN
      Git/mingw64/bin/certtool.exe
  76. BIN
      Git/mingw64/bin/connect.exe
  77. BIN
      Git/mingw64/bin/create-shortcut.exe
  78. BIN
      Git/mingw64/bin/curl.exe
  79. BIN
      Git/mingw64/bin/edit.dll
  80. BIN
      Git/mingw64/bin/edit_test.exe
  81. BIN
      Git/mingw64/bin/edit_test_dll.exe
  82. BIN
      Git/mingw64/bin/envsubst.exe
  83. BIN
      Git/mingw64/bin/gettext.exe
  84. 121
      Git/mingw64/bin/gettext.sh
  85. 1347
      Git/mingw64/bin/gettextize
  86. BIN
      Git/mingw64/bin/git-lfs.exe
  87. BIN
      Git/mingw64/bin/git-receive-pack.exe
  88. BIN
      Git/mingw64/bin/git-upload-archive.exe
  89. BIN
      Git/mingw64/bin/git-upload-pack.exe
  90. BIN
      Git/mingw64/bin/git.exe
  91. 12645
      Git/mingw64/bin/gitk
  92. 9
      Git/mingw64/bin/jemalloc.sh
  93. 5624
      Git/mingw64/bin/jeprof
  94. BIN
      Git/mingw64/bin/libatomic-1.dll
  95. BIN
      Git/mingw64/bin/libbz2-1.dll
  96. BIN
      Git/mingw64/bin/libcares-3.dll
  97. BIN
      Git/mingw64/bin/libcharset-1.dll
  98. BIN
      Git/mingw64/bin/libcrypto-1_1-x64.dll
  99. BIN
      Git/mingw64/bin/libcurl-4.dll
  100. BIN
      Git/mingw64/bin/libeay32.dll
  101. Some files were not shown because too many files have changed in this diff Show More

62
Code/CardiacPhase.m

@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
classdef CardiacPhase < Phase
properties
FullPhase = Phase;
SelectedPhase = [];
SystolePositions = [];
DiastolePositions = [];
end
methods %constructor
function obj=CardiacPhase(Phase)
if nargin==0;return;end
% gets properties of superclass
obj.FullPhase = Phase.Values;
obj.WorkLoad = Phase.WorkLoad;
obj.Video = Phase.Video;
end
%
% methods %set methods
% % function set.ToBeSetByUser(obj,val)
% % if ~isboolean(val);error('provide a boolean value please');end
% % obj.ToBeSetByUser=val;
% % end
% end
%
% Choose the correct IMF depending on the work load
function SelectPhase(obj)
if strcmp(obj.WorkLoad,'Rest')
imf_number = 3;
else if strcmp(obj.WorkLoad,'Exercise')
imf_number = 2;
else if strcmp(obj.WorkLoad,'Continuous Acquisition')
imf_number = 3;
end
end
end
obj.SelectedPhase = obj.FullPhase(imf_number,:); % Phase corresponding to the cardiac phase
end
% Detects the frame's positions of diastolic events
function Diastole(obj)
max_heart_phase = max(obj.SelectedPhase); % cardiac phase maxima
treshold_diast = 0.8*max_heart_phase; % diastole treshold
index1 = obj.SelectedPhase > treshold_diast; % frames with phase above the diastolic treshold
indexNumeric1 = find(index1);
values1 = obj.SelectedPhase(indexNumeric1);
[ordered_values1 oredered_index1] = sort(values1);
obj.DiastolePositions = indexNumeric1(oredered_index1); % sorts the frames in ascending cardiac phase
end
% Detects the frame's positions of systolic events
function Systole(obj)
min_heart_phase = min(obj.SelectedPhase); % cardiac phase minima
treshold_syst = 0.8*min_heart_phase; % systole treshold
index2 = obj.SelectedPhase < treshold_syst; % frames with phase below the systolic treshold
indexNumeric2 = find(index2);
values2 = obj.SelectedPhase(indexNumeric2);
[ordered_values2 oredered_index2] = sort(values2);
obj.SystolePositions = indexNumeric2(oredered_index2); % sorts the frames in ascending cardiac phase
end
end
end

98
Code/Phase.m

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
classdef Phase < handle
properties
MeanIntensity = [];
Video = [];
IMFs = [];
Values = [];
WorkLoad = '';
end
properties % (GetAccess = private) should become private
nFrames = uint32(0);
xImageSize = uint16(0);
yImageSize = uint16(0);
end
properties(Constant)
InitialDirectory = 'C:\Uss\Jero<EFBFBD>o\Desktop\Tese\Data';
end
methods %constructor
function obj=Phase(varargin)
if nargin==0;return;end
end
end
methods %set methods
function set.WorkLoad(obj,str)
obj.WorkLoad = str;
% if indx == 1
% obj.WorkLoad = 'Rest';
% else if indx == 2
% obj.WorkLoad = 'Exercise';
% else
% obj.WorkLoad = 'Continuous Acquisition';
% end
end
end
methods
% Extracts the image sequence from the folder
function GetData(obj)
directory = uigetdir(obj.InitialDirectory); % Choose the cineMRI folder
dicomFiles = dir(fullfile(directory, '*.dcm' ));
obj.nFrames = length(dicomFiles); % Number of frames of the cineMRI
info = dicominfo(fullfile(directory,dicomFiles(1).name));
obj.xImageSize = info.Width; % Image width
obj.yImageSize = info.Height; % Image height
obj.Video = zeros(obj.xImageSize, obj.yImageSize, 1, obj.nFrames, 'uint8');
for p=1:obj.nFrames
filename = fullfile(directory, dicomFiles(p).name );
Info=dicominfo(filename);
if Info.Width~=obj.xImageSize || Info.Height~=obj.yImageSize
error('invalid image dimensions')
end
obj.Video(:,:,1,p) = dicomread(filename); % Read the DICOM files in the folder
end
end
% Gets the mean intensity value of the image sequence usin the
% central point in k-space for all the images
function GetSignal(obj)
d2IFT = ifft2(obj.Video); % performs Inverse Fourier Transform
d2IFT_shifted = fftshift(d2IFT);
for i=1:obj.nFrames
obj.MeanIntensity(:,i) = d2IFT_shifted(floor(obj.yImageSize/2),floor(obj.xImageSize/2),i); % extracts intensity of the central point in k-space for every frame
end
obj.MeanIntensity = abs(obj.MeanIntensity);
end
% Perfomrs Empirical Mode Decomposition
function GetEMD(obj)
obj.IMFs = rParabEmd__L(obj.MeanIntensity,40,40,1);
obj.IMFs = obj.IMFs.';
end
% Apply Hilber Transform to all the IMFs and extract the
% instantneous phase from each one of them
function GetPhase(obj)
[number_imf lenght] = size(obj.IMFs);
analytic_EMD = zeros(number_imf,lenght);
for i=1:1:number_imf
analytic_EMD(i,:) = hilbert(obj.IMFs(i,:)); %Apply Hilbert Transform
obj.Values(i,:) = angle(analytic_EMD(i,:))/pi; % Get instataneous phase
end
end
% Shows the frames of the original image sequence specified in the
% array 'positions'
function ShowFrames(obj,positions,title)
triggered = [];
triggered = cat(2,triggered,obj.Video(:,:,positions));
video = implay(triggered,3);
set(video.Parent, 'Name', title);
end
end
end

55
Code/RespiratoryPhase.m

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
classdef RespiratoryPhase < Phase
properties
FullPhase = Phase;
SelectedPhase = [];
InspirationPositions = [];
ExpirationPositions = [];
end
methods %constructor
function obj=RespiratoryPhase(Phase)
if nargin==0;return;end
% gets properties of superclass
obj.FullPhase = Phase.Values;
obj.WorkLoad = Phase.WorkLoad;
obj.Video = Phase.Video;
end
% Choose the correct IMF depending on the work load
function SelectPhase(obj)
if strcmp(obj.WorkLoad,'Rest')
imf_number = 5;
else if strcmp(obj.WorkLoad,'Exercise')
imf_number = 4;
else if strcmp(obj.WorkLoad,'Continuous Acquisition')
imf_number = 5;
end
end
end
obj.SelectedPhase = obj.FullPhase(imf_number,:); %Phase corresponding to respiratory phase
end
% Detects the frame's positions of inspiration moments
function Inspiration(obj)
max_resp_phase = max(obj.SelectedPhase); % respiratory phase maxima
treshold_insp = 0.8*max_resp_phase; % inspiration treshold
index1 = obj.SelectedPhase > treshold_insp; % frames above inpiration treshold
indexNumeric1 = find(index1);
values1 = obj.SelectedPhase(indexNumeric1);
[ordered_values1 oredered_index1] = sort(values1);
obj.InspirationPositions = indexNumeric1(oredered_index1); % sorts the frames in ascending respiratory phase
end
% Detects the frame's positions of expiration moments
function Expiration(obj)
min_resp_phase = min(obj.SelectedPhase); % respiratory phase minima
treshold_exp = 0.8*min_resp_phase; % systole treshold
index2 = obj.SelectedPhase < treshold_exp; % frames below the systole treshold
indexNumeric2 = find(index2);
values2 = obj.SelectedPhase(indexNumeric2);
[ordered_values2 oredered_index2] = sort(values2);
obj.ExpirationPositions = indexNumeric2(oredered_index2); % sorts the frames in ascending respiratory phase
end
end
end

306
Code/rParabEmd__L.m

@ -0,0 +1,306 @@ @@ -0,0 +1,306 @@
function rParabEmd = rParabEmd__L (x, qResol, qResid, qAlfa)
dbstop if warning
if(nargin~=4), error('rParabEmd__L: Use with 4 inputs.'), end
if(nargout>1), error('rParabEmd__L: Use with just one output.'), end
ArgCheck_s(x, qResol, qResid, qAlfa)
% Actual computation -------------------------------------
kc = x(:); % ket copy of the input signal
Wx= kc'*kc; % Original signal energy
quntN = length(kc); % Signal length
% loop to decompose the input signal into successive IMFs
rParabEmd= []; % Matrix which will contain the successive IMFs, and the residue
rParabEmdCnt= 0;
qDbResid= 0; %Equal energies at start
quntOscCnt= quntNOsc_s(kc);
while ((qDbResid<qResid) && (quntOscCnt>2) ) % c has some energy and oscilates
kImf = kc; % at the beginning of the sifting process, kImf is the signal
rPMOri= rGetPMaxs_s(kImf); % rPM= [xM(M), yM(M)];
rPmOri= rGetPMins_s(kImf); % rPm= [xm(m), ym(m)];
rPM= rPMaxExtrapol_s(rPMOri, rPmOri, quntN);
rPm= rPMinExtrapol_s(rPMOri, rPmOri, quntN);
quntLM= length(rPM); quntLm= length(rPm);
% if (abs(quntLM-quntLm)>2), disp('Debug: Max-Min count mismatch.'),keyboard,end;
if (abs(quntLM-quntLm)>2), disp('Debug: Max-Min count mismatch.'),end;
if(sum(abs(diff(sign(rPM(1:min(quntLM,quntLm),1)- rPm(1:min(quntLM,quntLm),1)))))>0)
% disp('Debug: Max-Min sequence mismatch.'),keyboard;
disp('Debug: Max-Min sequence mismatch.');
end
if(sum(abs(diff(sign(rPm(1:min(quntLM,quntLm),1)- rPM(1:min(quntLM,quntLm),1)))))>0)
% disp('Debug: Max-Min reverse sequence mismatch.'),keyboard;
disp('Debug: Max-Min reverse sequence mismatch.');
end
bTenv= spline(rPM(:,1), rPM(:,2), 1:quntN); % Top envelop: bTenv[n];
bDenv= spline(rPm(:,1), rPm(:,2), 1:quntN); % Down envelop: bDenv[n];
bBias= (bTenv+bDenv)/2; % first bias estimate
while true(1) % inner loop to find each IMF
WImf= kImf'*kImf; %current IMF energy
WBias= bBias*bBias'; %bias energy
if WBias*WImf<0 , warning('rParabEmd__L: Ooops, negative energy detected.'), end
if WBias> 0, DbqResol= 10*log10(WImf/WBias); else DbqResol= Inf; end
if (DbqResol>qResol), break, end %Resolution reached
%Resolution not reached. More work is needed
kImf = kImf- qAlfa*bBias'; % subtract qAlfa bias from kImf
rPMOri= rGetPMaxs_s(kImf); % rPM= [xM(M), yM(M)];
rPmOri= rGetPMins_s(kImf); % rPm= [xm(m), ym(m)];
rPM= rPMaxExtrapol_s(rPMOri, rPmOri, quntN);
rPm= rPMinExtrapol_s(rPMOri, rPmOri, quntN);
bTenv= spline(rPM(:,1), rPM(:,2), 1:quntN); % Top envelop: bTenv[n];
bDenv= spline(rPm(:,1), rPm(:,2), 1:quntN); % Down envelop: bDenv[n];
bBias= (bTenv+bDenv)/2; % new bias estimate
end % Wend true
%
rParabEmd = [rParabEmd; kImf']; % store the extracted rParabEmd in the matrix rParabEmd
kc = kc - kImf; % subtract the extracted rParabEmd from the signal
quntOscCnt= quntNOsc_s(kc);
rParabEmdCnt=rParabEmdCnt+1;
if (kc'*kc)>0
qDbResid= 10*log10(Wx/(kc'*kc));
else
qDbResid = Inf
end
%
end % Wend ((DbR... ))
if ((kc'*kc)/Wx)>(10^-12)
rParabEmd=[rParabEmd; kc']; %The residual is the last IMF
rParabEmdCnt=rParabEmdCnt+1;
NumOscqResiduais= quntNOsc_s(kc);
end
rParabEmd= rParabEmd';
end %main function
%SubFunctions ------------------------------------------------------------
%-------------------------------------------------------------------------
function ArgCheck_s(x, qResol, qResid, qAlfa)
[qL, qC] = size(x);
if ((qL*qC)~= max(qL,qC)), error('rParabEmd__L: Input signal must be a one dim vector.'), end
if ((qL*qC)<= 1), error('rParabEmd__L: Input signal must be a vector.'), end
[qL,qC] = size(qResol);
if ( ~((qL==1)&(qC==1)) ), error('rParabEmd__L: Input resolution must be a scalar.'), end
if ( qResol<=0 ), error('rParabEmd__L: Input resolution must strictly positive.'), end
[qL,qC] = size(qResid);
if ( ~((qL==1)&(qC==1)) ), error('rParabEmd__L: Input residual must be a scalar.'), end
if ( qResid<=0 ), error('rParabEmd__L: Input residual must strictly positive.'), end
[qL,qC] = size(qAlfa);
if ( ~((qL==1)&(qC==1)) ), error('rParabEmd__L: qAlfa step must be a scalar.'), end
if ( qAlfa<=0 ), error('rParabEmd__L: qAlfa step must be strictly positive.'), end
end
%--------------------------------------------------------------------------
%---------- make at 17-Jul-07 10:16:59.44
% quntNOsc_s v1.01
% build 20070409001
% Returns the oscilation count, no steps
function quntNOsc = quntNOsc_s (x)
y=0; qisTop= false; qisDown= false;
for i=2:(length(x)-1)
if( ((x(i-1)) < (x(i))) && ((x(i+1))< (x(i))) ) %Max /-\
y=y+1;
end
if( ((x(i-1)) > (x(i))) && ((x(i+1))> (x(i))) ) %min \_/
y=y+1;
end
%Top
if( ((x(i-1)) < (x(i))) && ((x(i+1))== (x(i))) ) %StepL /-
qisTop= true; qisDown= false;
end
if( ((x(i-1)) == (x(i))) && ((x(i+1))< (x(i))) ) %stepR -\
if qisTop; y=y+1; end;
qisTop= false;
end
%Downs
if( ((x(i-1)) > (x(i))) && ((x(i+1))== (x(i))) ) %stepL \_
qisTop= false; qisDown= true;
end
if( ((x(i-1)) == (x(i))) && ((x(i+1))> (x(i))) ) %StepR _/
if qisDown; y=y+1; end
qisDown=false;
end
end % for i=2:(length(x)-1)
quntNOsc= y;
end % function y = quntNOsc_s (x)
%---------- make at 17-Jul-07 10:16:59.44
function rPMaxExtrapol= rPMaxExtrapol_s(rPM, rPm, quntL)
%rPMaxExtrapol_s V1.00
% build 2007407001
% Time-mirrored top extrema (Parabolic Maxs) extrapolation
%Init ------------------------------------
rPM= sortrows(rPM); %assumes nothing on rPM sort order
rPm= sortrows(rPm); %assumes nothing on rPm sort order
kTopTim1= rPM(:,1); kTopVal= rPM(:,2);
kDwnTim1= rPm(:,1); kDwnVal= rPm(:,2);
%Start extrapolation ---------------------
if ( (kTopTim1(1)== 1) && (kDwnTim1(1)== 1) )
disp ('rPMaxExtrapol_s: Poliextrema at signal''s start');
elseif ( (kTopTim1(1)<1) || (kDwnTim1(1)< 1) )
disp ('rPMaxExtrapol_s: Invalid extrema at signal''s start');
else
kTopTim1=[2-kDwnTim1(1); kTopTim1]; % New first Top at the (one based) specular Min
kTopVal=[kTopVal(1); kTopVal]; % Same Val as old first Top
end
% End extrapolation -----------------------
if ( (kTopTim1(end)== quntL) && (kDwnTim1(end)== quntL) )
disp ('rPMaxExtrapol_s: Poliextrema at signal''s end');
elseif ( (kTopTim1(end)> quntL) || (kDwnTim1(end)> quntL) )
disp ('rPMaxExtrapol_s: Invalid extrema at signal''s end');
else
kTopTim1=[kTopTim1; (2*quntL - kDwnTim1(end))]; % New last Top at the specular Min
kTopVal=[ kTopVal; kTopVal(end)]; % Same Val as old last Top
end
% return value ------------------------
rPMaxExtrapol= sortrows([kTopTim1, kTopVal]);
end
%-------------------------------------------------------------------------
%---------- make at 17-Jul-07 10:16:59.44
function rPMinExtrapol= rPMinExtrapol_s(rPM, rPm, quntL)
%rPMinExtrapol_s V1.00
% build 2007407001
% Time-mirrored down extrema (Parabolic Mins) extrapolation
%Init ------------------------------------
rPM= sortrows(rPM); %assumes nothing on rPM sort order
rPm= sortrows(rPm); %assumes nothing on rPm sort order
kTopTim1= rPM(:,1); kTopVal= rPM(:,2);
kDwnTim1= rPm(:,1); kDwnVal= rPm(:,2);
%Start extrapolation ---------------------
if ( (kTopTim1(1)== 1) && (kDwnTim1(1)== 1) )
disp ('rPMinExtrapol_s: Poliextrema at signal''s start');
elseif ( (kTopTim1(1)<1) || (kDwnTim1(1)< 1) )
disp ('rPMinExtrapol_s: Invalid extrema at signal''s start');
else
kDwnTim1=[2-kTopTim1(1); kDwnTim1]; % New first Dwn at the (one based) specular Max
kDwnVal=[kDwnVal(1); kDwnVal]; % Same Val as old first Dwn
end
% End extrapolation -----------------------
if ( (kTopTim1(end)== quntL) && (kDwnTim1(end)== quntL) )
disp ('rPMinExtrapol_s: Poliextrema at signal''s end');
elseif ( (kTopTim1(end)> quntL) || (kDwnTim1(end)> quntL) )
disp ('rPMinExtrapol_s: Invalid extrema at signal''s end');
else
kDwnTim1=[kDwnTim1; (2*quntL - kTopTim1(end))]; % New last Dwn at the specular Max
kDwnVal=[ kDwnVal; kDwnVal(end)]; % Same Val as old last Dwn
end
% return value ------------------------
rPMinExtrapol= sortrows([kDwnTim1, kDwnVal]);
end
%-------------------------------------------------------------------------
%---------- make at 17-Jul-07 10:16:59.44
function rPMax= rGetPMaxs_s(aS) %Get Parabolic Maxs, plateaus out
% build 20070612001
kS= aS(:);
quntLenS=length(kS);
quntMaxCnt=0;
kSMNdx1= []; kSMVal=[]; %signal S Maxima indices and values
kSPMTim1= []; kSPMVal=[]; %signal S Parabolic Maxima times and values
if (quntLenS>2) %if signal has enough length
for Cnt=2:(quntLenS-1) %search the Maxs
if ( ((kS(Cnt) > kS(Cnt+1))) && ((kS(Cnt) >= kS(Cnt-1))) || ((kS(Cnt) >= kS(Cnt+1))) && ((kS(Cnt) > kS(Cnt-1))) )
quntMaxCnt=quntMaxCnt+1;
kSMNdx1= [kSMNdx1; Cnt]; kSMVal=[kSMVal; kS(Cnt)];
end
end
end
% Now we have the Maxs, lets get the Parabolic Maxs
oldxv= -Inf; oldyv= -Inf;
intGapMax= max(kS)-min(kS);
for jj=1:quntMaxCnt %for all Maxs
%xa= -1; xb= 0; xc= 1;
ya= kS(kSMNdx1(jj)-1); % Sample point before
yb= kS(kSMNdx1(jj)); % Sample point, == kSMVal(jj)
yc= kS(kSMNdx1(jj)+1); % Sample point after
D= (-4*yb+2*ya+2*yc);
if (D==0), xv= kSMNdx1(jj);
else xv= kSMNdx1(jj)+(ya-yc)/D; end; % Vertix abscissa
D= (-16*yb+ 8*ya+ 8*yc);
if (D==0), yv= yb;
else yv= yb+ (2*yc*ya- ya*ya- yc*yc)/D; end;
% Lets check for double maxima
if ( (xv==oldxv)||(abs(yv-oldyv)/abs(xv-oldxv))> (2*intGapMax) )
xv= (xv+ oldxv)/2; yv= max(yv,oldyv); %Double found
kSPMTim1(length(kSPMTim1))= xv; kSPMVal(length(kSPMVal))= yv;
else
kSPMTim1= [kSPMTim1; xv]; kSPMVal=[kSPMVal; yv];
end
oldxv= xv; oldyv= yv;
end % for jj=1:quntMaxCnt
if quntMaxCnt>0
if ( kS(1) >= kSPMVal(1) )
kSPMTim1= [1; kSPMTim1]; kSPMVal=[kS(1); kSPMVal ]; %Start must be included as a Max
end
if ( kS(end) >= kSPMVal(end))
kSPMTim1= [kSPMTim1; quntLenS]; kSPMVal=[kSPMVal; kS(end)]; %End must be included as a Max
end
end
if quntMaxCnt==0
if ( kS(1) > kS(2) )
kSPMTim1= [1; kSPMTim1]; kSPMVal=[kS(1); kSPMVal ]; %Start must be included as a Max
end
if ( kS(end) > kS(end-1))
kSPMTim1= [kSPMTim1; quntLenS]; kSPMVal=[kSPMVal; kS(end)]; %End must be included as a Max
end
end
if quntMaxCnt<0
error('rGetPMaxs_s: Invalid MaxCnt value');
end
rPMax= sortrows([kSPMTim1, kSPMVal]);
end
%---------- make at 17-Jul-07 10:16:59.44
function rPMin= rGetPMins_s(aS) %Get Parabolic Mins, plateaus out
% build 20070612001
kS= aS(:);
quntLenS=length(kS);
quntMinCnt=0;
kSMNdx1= []; kSMVal=[]; %signal S Minima indices and values
kSPMTim1= []; kSPMVal=[]; %signal S Parabolic Minima times and values
if (quntLenS>2) %if signal has enough length
for Cnt=2:(quntLenS-1) %search the Mins
if ( ((kS(Cnt) < kS(Cnt+1))) && ((kS(Cnt) <= kS(Cnt-1))) || ((kS(Cnt) <= kS(Cnt+1))) && ((kS(Cnt) < kS(Cnt-1))) )
quntMinCnt=quntMinCnt+1;
kSMNdx1= [kSMNdx1; Cnt]; kSMVal=[kSMVal; kS(Cnt)];
end
end
end
% Now we have the Mins, lets get the Parabolic Mins
oldxv= -Inf; oldyv= -Inf;
intGapMax= max(kS)-min(kS);
for jj=1:quntMinCnt %for all Mins
%xa= -1; xb= 0; xc= 1;
ya= kS(kSMNdx1(jj)-1); % Sample point before
yb= kS(kSMNdx1(jj)); % Sample point, == kSMVal(jj)
yc= kS(kSMNdx1(jj)+1); % Sample point after
D= (-4*yb+2*ya+2*yc);
if (D==0), xv= kSMNdx1(jj);
else xv= kSMNdx1(jj)+(ya-yc)/D; end; % Vertix abscissa
D= (-16*yb+ 8*ya+ 8*yc);
if (D==0), yv= yb;
else yv= yb+ (2*yc*ya- ya*ya- yc*yc)/D; end;
% Lets check for double minima
if ( (xv==oldxv)||(abs(yv-oldyv)/abs(xv-oldxv))> (2*intGapMax) )
xv= (xv+ oldxv)/2; yv= min(yv,oldyv); %Double found
kSPMTim1(length(kSPMTim1))= xv; kSPMVal(length(kSPMVal))= yv;
else
kSPMTim1= [kSPMTim1; xv]; kSPMVal=[kSPMVal; yv];
end
oldxv= xv; oldyv= yv;
end % for jj=1:quntMinCnt
if quntMinCnt>0
if ( kS(1) <= kSPMVal(1) )
kSPMTim1= [1; kSPMTim1]; kSPMVal=[kS(1); kSPMVal ]; %Start must be included as a Min
end
if ( kS(end) <= kSPMVal(end))
kSPMTim1= [kSPMTim1; quntLenS]; kSPMVal=[kSPMVal; kS(end)]; %End must be included as a Min
end
end
if quntMinCnt==0
if ( kS(1) < kS(2) )
kSPMTim1= [1; kSPMTim1]; kSPMVal=[kS(1); kSPMVal]; %Start must be included as a Min
end
if ( kS(end) < kS(end-1))
kSPMTim1= [kSPMTim1; quntLenS]; kSPMVal=[kSPMVal; kS(end)]; %End must be included as a Min
end
end
if quntMinCnt<0
error('rGetPMins_s: Invalid MinCnt value');
end
rPMin= sortrows([kSPMTim1, kSPMVal]);
end
%---------- make at 17-Jul-07 10:16:59.44

48
Code/test_OOP.m

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
% Test Script
% TO DO LIST:
% - Display phases
% - Heart beat reconstruction with steady respiratory phase
% - Multislice analysis
% - Error messages and robustness of the methods
clear classes
phase = Phase; % creates a Phase object
phase.GetData; % extracts data
% Should become a set method
% User sets the workload, important to choose the correct IMF
list = {'Rest','Exercise','Continuous Acquisition'};
[indx,tf] = listdlg('ListString',list);
str = list{indx};
phase.WorkLoad = str;
phase.GetSignal % gets mean intensity level of the images
phase.GetEMD % decompose the siganl using EMD
phase.GetPhase % turn the modes into phase information
cardiac_phase = CardiacPhase(phase) % creates a CradiacPhase object
cardiac_phase.SelectPhase % choose the right imf besed on the work load
cardiac_phase.Diastole % detects diastolic events
cardiac_phase.Systole % detects systolic events
respiratory_phase = RespiratoryPhase(phase) % creates a RespiratoryPhase object
respiratory_phase.SelectPhase % choose the right imf besed on the work load
respiratory_phase.Expiration % detects expirtion moments
respiratory_phase.Inspiration % detects inspiration moments
SI = intersect(cardiac_phase.SystolePositions,respiratory_phase.InspirationPositions); % systole in inspiration
SE = intersect(cardiac_phase.SystolePositions,respiratory_phase.ExpirationPositions); % systole in expiration
DI = intersect(cardiac_phase.DiastolePositions,respiratory_phase.InspirationPositions); % diastole in inspiration
DE = intersect(cardiac_phase.DiastolePositions,respiratory_phase.ExpirationPositions); % diastole in expiration
% Show frames of the different cardiac/respiratory events
phase.ShowFrames(SI,'End-systolic frames in inpiration');
phase.ShowFrames(SE,'End-systolic frames in expiration');
phase.ShowFrames(DI,'End-diastolic frames in inpiration');
phase.ShowFrames(DE,'End-diastolic frames in expiration');
% c = ImageSequence
% c.ToBeSetByUser=15
% c.ToBeSetByUser=true

360
Git/LICENSE.txt

@ -0,0 +1,360 @@ @@ -0,0 +1,360 @@
Note that the only valid version of the GPL as far as this project
is concerned is _this_ particular version of the license (ie v2, not
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
HOWEVER, in order to allow a migration to GPLv3 if that seems like
a good idea, I also ask that people involved with the project make
their preferences known. In particular, if you trust me to make that
decision, you might note so in your copyright message, ie something
like
This file is licensed under the GPL v2, or a later version
at the discretion of Linus.
might avoid issues. But we can also just decide to synchronize and
contact all copyright holders on record if/when the occasion arises.
Linus Torvalds
----------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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.

2396
Git/ReleaseNotes.html

File diff suppressed because it is too large Load Diff

BIN
Git/bin/bash.exe

Binary file not shown.

BIN
Git/bin/git.exe

Binary file not shown.

BIN
Git/bin/sh.exe

Binary file not shown.

BIN
Git/cmd/git-gui.exe

Binary file not shown.

BIN
Git/cmd/git-lfs.exe

Binary file not shown.

BIN
Git/cmd/git.exe

Binary file not shown.

BIN
Git/cmd/gitk.exe

Binary file not shown.

85
Git/cmd/start-ssh-agent.cmd

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
@REM Do not use "echo off" to not affect any child calls.
@REM Enable extensions, the `verify` call is a trick from the setlocal help
@VERIFY other 2>nul
@SETLOCAL EnableDelayedExpansion
@IF ERRORLEVEL 1 (
@ECHO Unable to enable extensions
@GOTO failure
)
@REM Start the ssh-agent if needed by git
@FOR %%i IN ("git.exe") DO @SET GIT=%%~$PATH:i
@IF EXIST "%GIT%" @(
@REM Get the ssh-agent executable
@FOR %%i IN ("ssh-agent.exe") DO @SET SSH_AGENT=%%~$PATH:i
@IF NOT EXIST "%SSH_AGENT%" @(
@FOR %%s IN ("%GIT%") DO @SET GIT_DIR=%%~dps
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_DIR=!GIT_DIR:~0,-1!
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_ROOT=%%~dps
@FOR %%s IN ("!GIT_ROOT!") DO @SET GIT_ROOT=!GIT_ROOT:~0,-1!
@FOR /D %%s in ("!GIT_ROOT!\usr\bin\ssh-agent.exe") DO @SET SSH_AGENT=%%~s
@IF NOT EXIST "!SSH_AGENT!" @GOTO ssh-agent-done
)
@REM Get the ssh-add executable
@FOR %%s IN ("!SSH_AGENT!") DO @SET BIN_DIR=%%~dps
@FOR %%s in ("!BIN_DIR!") DO @SET BIN_DIR=!BIN_DIR:~0,-1!
@FOR /D %%s in ("!BIN_DIR!\ssh-add.exe") DO @SET SSH_ADD=%%~s
@IF NOT EXIST "!SSH_ADD!" @GOTO ssh-agent-done
@REM Check if the agent is running
@FOR /f "tokens=1-2" %%a IN ('tasklist /fi "imagename eq ssh-agent.exe"') DO @(
@ECHO %%b | @FINDSTR /r /c:"[0-9][0-9]*" > NUL
@IF "!ERRORLEVEL!" == "0" @(
@SET SSH_AGENT_PID=%%b
) else @(
@REM Unset in the case a user kills the agent while a session is open
@REM needed to remove the old files and prevent a false message
@SET SSH_AGENT_PID=
)
)
@REM Connect up the current ssh-agent
@IF [!SSH_AGENT_PID!] == [] @(
@ECHO Removing old ssh-agent sockets
@FOR /d %%d IN (%TEMP%\ssh-??????*) DO @RMDIR /s /q %%d
) ELSE @(
@ECHO Found ssh-agent at !SSH_AGENT_PID!
@FOR /d %%d IN (%TEMP%\ssh-??????*) DO @(
@FOR %%f IN (%%d\agent.*) DO @(
@SET SSH_AUTH_SOCK=%%f
@SET SSH_AUTH_SOCK=!SSH_AUTH_SOCK:%TEMP%=/tmp!
@SET SSH_AUTH_SOCK=!SSH_AUTH_SOCK:\=/!
)
)
@IF NOT [!SSH_AUTH_SOCK!] == [] @(
@ECHO Found ssh-agent socket at !SSH_AUTH_SOCK!
) ELSE (
@ECHO Failed to find ssh-agent socket
@SET SSH_AGENT_PID=
)
)
@REM See if we have the key
@"!SSH_ADD!" -l 1>NUL 2>NUL
@SET result=!ERRORLEVEL!
@IF NOT !result! == 0 @(
@IF !result! == 2 @(
@ECHO | @SET /p=Starting ssh-agent:
@FOR /f "tokens=1-2 delims==;" %%a IN ('"!SSH_AGENT!"') DO @(
@IF NOT [%%b] == [] @SET %%a=%%b
)
@ECHO. done
)
@"!SSH_ADD!"
@ECHO.
)
)
:ssh-agent-done
:failure
@ENDLOCAL & @SET "SSH_AUTH_SOCK=%SSH_AUTH_SOCK%" ^
& @SET "SSH_AGENT_PID=%SSH_AGENT_PID%"
@ECHO %cmdcmdline% | @FINDSTR /l "\"\"" >NUL
@IF NOT ERRORLEVEL 1 @(
@CALL cmd %*
)

63
Git/cmd/start-ssh-pageant.cmd

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
@REM Do not use "echo off" to not affect any child calls.
@REM The goal of this script is to simplify launching `ssh-pageant` at
@REM logon, typically by dropping a shortcut into the Startup folder, so
@REM that Pageant (the PuTTY authentication agent) will always be
@REM accessible. No attempt is made to load SSH keys, since this is
@REM normally handled directly by Pageant, and no interactive shell
@REM will be launched.
@REM
@REM The `ssh-pageant` utility is launched with the `-r` (reuse socket)
@REM option, to ensure that only a single running incarnation (per user)
@REM will be required... instead of launching a separate process for
@REM every interactive Git Bash session. A side effect of this selection
@REM is that the SSH_AUTH_SOCK environment variable *must* be set prior
@REM to running this script, with the value specifying a unix-style socket
@REM path, and needs to be consistent for all git-related processes. The
@REM easiest way to do this is to set a persistent USER environment
@REM variable, which (under Windows 7) can be done via Control Panel
@REM under System / Advanced System Settings. A typical value would look
@REM similar to:
@REM
@REM SSH_AUTH_SOCK=/tmp/.ssh-pageant-USERNAME
@REM
@REM Enable extensions, the `verify` call is a trick from the setlocal help
@VERIFY other 2>nul
@SETLOCAL EnableDelayedExpansion
@IF ERRORLEVEL 1 (
@ECHO Unable to enable extensions
@GOTO failure
)
@REM Ensure that SSH_AUTH_SOCK is set
@if "x" == "x%SSH_AUTH_SOCK%" @(
@ECHO The SSH_AUTH_SOCK environment variable must be set prior to running this script. >&2
@ECHO This is typically configured as a persistent USER variable, using a MSYS2 path for >&2
@ECHO the ssh-pageant authentication socket as the value. Something similar to: >&2
@ECHO. >&2
@ECHO SSH_AUTH_SOCK=/tmp/.ssh-pageant-%USERNAME% >&2
@GOTO failure
)
@REM Start ssh-pageant if needed by git
@FOR %%i IN ("git.exe") DO @SET GIT=%%~$PATH:i
@IF EXIST "%GIT%" @(
@REM Get the ssh-pageant executable
@FOR %%i IN ("ssh-pageant.exe") DO @SET SSH_PAGEANT=%%~$PATH:i
@IF NOT EXIST "%SSH_PAGEANT%" @(
@FOR %%s IN ("%GIT%") DO @SET GIT_DIR=%%~dps
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_DIR=!GIT_DIR:~0,-1!
@FOR %%s IN ("!GIT_DIR!") DO @SET GIT_ROOT=%%~dps
@FOR %%s IN ("!GIT_ROOT!") DO @SET GIT_ROOT=!GIT_ROOT:~0,-1!
@FOR /D %%s in ("!GIT_ROOT!\usr\bin\ssh-pageant.exe") DO @SET SSH_PAGEANT=%%~s
@IF NOT EXIST "!SSH_PAGEANT!" @GOTO ssh-pageant-done
)
)
@REM Time to make the donuts!
@ECHO Starting ssh-pageant...
@FOR /f "usebackq tokens=1 delims=;" %%o in (`"%SSH_PAGEANT%" -qra %SSH_AUTH_SOCK%`) DO @ECHO %%o
:ssh-pageant-done
:failure

BIN
Git/dev/fd

Binary file not shown.

BIN
Git/dev/stderr

Binary file not shown.

BIN
Git/dev/stdin

Binary file not shown.

BIN
Git/dev/stdout

Binary file not shown.

204
Git/etc/DIR_COLORS

@ -0,0 +1,204 @@ @@ -0,0 +1,204 @@
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below are TERM entries, which can be a glob patterns, to match
# against the TERM environment variable to determine if it is colorizable.
TERM Eterm
TERM ansi
TERM *color*
TERM con[0-9]*x[0-9]*
TERM cons25
TERM console
TERM cygwin
TERM dtterm
TERM gnome
TERM hurd
TERM jfbterm
TERM konsole
TERM kterm
TERM linux
TERM linux-c
TERM mlterm
TERM putty
TERM rxvt*
TERM screen*
TERM st
TERM terminator
TERM tmux*
TERM vt100
TERM xterm*
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # regular file: use no color at all
RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...
MISSING 00 # ... and the files they point to
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
# Or if you want to colorize scripts even if they do not have the
# executable bit actually set.
#.sh 01;32
#.csh 01;32
# archives or compressed (bright red)
.tar 01;31
.tgz 01;31
.arc 01;31
.arj 01;31
.taz 01;31
.lha 01;31
.lz4 01;31
.lzh 01;31
.lzma 01;31
.tlz 01;31
.txz 01;31
.tzo 01;31
.t7z 01;31
.zip 01;31
.z 01;31
.dz 01;31
.gz 01;31
.lrz 01;31
.lz 01;31
.lzo 01;31
.xz 01;31
.zst 01;31
.tzst 01;31
.bz2 01;31
.bz 01;31
.tbz 01;31
.tbz2 01;31
.tz 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
.war 01;31
.ear 01;31
.sar 01;31
.rar 01;31
.alz 01;31
.ace 01;31
.zoo 01;31
.cpio 01;31
.7z 01;31
.rz 01;31
.cab 01;31
.wim 01;31
.swm 01;31
.dwm 01;31
.esd 01;31
# image formats
.jpg 01;35
.jpeg 01;35
.mjpg 01;35
.mjpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.svg 01;35
.svgz 01;35
.mng 01;35
.pcx 01;35
.mov 01;35
.mpg 01;35
.mpeg 01;35
.m2v 01;35
.mkv 01;35
.webm 01;35
.ogm 01;35
.mp4 01;35
.m4v 01;35
.mp4v 01;35
.vob 01;35
.qt 01;35
.nuv 01;35
.wmv 01;35
.asf 01;35
.rm 01;35
.rmvb 01;35
.flc 01;35
.avi 01;35
.fli 01;35
.flv 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
.yuv 01;35
.cgm 01;35
.emf 01;35
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
.ogv 01;35
.ogx 01;35
# audio formats
.aac 00;36
.au 00;36
.flac 00;36
.m4a 00;36
.mid 00;36
.midi 00;36
.mka 00;36
.mp3 00;36
.mpc 00;36
.ogg 00;36
.ra 00;36
.wav 00;36
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
.oga 00;36
.opus 00;36
.spx 00;36
.xspf 00;36

15
Git/etc/bash.bash_logout

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# /etc/bash.bash_logout: executed by bash(1) when login shell exits.
# System-wide bashrc file
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear ] && /usr/bin/clear
fi

65
Git/etc/bash.bashrc

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# /etc/bash.bashrc: executed by bash(1) for interactive shells.
# System-wide bashrc file
# Check that we haven't already been sourced.
([[ -z ${CYG_SYS_BASHRC} ]] && CYG_SYS_BASHRC="1") || return
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return
# If started from sshd, make sure profile is sourced
if [[ -n "$SSH_CONNECTION" ]] && [[ "$PATH" != *:/usr/bin* ]]; then
source /etc/profile
fi
# Warnings
unset _warning_found
for _warning_prefix in '' ${MINGW_PREFIX}; do
for _warning_file in ${_warning_prefix}/etc/profile.d/*.warning{.once,}; do
test -f "${_warning_file}" || continue
_warning="$(command sed 's/^/\t\t/' "${_warning_file}" 2>/dev/null)"
if test -n "${_warning}"; then
if test -z "${_warning_found}"; then
_warning_found='true'
echo
fi
if test -t 1
then printf "\t\e[1;33mwarning:\e[0m\n${_warning}\n\n"
else printf "\twarning:\n${_warning}\n\n"
fi
fi
[[ "${_warning_file}" = *.once ]] && rm -f "${_warning_file}"
done
done
unset _warning_found
unset _warning_prefix
unset _warning_file
unset _warning
# If MSYS2_PS1 is set, use that as default PS1;
# if a PS1 is already set and exported, use that;
# otherwise set a default prompt
# of user@host, MSYSTEM variable, and current_directory
[[ -n "${MSYS2_PS1}" ]] && export PS1="${MSYS2_PS1}"
# if we have the "High Mandatory Level" group, it means we're elevated
#if [[ -n "$(command -v getent)" ]] && id -G | grep -q "$(getent -w group 'S-1-16-12288' | cut -d: -f2)"
# then _ps1_symbol='\[\e[1m\]#\[\e[0m\]'
# else _ps1_symbol='\$'
#fi
[[ $(declare -p PS1 2>/dev/null | cut -c 1-11) = 'declare -x ' ]] || \
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n'"${_ps1_symbol}"' '
unset _ps1_symbol
# Uncomment to use the terminal colours set in DIR_COLORS
# eval "$(dircolors -b /etc/DIR_COLORS)"
# Fixup git-bash in non login env
shopt -q login_shell || . /etc/profile.d/git-prompt.sh

70
Git/etc/docx2txt.config

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
# # User controllable configuration parameters for docx2txt.pl
#
# Note:
# - Ensure that all configuration lines end with single comma (,).