Skip to content

Commit

Permalink
Function updates and URLs for all major external programs.
Browse files Browse the repository at this point in the history
- `loadBatchFxns` -  Update `_external_programs` to call ciapkg.getDirExternalPrograms() to standardize call across all functions. Do not add docs and data folders or sub-folders to the path. Update to fullfile call using filesep to make platform neutral.
- `@ciatah\viewMatchObjBtwnSessions` - Convert all suptitle to ciapkg.overloaded.suptitle.
- Updated `README` in external programs to contain URLs for major programs.
  • Loading branch information
bahanonu committed Aug 24, 2021
1 parent 728fea2 commit c7b6978
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
17 changes: 13 additions & 4 deletions +ciapkg/loadBatchFxns.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ function loadBatchFxns(varargin)
% 2020.05.09 [16:40:13] - Updates to remove additional specific repositories that should not be loaded by default. Add support for overriding this feature.
% 2020.06.05 [23:35:43] - If user doesn't have Parallel Toolbox, still works
% 2020.07.21 [14:11:42] - Fix to make sure all sub-folders (not just the root) are also removed in the case of certain external_programs.
% 2021.02.01 [‎15:19:40] - Update `_external_programs` to call ciapkg.getDirExternalPrograms() to standardize call across all functions.
% 2021.02.01 [??‎15:19:40] - Update `_external_programs` to call ciapkg.getDirExternalPrograms() to standardize call across all functions.
% 2021.06.20 [00:22:38] - Added manageMiji('startStop','closeAllWindows'); support.
% 2021.07.16 [13:38:55] - Remove redundant loading and unloading of external programs via additional checks.
% 2021.07.22 [19:51:50] - Moved loadBatchFxns into ciapkg package. Use ciapkg.getDir to get directory as standard IO.
% 2021.08.09 [12:06:32] - Do not add docs and data folders or sub-folders to the path.
% 2021.08.24 [13:46:13] - Update to fullfile call using filesep to make platform neutral.
% TODO
%

% Disable the handle graphics warning "The DrawMode property will be removed in a future release. Use the SortMethod property instead." from being displayed. Comment out this line for debugging purposes as needed.
warning('off','MATLAB:hg:WillBeRemovedReplaceWith')

Expand Down Expand Up @@ -78,6 +80,13 @@ function loadBatchFxns(varargin)
[pathListArray] = subfxnRemoveDirs(0,pathListArray);
end

% Remove 'docs' and 'data', don't need to be in the path.
matchIdxD = contains(pathListArray,[functionDir filesep 'docs']);
pathListArray = pathListArray(~matchIdxD);

matchIdxD = contains(pathListArray,[functionDir filesep 'data']);
pathListArray = pathListArray(~matchIdxD);

skipRemovePath = 0;
if isempty(pathListArray)
fprintf('MATALB path already has all needed non-private folders under: %s\n',functionDir);
Expand Down Expand Up @@ -112,7 +121,7 @@ function loadBatchFxns(varargin)
elseif ispc
baseInscopixPath = 'C:\Program Files\Inscopix\Data Processing';
else
disp('Platform not supported')
disp('Platform not supported for Inscopix Data Processing Software.')
end

pathFilter = ismember(baseInscopixPath,strsplit(path,pathsep));
Expand Down Expand Up @@ -234,7 +243,7 @@ function loadBatchFxns(varargin)
return;
end
extDir = extDir(3:end);
foundFiles = dir(fullfile([externalProgramsDir], ['**\' thisFxn '']));
foundFiles = dir(fullfile([externalProgramsDir], ['**' filesep thisFxn '']));
if isempty(foundFiles)
pathToRm = [];
else
Expand Down
25 changes: 14 additions & 11 deletions @ciatah/viewMatchObjBtwnSessions.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
% 2019.04.23 [19:53:21] - a couple Windows specific path separators, switch to filesep
% 2019.07.03 [16:35:10] - Updated to allow GUI-less option so computeMatchObjBtwnTrials can run after cross-session alignment.
% 2020.12.08 [00:53:20] - Take out parfor in one loop that calls obj functions to eliminate serialization issues. Also change color mapping of cross session maps so that it covers the full range using the actual global IDs matched across sessions rather than diluting the range by including global IDs that don't meet the criteria. Makes the maps more colorful.
% 2021.08.24 [14:10:02] - Convert all suptitle to ciapkg.overloaded.suptitle.
% TODO
%

Expand All @@ -35,6 +36,7 @@
options.runGui = 1;
options.cellmapZoomPx = 10;
options.maxDistAccept = 10;
options.showFigures = 1;
% get options
options = getOptions(options,varargin);
% display(options)
Expand Down Expand Up @@ -82,6 +84,14 @@
pctSessionMatchChoices = [1 2 3];
end

if options.showFigures==1
for figNoFake = [342 343 344 9019 59857 65 66 42 1110+[0:6] 1 2 3]
[~, ~] = openFigure(figNoFake, '');
% clf
end
drawnow
end


nFiles = length(obj.rawSignals);
[fileIdxArray idNumIdxArray nFilesToAnalyze nFiles] = obj.getAnalysisSubsetsToAnalyze();
Expand Down Expand Up @@ -268,6 +278,7 @@
end
% disp([globalNo sessionIdx nMatchGlobalIDs(globalNo)>=2 NaN size(globalIDsImageList) NaN size(tmpSessionImgs)])
if sessionIdx~=0&nMatchGlobalIDs(globalNo)>=2
% [sessionIdx size(tmpSessionImgs)]
tmpImg = tmpSessionImgs(:,:,sessionIdx);
globalIDsImageList{globalNo} = cat(3,globalIDsImageList{globalNo},tmpImg);
% globalToSessionIDs{sessionNo}(sessionIdx) = globalNo;
Expand Down Expand Up @@ -454,7 +465,7 @@
end
drawnow
openFigure(1112);
suptitle('Errors in cell alignment to "global" match cell centroid')
ciapkg.overloaded.suptitle('Errors in cell alignment to "global" match cell centroid')
subplot(1,2,1)
xlabel('X (px)')
ylabel('Y (px)')
Expand All @@ -466,24 +477,16 @@
title('Heat plot')
axis equal tight
openFigure(1110);
suptitle('Overlap of matched cells detected across at least (nSessions-1) sessions')
ciapkg.overloaded.suptitle('Overlap of matched cells detected across at least (nSessions-1) sessions')
openFigure(1114);
suptitle('Example cells matched across sessions')
ciapkg.overloaded.suptitle('Example cells matched across sessions')

newSubjStr = sprintf('%s_%d',thisSubjectStr,options.alignmentSetNum);
obj.globalIDs.matchCoords.(newSubjStr) = allCentroids;
obj.globalIDs.distances.(newSubjStr) = allDistances;
% return;
% pause

try
figure;
imagesc(nanmean(cat(3,obj_p435_p700.detailStats.outputCutMovie{:}),3));
colorbar;
axis equal tight;
title('m597 aligned sessions match cells');
catch
end
try
obj.detailStats.matchedGlobalCellsOverlap{subjectNo} = outputCutMovie;
catch
Expand Down
27 changes: 15 additions & 12 deletions _external_programs/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# External software packages

The folder `_external_programs` is for external software packages used by `calciumImagingAnalysis`.
The folder `_external_programs` is for external software packages or algorithms used by `CIAtah`. These are automatically downloaded when running `obj.setup;` after creating a `CIAtah` object by calling `obj = CIAtah;` or directly by running `ciapkg.io.loadDependencies();`.

The following are likely to be found here:
The following programs will be found in this folder after downloading (e.g. after running `ciapkg.io.loadDependencies`):
- GUI and display
- `Fiji`
- `ImageJ/Fiji` - Miji to allow calling of ImageJ/Fiji, only download `mij.jar` and `ij.jar`. https://imagej.net/plugins/miji.
- Cell extraction
- `CELLMax`
- `CNMF`
- `CNMF-E`
- `CVX`
- `EXTRACT`
- `CELLMax` - Will be made public upon publication.
- `CNMF` - https://github.com/flatironinstitute/CaImAn-MATLAB.
- `CNMF-E` - https://github.com/zhoupc/CNMF_E.
- `CVX` - http://cvxr.com/cvx/download/ (e.g. http://web.cvxr.com/cvx/cvx-rd.zip).
- `EXTRACT` - https://github.com/schnitzer-lab/EXTRACT-public.
- NWB
- `nwb_schnitzer_lab`
- `yamlmatlab`
- `matnwb`
- `nwb_schnitzer_lab` - https://github.com/schnitzer-lab/nwb_schnitzer_lab.
- `yamlmatlab` - https://github.com/ewiger/yamlmatlab.
- `matnwb` - https://github.com/NeurodataWithoutBorders/matnwb.
- File I/O
- `Bio-Formats` - MATLAB version at https://www.openmicroscopy.org/bio-formats/downloads/.
- Motion correction
- `NoRMCorre`
- `Turboreg` - C and MEX function implementation of http://bigwww.epfl.ch/thevenaz/turboreg/.
- `NoRMCorre` - https://github.com/flatironinstitute/NoRMCorre.

0 comments on commit c7b6978

Please sign in to comment.