-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More fixes for loading and detecting filter matrices when deployed as…
… toolbox or app
- Loading branch information
1 parent
4c6454a
commit d25de5f
Showing
2 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
function FetchFilterMatrices() | ||
|
||
%Jassal, G., & Schmidt, B. E. (2024, August 12). wOFV Filter Matrices. https://doi.org/10.17605/OSF.IO/Y48MK | ||
|
||
gui.update_progress(0) | ||
uiwait(warndlg(['Wavelet filter matrices do not exist. They are downloaded and stored for later use now.' newline newline 'Please watch the command window for progress messages.'],'No filter matrices found','modal')); | ||
gui.toolsavailable(1) | ||
gui.toolsavailable(0,'Downloading filter matrices...');drawnow | ||
FileUrl = 'https://files.osf.io/v1/resources/y48mk/providers/osfstorage/?zip='; | ||
FileName = 'Filter Matrices.zip'; | ||
disp('Downloading Filter Matrices.') | ||
disp('This might take a while...') | ||
websave(FileName,FileUrl); | ||
gui.toolsavailable(1) | ||
gui.toolsavailable(0,'Unzipping filter matrices...');drawnow | ||
disp('Filter Matrices downloaded, unzipping...') | ||
[filepath,~,~]= fileparts(which('PIVlab_GUI.m')); | ||
unzip(FileName,fullfile(filepath,'+wOFV','Filter matrices')) | ||
disp('Filter Matrices stored.') | ||
delete(FileName) | ||
gui.toolsavailable(1) | ||
gui.toolsavailable(0,'Busy, please wait...');drawnow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
function Fmats = getFmatPyramid(M,PyramidLevels) | ||
|
||
%check if the filter matrix exists, if it doesn't generate them | ||
if ~exist(['+wOFV/Filter Matrices/bior6.8/' num2str(M) '/Fmats.mat'],'file') | ||
uiwait(warndlg(['Wavelet filter matrices do not exist. They are downloaded and stored for later use now.' newline newline 'Please watch the command window for progress messages.'],'No filter matrices found','modal')); | ||
|
||
[filepath,~,~]= fileparts(which('PIVlab_GUI.m')); | ||
if ~exist(fullfile(filepath,'+wOFV','Filter matrices','bior6.8',num2str(M) ,'Fmats.mat'),'file') | ||
wOFV.FetchFilterMatrices(); | ||
end | ||
|
||
load(['+wOFV/Filter Matrices/bior6.8/' num2str(M) '/Fmats.mat'],'Fw','FwInv','N0','N1','N2','N3','N4'); | ||
load(fullfile(filepath,'+wOFV','Filter matrices','bior6.8',num2str(M) ,'Fmats.mat'),'Fw','FwInv','N0','N1','N2','N3','N4'); | ||
Fmats.FmatPy{1} = cat(3,Fw,FwInv); | ||
Fmats.NiPy{1} = cat(3,N0,N1,N2,N3,N4); | ||
|
||
load(['+wOFV/FD Matrices/' num2str(M) '/Dmat.mat'],'Dmat'); | ||
load(fullfile(filepath,'+wOFV','FD matrices',num2str(M),'Dmat.mat'),'Dmat'); | ||
Fmats.DmatPy{1} = Dmat; | ||
|
||
for iii = 1:(PyramidLevels-1) | ||
load(['+wOFV/Filter Matrices/bior6.8/' num2str(2^(log2(M)-iii)) '/Fmats.mat'],'Fw','FwInv','N0','N1','N2','N3','N4') | ||
load(fullfile(filepath,'+wOFV','Filter matrices','bior6.8',num2str(2^(log2(M)-iii)),'Fmats.mat'),'Fw','FwInv','N0','N1','N2','N3','N4') | ||
Fmats.FmatPy{iii+1} = cat(3,Fw,FwInv); | ||
Fmats.NiPy{iii+1} = cat(3,N0,N1,N2,N3,N4); | ||
end | ||
|
||
|
||
for iii = 1:(PyramidLevels-1) | ||
load(['+wOFV/FD Matrices/' num2str(2^(log2(M)-iii)) '/Dmat.mat'],'Dmat') | ||
load(fullfile(filepath,'+wOFV','FD matrices',num2str(2^(log2(M)-iii)),'Dmat.mat'),'Dmat') | ||
Fmats.DmatPy{iii+1} = Dmat; | ||
end |