Git Product home page Git Product logo

axel-lab-to-nwb's Introduction

axel-lab-to-nwb

NWB conversion scripts and tutorials. A collaboration with Axel Lab.

Install

To clone the repository and set up a conda environment, do:

$ git clone https://github.com/ben-dichter-consulting/axel-lab-to-nwb.git
$ conda env create -f axel-lab-to-nwb/make_env.yml
$ source activate convert_to_nwb

Alternatively, to install directly in an existing environment:

$ pip install axel-lab-to-nwb

Use

After activating the correct environment, the conversion function can be used in different forms:

1. Imported and run from a python script:
Here's an example: we'll grab the data from the same experiment but stored in different .npz and .mat files and save it to a single .nwb file.

from axel_lab_to_nwb import conversion_function
import yaml

# Nwb file
f_nwb = 'output.nwb'

# Source files
source_paths = {}
source_paths['raw data'] = {'type': 'file', 'path': PATH_TO_FILE}
source_paths['raw info'] = {'type': 'file', 'path': PATH_TO_FILE}
source_paths['processed data'] = {'type': 'file', 'path': PATH_TO_FILE}
source_paths['sparse matrix'] = {'type': 'file', 'path': PATH_TO_FILE}
source_paths['ref image'] = {'type': 'file', 'path': PATH_TO_FILE}

# Load metadata from YAML file
metafile = 'metafile.yml'
with open(metafile) as f:
   metadata = yaml.safe_load(f)

# Other options
kwargs = {
   'raw': False, 
   'processed': True, 
   'behavior': True
   'plot_rois': False
}

conversion_function(source_paths=source_paths,
                   f_nwb=f_nwb,
                   metadata=metadata,
                   **kwargs)

2. Command line:
Similarly, the conversion function can be called from the command line in terminal:

$ python conversion_module.py [processed_data_file] [sparse_matrix_file] [ref_image_file]
  [output_file] [metadata_file]

3. Graphical User Interface:
To use the GUI, just run the auxiliary function nwb_gui.py from terminal:

$ python nwb_gui.py

The GUI eases the task of editing the metadata of the resulting .nwb file, it is integrated with the conversion module (conversion on-click) and allows for visually exploring the data in the end file with nwb-jupyter-widgets.

4. Tutorial:
At tutorials you can also find Jupyter notebooks with the step-by-step process of conversion.

axel-lab-to-nwb's People

Contributors

bendichter avatar codycbakerphd avatar d-sot avatar luiztauffer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

axel-lab-to-nwb's Issues

metadata and command line args

  • Allow for data files to be added manually as command line arguments
  • Name file args something more meaningful than f1, f2 and f3
  • Allow for plotting arg to be added as command line arg, default to False
  • Add more metadata to metadata_file, such as emission lambda, etc.

no empty strings please

Let's try to avoid writing empty strings. If a field is required, then we should require it. If it is not and we do not want to enter a value, we should use None. Can we remove the empty strings from the metafile.yaml?

mat2nwb

  • Write mat structure conversion code as an importable function
  • Do command line interface
  • Put instructions in README

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.