Skip to content

Commit

Permalink
Merge pull request #24 from gardner-lab/Liberti
Browse files Browse the repository at this point in the history
Liberti
  • Loading branch information
WALIII authored Jul 6, 2021
2 parents c99b765 + 435ffc6 commit d67dc4d
Show file tree
Hide file tree
Showing 17 changed files with 27,841 additions and 392 deletions.
38 changes: 19 additions & 19 deletions ActiveComm/Software/ActiveCommMk1/ActiveCommMk1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
// 01.13.15
// WALIII

// Hall sensor controlled actove commutator, driven by a servo motor
// Hall sensor controlled active commutator, driven by a servo motor
// Inspired by :
//
//
#include <Servo.h>

Servo myservo;

int pos = 90;
const int analogInPin = 8;
//
#include <Servo.h>

Servo myservo;

int pos = 90;
const int analogInPin = 8;
int sensorValue = 0; // value read from the pot
int setpoint = 510;

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(9600);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop() {
sensorValue = analogRead(analogInPin);
Serial.print("sensor = " );
Serial.println(sensorValue);



sensorValue = analogRead(analogInPin);

Serial.print("sensor = " );
Serial.println(sensorValue);


if(sensorValue> setpoint+10){
pos = pos+5;
myservo.write(pos);
Expand All @@ -48,5 +48,5 @@ pos = 90;
myservo.write(pos);
}

delay(20);
delay(20);
}
2 changes: 1 addition & 1 deletion ActiveComm/Software/ActiveCommMk2/ActiveCommMk2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// 01.13.15
// WALIII

// Hall sensor controlled actove commutator, driven by a servo motor
// Hall sensor controlled active commutator, driven by a servo motor
// Inspired
//
//
Expand Down
85 changes: 44 additions & 41 deletions Analysis Pipeline/FS_tiff.m
Original file line number Diff line number Diff line change
@@ -1,61 +1,66 @@

function FS_tiff(videodata,varargin)
% FS_tiff
% FS_tiff

% Create multipage Tiff stack from the .mov files form the FreedomScope
% Create multipage Tiff stack from the .mov files form the FreedomScope

% Created: 2016/02/12
% By: WALIII
% Updated: 2016/02/15
% By: WALIII
% Created: 2016/02/12
% By: WALIII
% Updated: 2016/02/15
% By: WALIII

% FS_BatchDff_TM will do several things:
%
% 1. Create a grayscale mtif, called 'G.tif'
% 2. Creates a RGB mtif, called 'RGB.tif'
%
%
% FS_BatchDff_TM will do several things:
%
% 1. Create a grayscale mtif, called 'G.tif'
% 2. Creates a RGB mtif, called 'RGB.tif'
%
%



filename = 'G';

filename = 'G';
format_switch = 1;
nparams=length(varargin);
nparams=length(varargin);

% if mod(nparams,2)>0
% error('Parameters must be specified as parameter/value pairs');
% end
for i=1:2:nparams
switch lower(varargin{i})
case 'colors'
colors=varargin{i+1};
switch lower(varargin{i})
case 'colors'
colors=varargin{i+1};

case 's_smooth'
a=varargin{i+1};
for i = 1: size(files,3)
for i = 1: size(files,3)
files(:,:,i) = wiener2(files(:,:,i),[a a]);
end

case 't_smooth'
b=varargin{i+1};
files = convn(files, single(reshape([1 1 1] / b, 1, 1, [])), 'same');
b=varargin{i+1};
files = convn(files, single(reshape([1 1 1] / b, 1, 1, [])), 'same');
case 'fname'
filename=varargin{i+1};
case 'format'
format_switch=varargin{i+1};
end

end

end


if format_switch == 1;
[files, n] = FS_Format(videodata,1);
else
try
[files, n] = FS_Format(videodata,1);
catch
disp('only one frame in this extraction');
files = videodata;
end
else
files = videodata;
end

% if rm_artifacts ==1;
%
%

% d = files2;
% files2 = ((d-min(d(:))) ./ (max(d(:)-min(d(:)))))*255;
Expand All @@ -71,7 +76,7 @@ function FS_tiff(videodata,varargin)

imwrite(uint8(files(:,:,1)),[filename,'.tif']);
if size(size(videodata),2) ==4
imwrite(uint8(videodata(:,:,:,1)),[filename,'_','RGB.tif']);
imwrite(uint8(videodata(:,:,:,1)),[filename,'_','RGB.tif']);
end

%imwrite(bitshift(uint16(files(:,:,1)), 8),'G_16.tif');
Expand All @@ -80,19 +85,17 @@ function FS_tiff(videodata,varargin)
for i=2:size(files,3) %number of images to be read

K = files(:,:,i);
% K = wiener2(K,[5 5]);
if size(size(videodata),2) ==4

K2 = videodata(:,:,:,i);
end
%G = filter2(fspecial('average',3),files2(:,:,i));
%GG = medfilt2(G);

imwrite(uint8(K),[filename,'.tif'],'WriteMode','append');
if size(size(videodata),2) ==4

imwrite(uint8(K2),[filename,'_','RGB.tif'],'WriteMode','append');
end
% K = wiener2(K,[5 5]);
if size(size(videodata),2) ==4

K2 = videodata(:,:,:,i);
end

imwrite(uint8(K),[filename,'.tif'],'WriteMode','append');
if size(size(videodata),2) ==4

imwrite(uint8(K2),[filename,'_','RGB.tif'],'WriteMode','append');
end
end

end
Binary file modified FinchScope/DesignFiles/CaBMI_miniscope/CaBMI_BasePlate.skp
Binary file not shown.
Loading

0 comments on commit d67dc4d

Please sign in to comment.