Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
08171fb4
Commit
08171fb4
authored
10 years ago
by
jsiegle
Browse files
Options
Downloads
Patches
Plain Diff
Fix indexing issue in Spike Sorter/Spike Detector.
parent
f9c4fa89
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/SpikeDetector/SpikeDetector.cpp
+2
-2
2 additions, 2 deletions
Source/Processors/SpikeDetector/SpikeDetector.cpp
Source/Processors/SpikeSorter/SpikeSorter.cpp
+10
-5
10 additions, 5 deletions
Source/Processors/SpikeSorter/SpikeSorter.cpp
with
12 additions
and
7 deletions
Source/Processors/SpikeDetector/SpikeDetector.cpp
+
2
−
2
View file @
08171fb4
...
...
@@ -569,8 +569,8 @@ void SpikeDetector::process(AudioSampleBuffer& buffer,
for
(
int
j
=
0
;
j
<
electrode
->
numChannels
;
j
++
)
{
overflowBuffer
.
copyFrom
(
*
electrode
->
channels
+
i
,
0
,
buffer
,
*
electrode
->
channels
+
i
,
overflowBuffer
.
copyFrom
(
*
electrode
->
channels
+
j
,
0
,
buffer
,
*
electrode
->
channels
+
j
,
nSamples
-
overflowBufferSize
,
overflowBufferSize
);
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/SpikeSorter/SpikeSorter.cpp
+
10
−
5
View file @
08171fb4
...
...
@@ -46,7 +46,7 @@ SpikeSorter::SpikeSorter()
spikeBuffer
=
new
uint8_t
[
MAX_SPIKE_BUFFER_LEN
];
// MAX_SPIKE_BUFFER_LEN defined in SpikeObject.h
channelBuffers
=
nullptr
;
PCAbeforeBoxes
=
true
;
autoDACassignment
=
tru
e
;
autoDACassignment
=
fals
e
;
syncThresholds
=
false
;
flipSignal
=
false
;
}
...
...
@@ -275,7 +275,7 @@ void SpikeSorter::setElectrodeVoltageScale(int electrodeID, int index, float new
{
std
::
vector
<
float
>
values
;
mut
.
enter
();
for
(
int
k
=
0
;
k
<
electrodes
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
electrodes
.
size
();
k
++
)
{
if
(
electrodes
[
k
]
->
electrodeID
==
electrodeID
)
{
...
...
@@ -453,6 +453,10 @@ bool SpikeSorter::addElectrode(int nChans, String name, double Depth)
newElectrode
->
depthOffsetMM
=
Depth
;
String
log
=
"Added electrode (ID "
+
String
(
uniqueID
)
+
") with "
+
String
(
nChans
)
+
" channels."
;
std
::
cout
<<
log
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
nChans
;
i
++
)
{
std
::
cout
<<
" Channel "
<<
i
<<
" = "
<<
newElectrode
->
channels
[
i
]
<<
std
::
endl
;
}
String
eventlog
=
"NewElectrode "
+
String
(
uniqueID
)
+
" "
+
String
(
nChans
)
+
" "
;
for
(
int
k
=
0
;
k
<
nChans
;
k
++
)
eventlog
+=
String
(
chans
[
k
])
+
" "
+
name
;
...
...
@@ -1019,9 +1023,10 @@ void SpikeSorter::process(AudioSampleBuffer& buffer,
for
(
int
j
=
0
;
j
<
electrode
->
numChannels
;
j
++
)
{
//std::cout << "Processing " << *electrode->channels+i << std::endl;
overflowBuffer
.
copyFrom
(
*
electrode
->
channels
+
i
,
0
,
buffer
,
*
electrode
->
channels
+
i
,
overflowBuffer
.
copyFrom
(
*
(
electrode
->
channels
+
j
)
,
0
,
buffer
,
*
(
electrode
->
channels
+
j
)
,
nSamples
-
overflowBufferSize
,
overflowBufferSize
);
...
...
@@ -1122,7 +1127,7 @@ void SpikeSorter::addProbes(String probeType,int numProbes, int nElectrodesPerPr
for
(
int
probeIter
=
0
;
probeIter
<
numProbes
;
probeIter
++
)
{
int
probeCounter
=
getUniqueProbeID
(
probeType
);
for
(
int
electrodeIter
=
0
;
electrodeIter
<
nElectrodesPerProbe
;
electrodeIter
++
)
for
(
int
electrodeIter
=
0
;
electrodeIter
<
nElectrodesPerProbe
;
electrodeIter
++
)
{
double
depth
=
firstContactOffset
-
electrodeIter
*
interelectrodeDistance
;
String
name
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment