-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from skim0119/38_sample_data
Update: Sample dataset and utilities to install fix 38
- Loading branch information
Showing
7 changed files
with
403 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Sample Datasets | ||
############### | ||
|
||
.. automodule:: miv.datasets | ||
|
||
.. warning:: | ||
The size of the datasets are typically very large. The download can take | ||
a long time to complete. | ||
|
||
Raw Recording Samples | ||
+++++++++++++++++++++ | ||
|
||
.. automodule:: miv.datasets.optogenetic | ||
:members: | ||
|
||
MiV Dataset Samples | ||
+++++++++++++++++++ | ||
|
||
.. automodule:: miv.datasets.criticality | ||
:members: |
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,9 @@ | ||
__doc__ = """ | ||
Sample datasets for debugging/testing. | ||
Any downloaded datasets will be saved in **datasets** directory. | ||
If the dataset already exists, download will be skipped. | ||
To remove any cache files, you can delete the **datasets** directory. | ||
""" | ||
|
||
from miv.datasets.optogenetic import load_data |
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,40 @@ | ||
__doc__ = """Sample data for criticality analysis.""" | ||
__all__ = ["load_data"] | ||
|
||
import gzip | ||
import os | ||
|
||
import numpy as np | ||
|
||
from miv.datasets.utils import get_file | ||
|
||
|
||
def load_data(): | ||
""" | ||
Loads the sample for criticality analysis | ||
Total size: 5.1 MB (compressed) | ||
Returns | ||
------- | ||
datapath: str | ||
Examples | ||
-------- | ||
>>> from miv import datasets | ||
>>> data = datasets.criticality.load_data() | ||
""" | ||
|
||
subdir = "criticality" | ||
base_url = "https://uofi.box.com/shared/static/mxj6mfjj0fdexod4nqoqovdeg7t8dbbq.mat" | ||
file = "asdf.mat" | ||
file_hash = "c8ff82f4700eed2023d37cb7643d24b37350e521469148406042ef206c3aac34" | ||
|
||
path = get_file( | ||
file_url=base_url, | ||
cache_subdir=subdir, | ||
fname=file, | ||
file_hash=file_hash, | ||
archive_format=None, | ||
) | ||
return path |
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,80 @@ | ||
__doc__ = """Sample signal readout from optogenetic neuron.""" | ||
__all__ = ["load_data"] | ||
|
||
import gzip | ||
import os | ||
|
||
import numpy as np | ||
|
||
from miv.datasets.utils import get_file | ||
from miv.io import DataManager | ||
|
||
|
||
def load_data(): | ||
""" | ||
Loads the sample optogenetic experiment data. | ||
Total size: 600.5 MB (compressed) | ||
Notes | ||
----- | ||
All experiment are 1 minute long, 30k Hz recording of optogenetic | ||
neuron cells over 64 channels MEA. Dataset includes 1 spontaneous | ||
recording and 4 stimulated recording. | ||
Spontaneous recording is the recording over 1 minute period without | ||
external stimulation. The purpose was to measure the baseline mean- | ||
firing rate. | ||
Stimulation was done by LED light. Over 1 minute (60 seconds) period, | ||
6 stimulation was done with 10 seconds of intervals. For each stimulation, | ||
LED light was shined over 1 seconds, followed by remaining 9 seconds | ||
of rest (without light). | ||
Containing experiments: | ||
* experiment0: spontaneous recording | ||
* experiment1-4: stimulated recordings | ||
Returns | ||
------- | ||
dataset: miv.io.DataManager | ||
Examples | ||
-------- | ||
>>> from miv import datasets | ||
>>> experiments: miv.io.DataManager = datasets.opogenetic.load_data() | ||
>>> experiments.tree() | ||
2022-03-10_16-19-09 | ||
0: <miv.io.data.Data object at 0x7fbc30b9a9a0> | ||
└── Record Node 104/experiment1/recording1 | ||
1: <miv.io.data.Data object at 0x7fbc2ae16700> | ||
└── Record Node 104/experiment0/recording1 | ||
2: <miv.io.data.Data object at 0x7fbc2ac9e7c0> | ||
└── Record Node 104/experiment2/recording2 | ||
3: <miv.io.data.Data object at 0x7fbc2ac9edc0> | ||
└── Record Node 104/experiment3/recording1 | ||
4: <miv.io.data.Data object at 0x7fbc2ac9e160> | ||
└── Record Node 104/experiment4/recording3 | ||
License | ||
------- | ||
... | ||
""" | ||
|
||
subdir = "optogenetic" | ||
base_url = "https://uofi.box.com/shared/static/9llg11ods9iejdt2omjwjosbsxb5ui10.zip" | ||
file = "2022-03-10_16-19-09.zip" | ||
file_hash = "5deadc1b2a20501b5f6ee8828fa9c85df0b7890bd6ac4eaa8dca768d3b8b5f83" | ||
|
||
path = get_file( | ||
file_url=base_url, | ||
cache_subdir=subdir, | ||
fname=file, | ||
file_hash=file_hash, | ||
archive_format="zip", | ||
) | ||
experiment = DataManager(path) | ||
experiment.tree() | ||
return experiment |
Empty file.
Oops, something went wrong.