Skip to content

psg_view - #49

Open
Annali95 wants to merge 37 commits into
kylerbrown:masterfrom
margoliashlab:master
Open

psg_view#49
Annali95 wants to merge 37 commits into
kylerbrown:masterfrom
margoliashlab:master

Conversation

@Annali95

Copy link
Copy Markdown
Contributor

Create new psg_view
Need to install pyqt5

kylerbrown and others added 30 commits August 17, 2017 13:57
* fixing arf converter

* Warn user of FileExistsError
* Allow entries to be relative paths

* Glob command before running it
* UNITS no longer needed

* Make columns constructors always return dicts

* Move pandas import to top

* Make read_events mirror read_sampled

* Make default meta a constant

* Comment backwards-compatibility code

* Regularize path treatment

* Add bark-convert-spyking to to README

* Rearrange installation instructions

* Fix doc typos
* Only create top-level entry if it won't be empty

* Fix typo

* Remove unnecessary function
* Add progress to verbose output

* Improve quoted string handling

* Expand user & home directory in command
* Add close methods for Root and Entry

* Write closing tests

* Rename variables
* Add one_cut option to dat-split

* Write tests for datchunk

* Remove unnecessary import
* Convert wav to dat format

* Update and rename dat-from-wav.py to datfromwav.py

* Create datfromwav.py

* Update datfromwav.py

* Delete datfromwav.py

* test for datfromwav

* pytest for datfromwav and update to datfromwav.py

* update changes to test_dat_from_wav
* Psg-view added

* fix some problems

* Error fixed

* modularize the bark label view

Doesn’t change the functionality of bark.
Only modularize the class including:
Osc_Plot
Spec_Plot
Minimap_Plot

* Setup added

* Remove the model_label_view

* Replace code with bark.write_metadata

* fix some bugs

* add some functions

* add pyqt5 to requirement.txt

* remove print

* Enable arrows to control the keys

* Input dialog added

* update

* add next page

* Add color to psg_view

* Update README.md

* Update README.md
* Forced QT5 backend for OS X

* Remove debugging code

* Add comment to OS X-specific backend
* Psg-view added

* fix some problems

* Error fixed

* modularize the bark label view

Doesn’t change the functionality of bark.
Only modularize the class including:
Osc_Plot
Spec_Plot
Minimap_Plot

* Setup added

* Remove the model_label_view

* Replace code with bark.write_metadata

* fix some bugs

* add some functions

* b plot added

* add set up bark-Bplot

* delete psg_view

* Fix function-to-script addressing
* Convert EOLs

* Set up magic number removal

* Alias long names

* Combine numpy fromfile calls into one

* Update attribution
* Replace spykingcircus matlab reader with phy reader

* Improve argparse help text

* Update setup.py
* Copy dataset with shutil

* Get # channels and samples from data.shape

* Reduce number of calls to np.mean()

* Reduce number of calls to np.median()

* Fix variable name bugs

* Make output file argument required
* Add more constants

* Change function signature and docstring

* Fold time, digital IO into read; read >=1 dbs

* Rename file to reflect function

* Update import

* Grab dbs in chunks

* Update init import

* Add legacy option

* Remove debugging
* Convert large RHD files in chunks

* Warn user of removal of notch filter if applied

* Re-enable legacy functionality

* Remove now-unnecessary indices

* Refactor data memory preallocation

* Remove notch filter application

* Reformat refactor function

* Move preallocation to read_data_blocks

* Refactor rhd2bark

* Fix bug

* Remove unnecessary imports & tidy

* Add and update docstrings

* Reformat version check

* Account for copies of data in memory restriction

* Refactor uint->int conversion to use less memory

* Avoid duplicating data in memory

* Remove unnecessary parameters
* Add check for create_entry positional arguments

* Add command-line option for mangle prefix
* Preserve specified order when using --col-attr

* Ignore channels without attribute being selected on
* Add .mda I/O

* Update readme with new scripts

* Add attribution note

* Remove script-style __name__ guard
* Correct .mda serialization bug

* Avoid transposing if possible

* Remove confusing information in docstring
`bark-label-view` now runs successfully under matplotlib up to 3.4.2. Fixes #68
This incorporates information gained and fixes produced during #69 , #67 , #65 , #61 , #53 .
Fix #44 .

`Ctrl+click` is difficult to get matplotlib backends to recognize on Macs. Some don't register any key presses during mouse clicks, and others don't register `Ctrl+click`. Recognition of `Cmd+click` is inconsistent as well.

For this reason, **for Mac only**, the control sequences for splitting an interval and adding a new interval in `bark-label-view` have been changed to `Shift+click`. They remain `Ctrl+click` for linux and windows.

In the process of investigating this, I discovered that the built-in `TkAgg` backend sometimes doesn't recognize `Shift+click` the first time it is produced; it does recognize subsequent attempts. This can be a pain point in some workflows, so I added a check for the PyQt5 backend `Qt5Agg`, which doesn't have this problem, falling back on `TkAgg` if PyQt5 isn't installed. It's a large library to have as a dependency for just this feature, so I have labeled it "optional" in the installation section. As I note there, `bark-label-view` is still usable under the `TkAgg` backend, just occasionally slightly less smooth.
The transition from version 1 to version 3 of the Intan GUI brought two principal changes to `.rhd` files:

1. The version 2+ GUI writes an additional header qstring field (`digital_reference_channel`) to reflect new functionality (the GUI allows software referencing before writing data to disk).
2. Files now contain 128 samples per "data block", rather than the 60 of version 1.

Another small, but annoying, change is that ports are now 1-indexed, where before they were 0-indexed.

These changes have been incorporated into the `.rhd`-to-bark conversion code in `bark-convert-rhd` (along with some code cleanup). They also make it seem prudent to begin noting the Intan GUI version that produced a given set of data; that information is now included in the entry metadata produced by `bark-convert-rhd`.

These changes apply equally to the "legacy" code that more closely follows that provided by Intan (found on their [downloads page](https://intantech.com/downloads.html?tabSelect=Software) and to the streaming version I wrote a couple of years ago to reduce intolerable conversion times on large datasets. However, the legacy/streaming split has not been relevant so far (and they have been verified to produce identical outputs across a wide range of files). The time may come soon to eliminate the legacy version entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants