-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add set_probe method to BaseRecordingExtractorInterface #639
Merged
Merged
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
d2c465f
add set_probe to BaseRecordingExtractorInterface
magland 3a27e52
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9983099
Adjust comment in baserecordingextractorinterface.py
magland 9037c96
Merge branch 'main' into set-probe
CodyCBakerPhD e2b459e
Merge branch 'main' into set-probe
CodyCBakerPhD 8332459
cover set_probe with tests
magland 30b4b40
Merge branch 'set-probe' of https://github.com/magland/neuroconv into…
magland d3f6e20
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1b189ce
only test probe for select interfaces
magland f2259df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 18776a7
remove debug line
magland b8f793b
Merge branch 'set-probe' of https://github.com/magland/neuroconv into…
magland 1b9d94c
Merge branch 'main' into set-probe
bendichter 893ec14
Update src/neuroconv/datainterfaces/ecephys/baserecordingextractorint…
magland b946c64
adjust _create_mock_probe()
magland 645c2c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8cd1aa8
adjust _create_mock_probe() to be more realistic
magland de101e2
Merge branch 'set-probe' of https://github.com/magland/neuroconv into…
magland 5dcc319
Merge branch 'main' into set-probe
CodyCBakerPhD 75aa8e1
fix _create_mock_probe()
magland d6cfc2f
Merge branch 'set-probe' of https://github.com/magland/neuroconv into…
magland 6f5f9ba
Merge branch 'main' into set-probe
CodyCBakerPhD 9afd9a9
Merge branch 'main' into set-probe
CodyCBakerPhD 46f592d
adjust set_probe tests
magland d781a46
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3f8cab5
RecordingExtractorInterfaceTestMixin: remove check for testing probe
magland e2298fa
Merge branch 'main' into set-probe
CodyCBakerPhD 69e5d94
recording extractor interface tests
magland 5b3a999
Merge branch 'main' into set-probe
CodyCBakerPhD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
import numpy as np | ||
|
||
|
||
def generate_mock_probe(num_channels: int, num_shanks: int = 3): | ||
import probeinterface as pi | ||
|
||
# The shank ids will be 0, 0, 0, ..., 1, 1, 1, ..., 2, 2, 2, ... | ||
shank_ids: List[int] = [] | ||
positions = np.zeros((num_channels, 2)) | ||
# ceil division | ||
channels_per_shank = (num_channels + num_shanks - 1) // num_shanks | ||
for i in range(num_shanks): | ||
# x0, y0 is the position of the first electrode in the shank | ||
x0 = 0 | ||
y0 = i * 200 | ||
for j in range(channels_per_shank): | ||
if len(shank_ids) == num_channels: | ||
break | ||
shank_ids.append(i) | ||
x = x0 + j * 10 | ||
y = y0 + (j % 2) * 10 | ||
positions[len(shank_ids) - 1] = x, y | ||
probe = pi.Probe(ndim=2, si_units="um") | ||
probe.set_contacts(positions=positions, shapes="circle", shape_params={"radius": 5}) | ||
probe.set_device_channel_indices(np.arange(num_channels)) | ||
probe.set_shank_ids(shank_ids) | ||
return probe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one note: if the probe has less channels than the recording (e.g., you want to only select the
A
channels from an Intan recording), theset_probe(..., in_place=True)
will fail.We can't do anything about it, just something to keep in mind :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alejoe91 What would this represent in a real world case?
Would it be indicative of a bad probe definition by the user?
Or are there cases where the user might actually specify a probe correctly, but extra channels show up (possibly from auxiliary sources or a mistake in SI/neo)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I think the second option is what I had in mind. You have a recording with Ephys + Aux channels and you might want to select ephys channels with the probe slicing