-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhoLabjackCSVHelper_141560393.html
90 lines (77 loc) · 9.94 KB
/
PhoLabjackCSVHelper_141560393.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<title>Watson Lab Behavioral Box : PhoLabjackCSVHelper</title>
<link rel="stylesheet" href="styles/site.css" type="text/css" />
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body class="theme-default aui-theme-default">
<div id="page">
<div id="main" class="aui-page-panel">
<div id="main-header">
<div id="breadcrumb-section">
<ol id="breadcrumbs">
<li class="first">
<span><a href="index.html">Watson Lab Behavioral Box</a></span>
</li>
<li>
<span><a href="Watson-Lab---Behavioral-Box-Home_141559292.html">Watson Lab - Behavioral Box Home</a></span>
</li>
<li>
<span><a href="Behavioral-Box-Project_141559650.html">Behavioral Box Project</a></span>
</li>
<li>
<span><a href="Software-Ecosystem_141561507.html">Software Ecosystem</a></span>
</li>
<li>
<span><a href="Analysis-Software_141563078.html">Analysis Software</a></span>
</li>
</ol>
</div>
<h1 id="title-heading" class="pagetitle">
<span id="title-text">
Watson Lab Behavioral Box : PhoLabjackCSVHelper
</span>
</h1>
</div>
<div id="content" class="view">
<div class="page-metadata">
Created by <span class='author'> Pho Hale</span>, last modified on Jan 13, 2020
</div>
<div id="main-content" class="wiki-content group">
<p>PhoLabjackCSVHelper is a collection of MATLAB scripts and functions that can serve to pre-process Labjack CSV files for processing by <a href="phoPythonVideoFileParser_141560296.html">phoPythonVideoFileParser</a> Python software.</p><p>The <a href="phoBehavioralBoxLabjackController_141560203.html">phoBehavioralBoxLabjackController</a> software exports a .CSV file each time the software is started, and writes to it each time an event occurs. The <a href="phoBehavioralBoxLabjackController_141560203.html">phoBehavioralBoxLabjackController</a> software has usually been restarted several times throughout the course of the experiment, which results in a directory full of many small .CSV files. These .CSV files can be sequentially concatenated during post-processing to ease analysis and consolidate data to a single larger .CSV file. </p><p><br/></p><p><br/></p><p><br/></p><p>One of the most useful is the ability to concatenate multiple .CSV output files into a single .CSV file.</p><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>LabjackDataToPython.m</b></div><div class="panelContent">
<p>script that tries to help export a .mat file that can be read by Python, specifically my <a href="phoPythonVideoFileParser_141560296.html">phoPythonVideoFileParser</a> scripts.</p><pre>Output: Specified by the pythonOutput.outputPath variable. Defaults to 'Output/LabjackDataArray.mat'</pre>
</div></div><p>'../Output/compressed.mat'</p><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>PostProcessConcatenatedCSV.m</b></div><div class="panelContent">
<p>Parses a .csv file generated by either my <a href="phoBehavioralBoxLabjackController_141560203.html">phoBehavioralBoxLabjackController</a>, Labjack's LJLogM program, or several .CSV files of these formats that have been properly concatenated. The Arduino running the behavior box code is connected to the Labjack's digital input ports. 'SensorChanged' and 'Dispense' events are logged and stored in the .csv file. This script parses those beambreak state changed signals into regions where the beam is broken and when it isn't and then calls further post-processing scripts to save them in several formats.</p>
</div></div><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>SaveEventOnlyCompressed.m</b></div><div class="panelContent">
<p>Saves out only the state changes instead of the state at all sample points to a "compressed events".mat file.</p><p>The output path is specified in 'CompressedEventsFormat\UpdateAndSaveCompressedEvents.m' and defaults to 'Output\compressed.mat'</p><p><br/></p><p>Internally it calls:</p><p>UpdateAndSaveCompressedEvents.m</p><p> ConcatenateCompressedEvents.m</p><p> EnsureUniqueEntries.m</p><p><br/></p><p> </p><p><br/></p>
</div></div><p><br/></p><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>TestPlotAllCompressed.m</b></div><div class="panelContent">
<p>Plots the 'Output\compressed.mat' "Compressed Events format" in MATLAB.</p>
</div></div><p><br/></p><p><br/></p><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>TestImportPhoServerCSV.m</b></div><div class="panelContent">
<p>Successfully imports a modern .CSV file, including one concatenated by MATLAB's TestCSVConcatenation.m function.</p>
</div></div><p><br/></p><p><br/></p><p><br/></p><hr/><div id="expander-1524431788" class="expand-container"><div id="expander-control-1524431788" class="expand-control" aria-expanded="true"><span class="expand-icon aui-icon aui-icon-small aui-iconfont-chevron-down"></span><span class="expand-control-text">CSV Concatenation</span></div><div id="expander-content-1524431788" class="expand-content"><h1 id="PhoLabjackCSVHelper-CSVConcatenation">CSV Concatenation</h1><h2 id="PhoLabjackCSVHelper-Apps">Apps</h2><h3 id="PhoLabjackCSVHelper-'Apps/CSVConcatenatorApp.mlapp'">'Apps/CSVConcatenatorApp.mlapp'</h3><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="attachments/141560393/147653913.png" data-image-src="attachments/141560393/147653913.png" data-unresolved-comment-count="0" data-linked-resource-id="147653913" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="image2020-1-8_16-58-58.png" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/png" data-linked-resource-container-id="141560393" data-linked-resource-container-version="12"></span></p><h3 id="PhoLabjackCSVHelper-'Apps/SingleCSVConcatenatorApp.mlapp'">'Apps/SingleCSVConcatenatorApp.mlapp'</h3><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-thumbnail" height="250" src="attachments/141560393/147653914.png" data-image-src="attachments/141560393/147653914.png" data-unresolved-comment-count="0" data-linked-resource-id="147653914" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="image2020-1-8_16-59-28.png" data-base-url="https://wiki.med.umich.edu" data-linked-resource-content-type="image/png" data-linked-resource-container-id="141560393" data-linked-resource-container-version="12"></span></p><hr/><h2 id="PhoLabjackCSVHelper-Process">Process</h2><p>1. Run "TestCSVConcatenation.m" and select the directory above the folder containing the .CSV files you want to analyze.</p><p>2. Then select the directory containing the files you want to analyze. This is an artifact of the pre-custom software days.</p><p>3. Should run for a few minutes (depending on length and number of .CSV files) and produce a single .CSV file like "out_file_s470017560_20190911-20190820_46Combined.csv"</p><div class="panel" style="border-width: 1px;"><div class="panelHeader" style="border-bottom-width: 1px;"><b>Combined .CSV Output Format</b></div><div class="panelContent">
<p>out_file_s{LabjackSerialNumber}_{YYYYMMDD_LATEST}-{YYYYMMDD_EARLIEST}_{NumberOfCSVFilesConcatenated}Combined.csv</p>
</div></div></div></div>
</div>
<div class="pageSection group">
<div class="pageSectionHeader">
<h2 id="attachments" class="pageSectionTitle">Attachments:</h2>
</div>
<div class="greybox" align="left">
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141560393/147653913.png">image2020-1-8_16-58-58.png</a> (image/png)
<br/>
<img src="images/icons/bullet_blue.gif" height="8" width="8" alt=""/>
<a href="attachments/141560393/147653914.png">image2020-1-8_16-59-28.png</a> (image/png)
<br/>
</div>
</div>
</div> </div>
<div id="footer" role="contentinfo">
<section class="footer-body">
<p>Document generated by Confluence on Mar 24, 2022 11:12</p>
<div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
</section>
</div>
</div> </body>
</html>