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 1def5532c3cefeba955129117e8c23abb7643cf8 authored by Max's Office PC on 20 November 2019, 03:30:51 UTC, committed by Max's Office PC on 20 November 2019, 03:30:51 UTC
Merge branch 'Master' of https://github.com/RaymondLab/Code into Master
2 parent s 08f15ff + 964f3bd
  • Files
  • Changes
  • 4d2e3a8
  • /
  • Projects
  • /
  • Max - CF Project
  • /
  • maestroBehavior2dat.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:1def5532c3cefeba955129117e8c23abb7643cf8
directory badge Iframe embedding
swh:1:dir:cac382edddef562293d4732575a6b36b3536f9b6
content badge Iframe embedding
swh:1:cnt:a84874cb40d24ff7088ce82a02d2936cfa6bf631

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
maestroBehavior2dat.m
%{
Maxwell Gagnon - September 2019
- This function finds all BEHAVIOR Maestro files in a directory, opens them, and saves
them as a .mat file.
- .mat files are easier to work with than the BEHAVIOR Maestro files.
%}

%% Set up
clear;clc; close all; fclose('all');

expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\jennifer_arch\Jennifer_Arch';
Files = dir([expmtDataFolder '\**\*']);

samplerate = 500;
chanAmt = 6;

%% Filters
% Remove directories
Files([Files.isdir]) = [];
% Remove zip files
Files(contains({Files.name}, {'.zip'})) = [];
% Remove mat files
Files(contains({Files.name}, {'.mat'})) = [];
% Remove non-behavior files - only works for Jenifer's data
Files(~contains({Files.name}, {'el'})) = [];
% Remove files that typically don't work
%Files(~contains({Files.name}, {'.0'})) = [];
Files(contains({Files.name}, {'VORC'})) = [];
Files(contains({Files.name}, {'sines'})) = [];
Files(contains({Files.folder}, {'backup'})) = [];

%% name length check
tic
for j = length(Files):-1:1
    if strlength(Files(j).name) ~= 11
        Files(j) = [];
    end
end
toc

%% Find, open, rename, and save behavior files
for i = 1:length(Files)
    
    disp(['(', num2str(i), '/', num2str(length(Files)), ')'])
    disp(['     ', Files(i).name]);
    try
        % Open the BEHAVIOR Maestro file (the ephys file)
        filename = fullfile(Files(i).folder, Files(i).name);
        
        behaviorData = cx2dat(filename, chanAmt);
        if isempty(behaviorData)
            continue
        end
        
        if ~isempty(behaviorData(1,9).data)
            disp('Contains Sorted CS')
        end
        % Rename
        newName = [strrep(Files(i).name, '.', '_') 'behavior.mat'];

        % Save as a .mat with a single varibale inside of it
        disp(['     ', fullfile(Files(i).folder, newName)])
        save(fullfile(Files(i).folder, newName), 'behaviorData')
    catch
        disp(filename)
        disp('Oops!')
    end
    fclose('all');
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–2025, 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