Skip to main content

Convert data to nwb

Project description

# nwbext_ecog: An NWB extension for ECoG data

Author: Ben Dichter

There are three data types, `Surface`, `CorticalSurfaces`, and `ECoGSubject`. `CorticalSurfaces` is simply a group (like a folder) to put `Surface` objects into. `Surface` holds surface mesh data (vertices and triangular faces) for sections of cortex. `ECoGSubject` is an extension of `Subject` that allows you to add the `CorticalSurfaces` object to `/general/subject`.

## Usage

### python

install:
```bash
pip install nwbext_ecog.git
```

write:
```python
import pynwb
from nwbext_ecog import CorticalSurfaces, ECoGSubject

nwbfile = pynwb.NWBFile(...)

...

cortical_surfaces = CorticalSurfaces()
## loop me
cortical_surfaces.create_surface(name=name, faces=faces, vertices=veritices)
##
nwbfile.subject = ECoGSubject(cortical_surfaces=cortical_surfaces)
```

You can optionally attach images of the subject's brain:
```python
from pynwb.base import Images
from pynwb.image import GrayscaleImage

subject.images = Images(name='subject images', images=[GrayscaleImage('image1', data=image_data)])
```

read:
```python
import nwbext_ecog
from pynwb import NWBHDF5IO
io = NWBHDF5IO('path_to_file.nwb','r')
nwb = io.read()
nwb.subject.cortical_surfaces
```

### MATLAB
install:
```matlab
generateExtension('/path/to/nwbext_ecog/nwbext_ecog/ecog.namespace.yaml');
```

write:
```matlab
cortical_surfaces = types.ecog.CorticalSurfaces;

%%% loop me
surf = types.ecog.Surface('faces', faces, 'vertices', vertices);
cortical_surfaces.surface.set(surface_name, surf);
%%%

file.subject = types.ecog.ECoGSubject(name, cortical_surfaces);
```


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nwbext_ecog-0.7.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

nwbext_ecog-0.7.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file nwbext_ecog-0.7.0.tar.gz.

File metadata

  • Download URL: nwbext_ecog-0.7.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for nwbext_ecog-0.7.0.tar.gz
Algorithm Hash digest
SHA256 eb92eda3d96b7a60da85ce5840f4fa862efa19dbb03b651c39b8fa14914f72b5
MD5 8ed49d6e0d54700e86e10c0400cb2952
BLAKE2b-256 b0910dd8bd19112a3115154cd31c4dfbf20cb5e0425e6be52b8792b663550b1c

See more details on using hashes here.

File details

Details for the file nwbext_ecog-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: nwbext_ecog-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for nwbext_ecog-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60b8cbb571c504dffc5bb598349f3c151eaf78d9f16026ba02b36f120bab640a
MD5 71bf19ce3c6ca550932106ae78ace5d4
BLAKE2b-256 7fccb36fd0f76483a856efd1e3cde1200c8e32feabe8ae93fa143ab4973c9a5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page