Commit cf629265 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

Added vestibular chair setup

parent d46b61c5
No preview for this file type
function [pb_name]()
% [PB_NAME]()
%
% Creates a template function for PBToolbox.
%
% [PB_NAME]() ...
%
% See also ...
% PBToolbox ([YEAR]): JJH: j.heckman@donders.ru.nl
end
......
No preview for this file type
function pb_tdtglobals()
% PB_TDTGLOBALS()
%
% PB_TDTGLOBALS() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
function cfg = pb_fitmouse(cfg, varargin)
% PB_FITMOUSE()
%
% PB_FITMOUSE() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
function cfg = pb_fmice(cfg,varargin)
% PB_FMICE(BW)
%
% PB_FMICE(BW) recursively seeks for 'mice-blobs'. If number of 'mice' and
% 'blobs' match.., something happens
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
f = cfg.CurrentFrame;
bw = ~cfg.Frame(f).BW;
CC = bwconncomp(bw);
n = CC.NumObjects;
mice = pb_keyval('mice',varargin,n);
cfg.Frame(f).NumMice = mice;
cfg.Frame(f).CC = CC;
if n == mice
cfg.Frame(f).MiceBlobMatch = true;
for IdxMouse = 1:n
cfg.Frame(f).Mouse{IdxMouse} = CC.PixelIdxList{IdxMouse};
%cfg.Frame(f).Mouse{IdxMouse} = [];
end
return
end
cfg.Frame(f).MiceBlobMatch = false;
disp([newline 'Note that the number of indicated Mice (' num2str(mice) ') and found Blobs (' num2str(n) ') did not match!' newline]);
end
function D = rec_fun
% this function recursivly finds
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
......@@ -34,19 +34,20 @@ bwE = ~bwareaopen(~bwE,500);
% %plot
% subplot(211); imshow(bwM); title('Mice')
% subplot(212); imshow(bwE); title('Ears')
%
% %%
clf;
imshow(bwM);
CC = bwconncomp(~bwM)
CC = bwconncomp(~bwM);
cfg.CurrentFrame = fN;
cfg.Frame(fN).BW = bwE;
cfg = pb_fmice(cfg);
%% find difference between both
diff = bwM ~= bwE;
figure(1);
imshow(~diff)
pb_implot([240:490],'style','rx');
%% Edge
......
No preview for this file type
......@@ -16,7 +16,7 @@ function pb_writefun(path,fname)
return % safety measure
end
tpath = '/Users/jjheckman/Documents/Code/Matlab/PBToolbox/documentation/templates/';
tpath = '/Users/jjheckman/Documents/Code/Gitlab/pbtoolbox/documentation/templates/';
template = 'template_pbfun.txt';
tText = fileread([tpath template]);
......
......@@ -28,8 +28,12 @@ end
function [x,y] = i2xy(Idx,a)
% Converts array index to x and y coordinates.
y = mod((a.YLim(2)*a.XLim(2))-Idx,a.YLim(2))+1;
x = ceil(Idx/a.YLim(2));
l = length(Idx); x = ones(1,l); y = ones(1,l);
for i = 1:l
y(i) = mod((a.YLim(2)*a.XLim(2))-Idx(i),a.YLim(2))+1;
x(i) = ceil(Idx(i)/a.YLim(2));
end
x
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment