Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision bc6bc5271ca8c2cbf8107bdf243352e543f64b8e authored by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC, committed by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC
Added .gitignore file and removed RigChoice.s2s
As a first step to generalizing the code, we removed the need to
comment/uncomment the appropriate rig-specific parameters file and
replace it with a local rig_config.s2s file that is ignored by Git. This
way, changes can be made to this simple file without affecting the
Github repository at all.
1 parent 3d78fa7
  • Files
  • Changes
  • 9b50c67
  • /
  • Projects
  • /
  • Boris - Photometry
  • /
  • Max Code
  • /
  • segMatrix.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:bc6bc5271ca8c2cbf8107bdf243352e543f64b8e
directory badge
swh:1:dir:233eac2eaf9fd131d6456a478c2013586df2a5cd
content badge
swh:1:cnt:78b35d92b3996f4d41e4005559a587f2c4b861d3

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
segMatrix.m
function [segMat_405_Control, segMat_472_GCaMP, segMat_Diff]  = segMatrix(params)

%% Import & organize data

% Choose Which mouse to load from
if params.mouse == 1
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz.mat')
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz405.mat')
    Chan_405_Control = debleach;
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz472.mat')
    Chan_472_GCaMP = debleach;
elseif params.mouse == 2    
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz.mat')
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz405.mat')
    Chan_405_Control = debleach;
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz472.mat')
    Chan_472_GCaMP = debleach;
elseif params.mouse == 3
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz.mat')
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz405.mat')
    Chan_405_Control = debleach;
    load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz472.mat')
    Chan_472_GCaMP = debleach;
else
    warning('Wrong Mouse number. Please Enter 1 or 2')
end

%% Organize data - Normal
Chan_Diff = Chan_472_GCaMP - Chan_405_Control;

switch params.filter
    case 'Filtered'
        Chan_405_Control = smooth(Chan_405_Control, 10);
        Chan_472_GCaMP = smooth(Chan_472_GCaMP, 10);
        Chan_Diff = smooth(Chan_Diff, 10);
    case 'Unfiltered'
        
    otherwise
        warning('Typo!')
        params.filter
end

offset = params.segLen / 4;
startT = camtime(params.segment(1)) * 100 + offset;
endT = camtime(params.segment(2))  * 100;
% make control chan matrix
segMat_405_Control = vec2mat(Chan_405_Control(startT:endT),params.segLen);
segMat_405_Control(end,:) = [];

% make GCaMP chan matrix
segMat_472_GCaMP = vec2mat(Chan_472_GCaMP(startT:endT),params.segLen);
segMat_472_GCaMP(end,:) = [];

% make difference matrix
segMat_Diff = vec2mat(Chan_Diff(startT:endT),params.segLen);
segMat_Diff(end,:) = [];



%% setup for CUstom Process (Comment this section out be default)
% 
% % this vector contains pause lengths
% m2r1s1 = [0 0 0 4 1 1 1 1 1 1 1 1 4 2  2 2 2 2 2 2  2  2  2 2];
% % add time for movement
% m2r1s1 = m2r1s1 + 2;
% % this vector contains pause lengths
% m2r1s2 = [3 5 5 5 6 5 4 4 3 4 3 3 4 15 7 9 6 6 7 12 10 14 7 9 17];
% % add time for movement
% m2r1s2 = m2r1s2 + 2;
% 
% segment = m2r1s2;
% 
% % pre-alocate
% %R_matrix = NaN(length(segment), (2+max(segment))*400);
% %L_matrix = NaN(length(segment), (2+max(segment))*400);
% segmentMatrix = NaN(length(segment), (2+max(segment))*400);
% startT = camtime(params.segment(1)) * 100;
% %endT = camtime(params.segment(2))  * 100;
% 
% for i = 1:length(segment)  
% 
%     segmentMatrix(i,1:segment(i)*400) = data(startT:startT+(segment(i)*400)-1);
%     
%     % First movement is always rightward (from MOUSE PERSPECTIVE!!)
% %     if mod(i, 2) == 1
% %         R_matrix(i,1:segment(i)*400) = data(startTime:startTime+(segment(i)*400)-1);
% %     else
% %         L_matrix(i,1:segment(i)*400) = data(startTime:startTime+(segment(i)*400)-1);
% %     end
% 
%     startT = startT + (segment(i)+2)*400;
% end









The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API