Skip to content

Commit

Permalink
Merge pull request #78 from bahanonu/bahanonu/functionUpdates
Browse files Browse the repository at this point in the history
GUI updates, fast thresholding, and misc updates.
  • Loading branch information
bahanonu authored Jul 7, 2021
2 parents ad54a45 + 287054b commit d7207c1
Show file tree
Hide file tree
Showing 19 changed files with 636 additions and 235 deletions.
11 changes: 10 additions & 1 deletion +ciapkg/+io/readFrame.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function [thisFrame,movieFileID,inputMovieDims] = readFrame(inputMoviePath,frameNo,varargin)
% Fast reading of frame from files on disk. This is an alternative to loadMovieList that is much faster when only a single frame needs to be read.
% Biafra Ahanonu
% started: 2020.10.19 [�‎11:45:24]
% started: 2020.10.19 [11:45:24]
% inputs
% inputMoviePath | Str: path to a movie. Supports TIFF, AVI, HDF5, NWB, or Inscopix ISXD.
% frameNo | Int: frame number.
Expand All @@ -15,6 +15,7 @@

% changelog
% 2021.06.30 [01:26:29] - Updated handling of no file path character input.
% 2021.07.03 [09:02:14] - Updated to have backup read method for different tiff styles.
% TODO
%

Expand Down Expand Up @@ -101,6 +102,14 @@
tiffID.setDirectory(frameNo);
thisFrame = read(tiffID);
catch
try
% thisFrame = imread(inputMoviePathHere, 'tif', 'Index', frameNo, 'Info', imgInfo);
thisFrame = imread(inputMoviePathHere, 'tif', 'Index', frameNo);
catch err
disp(repmat('@',1,7))
disp(getReport(err,'extended','hyperlinks','on'));
disp(repmat('@',1,7))
end
% err
% display(repmat('@',1,7))
% disp(getReport(err,'extended','hyperlinks','on'));
Expand Down
22 changes: 17 additions & 5 deletions +ciapkg/+io/updatePkg.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
function [success] = updatePkg(varargin)
% Checks ciapkg version against GitHub repo and updates `ciapkg` and `+ciapkg` folders.
% Biafra Ahanonu
% started: 2020.08.18 [11:16:56]
% started: 2020.08.18 [11:16:56]
% inputs
%
% outputs
%
% Notes
% Follows https://semver.org convention.

% changelog
% 2021.03.09 [21:34:52] - Option on whether to update package (only 0 for now). Also alert user if behind a version.
% 2021.06.21 [16:18:07] - Updated to ciatah from calciumImagingAnalysis URLs.
% 2021.07.06 [11:33:22] - Updated comparison to ensure ignoring of lower level versions after higher level versions are found to differ.
% TODO
% Only check once every couple of days to warn user instead of every time.

Expand Down Expand Up @@ -41,10 +44,11 @@
try
success = 0;

% Versions follow MAJOR.MINOR.PATCH convention.
% Get online CIAPKG version
[onlineVersion onlineDateTimeStr] = ciapkg.versionOnline;
[onlineVersion, onlineDateTimeStr] = ciapkg.versionOnline;
% Get local CIAPKG version
[currentVersion currentDateTimeStr] = ciapkg.version;
[currentVersion, currentDateTimeStr] = ciapkg.version;
% currentVersion = 'v3.19.20201021135616'
% currentVersion = 'v3.20.20201019131033';

Expand All @@ -71,7 +75,8 @@
else
onlineVersionTmp = onlineVersion;
end
verInfoStr = sprintf('%s\n Local version: %s.\n Online version %s.\n',verInfoStr2,currentVersion,onlineVersionTmp);
% verInfoStr = sprintf('%s\n Local version: %s.\n Online version %s.\n',verInfoStr2,currentVersion,onlineVersionTmp);
verInfoStr = sprintf('%s\n Local version: %s (%s).\n Online version %s (%s).\n',verInfoStr2,currentVersion,currentDateTimeStr,onlineVersionTmp,onlineDateTimeStr);
warning(verInfoStr)
if verCompare<1
msgbox(verInfoStr,'Note on CIAtah version.')
Expand Down Expand Up @@ -129,13 +134,20 @@
compareVector = zeros([1 max(length(verId1),length(verId2))]);
nLevels = length(compareVector);

% Following MAJOR.MINOR.PATCH convention
% Start at the highest level and only continue comparing while version 2 is greater than or equal to version 1.
lockOut = 0; % 1 = higher level is an old version, so only calculate version difference
for verLvl = 1:nLevels
compareVector(verLvl) = verId1(verLvl) - verId2(verLvl);
if compareVector(verLvl)<0 & lockOut==0 % This level indicates an old version
% If higher version is older or newer, lower version is irrelevant so skip.
if lockOut==1
compareVector(verLvl) = 0;
end
if compareVector(verLvl)<0 && lockOut==0 % This level indicates an old version
verCompare = 0;
lockOut = 1;
elseif compareVector(verLvl)>0 && lockOut==0 % This level indicates this level is a newer version
lockOut = 1;
end
end

Expand Down
4 changes: 2 additions & 2 deletions +ciapkg/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v3.31.3
2021.06.30 [11:14:59]
v3.32.1
2021.07.06 [11:59:08]
3 changes: 3 additions & 0 deletions +ciapkg/version.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
% 2021.01.21 [10:36:30] - Changed to use readtable instead of readcell to increase compatability across MATLAB versions.
% 2021.01.21 [17:03:54] - Added fscanf backup to readtable in case of Matlab compatibility issues, also specified more readtable defaults to avoid errors (Matlab 202a+ changed default behavior). Added last step backup of zero version.
% 2021.03.21 [17:41:54] - Update VERSION path.
% 2021.07.06 [11:33:22] - Updated to trim version string to make sure new line is removed.
% TODO
%

Expand Down Expand Up @@ -46,7 +47,9 @@
fclose(fileID);
verStr = strsplit(verStr,'\n');
versionStr = strrep(verStr{1},'\n','');
versionStr = strtrim(versionStr);
dateTimeStr = verStr{2};
dateTimeStr = strrep(dateTimeStr,'\n','');
catch err
versionStr = 'v0.00.0';
dateTimeStr = '00000000000000';
Expand Down
4 changes: 2 additions & 2 deletions @ciatah/ciatah.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
% FPS of movie(s) being analyzed
FRAMES_PER_SECOND = 5;
% FPS of movie playback
FRAMES_PER_SECOND_PLAYBACK = 5;
FRAMES_PER_SECOND_PLAYBACK = 20;
% Int: what factor temporally are analyzed movie from raw data
DOWNSAMPLE_FACTOR = 4;
% Float: estimated um per pixel
Expand Down Expand Up @@ -74,7 +74,7 @@
concurrentAnalysisFilename = '_currentlyAnalyzingFolderCheck.mat';

% Cell array strings: List of methods to fast track folder to analyze dialog or skip altogether
methodExcludeList = {'showVars','showFolders','setMainSettings','modelAddNewFolders','loadDependencies','saveObj','setStimulusSettings','modelDownsampleRawMovies','setMovieInfo','setup','update'};
methodExcludeList = {'showVars','showFolders','setMainSettings','loadDependencies','saveObj','setStimulusSettings','modelDownsampleRawMovies','setMovieInfo','setup','update'};
methodExcludeListVer2 = {'modelEditStimTable','behaviorProtocolLoad','modelPreprocessMovie','modelModifyMovies','removeConcurrentAnalysisFiles'};
methodExcludeListStimuli = {'modelVarsFromFiles'};

Expand Down
Loading

0 comments on commit d7207c1

Please sign in to comment.