Skip to main content

Neurotech Development Kit: an open-source software library designed to enhance accessibility to cutting-edge neurotechnology

Project description

Welcome to Neurotech Development Kit

The Neurotech Development Kit (NDK) is an open-source software library designed to enhance accessibility to cutting-edge neurotechnology. Featuring an easy-to-use API and pre-built examples, the NDK provides a seamless starting point for users. Moreover, the NDK offers educational resources, such as interactive simulations and notebook-based tutorials, catering to a diverse audience including researchers, educators, engineers, and trainees. By lowering the barrier of entry for newcomers and accelerating the progress of researchers, the NDK aims to be a versatile and invaluable tool for the neurotech community.

The initial set of target users for the NDK are ultrasound simulation trainees – individuals with backgrounds in technical or neuroscience-related fields who are learning to perform ultrasound simulations. Our goal is to help users familiarize themselves with ultrasound simulation, understand the importance of input parameters, and streamline the process of running and visualizing simulations. In the future, we plan to expand the NDK's features to incorporate additional functionality and modalities, catering to a broader range of users, including ultrasound researchers, product developers, machine learning engineers, and many more.

The initial release of NDK provides support for transcranial functional ultrasound stimulation, with a focus on providing comprehensive documentation, API flexibility, and visualizations. The Neurotech Development Kit is actively developed and we welcome feedback and contributions.

Simulation

Check out the NDK documentation page.

Running

Local installation

neurotechdevkit requires Python >=3.9 and <3.11 to be installed. You can find which Python version you have installed by running python --version in a terminal.

If you don't have Python installed, or you are running an unsupported version, you can download it from python.org. Python environment managers like pyenv, conda, and poetry are all perfectly suitable as well.

You can install the neurotechdevkit package using:

pip install neurotechdevkit

You also have to install stride, it can be done running:

pip install git+https://github.com/trustimaging/stride

NDK uses devito to perform the heavy computational operations. Devito generates, compiles and runs C code to achieve better performance. The compiler used by Devito has to be selected, and paths for the linker might also be added as environment variables.

Export the environment variable that defines what compiler devito will use:

export DEVITO_ARCH=gcc

The supported values for DEVITO_ARCH are: 'custom', 'gnu', 'gcc', 'clang', 'aomp', 'pgcc', 'pgi', 'nvc', 'nvc++', 'nvidia', 'cuda', 'osx', 'intel', 'icpc', 'icc', 'intel-knl', 'knl', 'dpcpp', 'gcc-4.9', 'gcc-5', 'gcc-6', 'gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11'

MacOS

The two main compiler options for MacOS are clang and gcc.

clang

If you prefer to use clang you will have to install libomp and llvm, you will also have to export a few environment variables needed for the compiler.

  1. Install libomp

    brew install libomp
    

    the output of the command above will look like this:

    For compilers to find libomp you may need to set:
    export LDFLAGS="-L/usr/local/opt/libomp/lib"
    export CPPFLAGS="-I/usr/local/opt/libomp/include"
    
  2. Export a new environment variable CPATH with the path for libomp headers, like so:

    export CPATH="/usr/local/opt/libomp/include"
    
  3. Install llvm:

    brew install llvm
    
  4. Export the following environment variables:

    export PATH="/usr/local/opt/llvm/bin:$PATH"
    export LDFLAGS="-L/usr/local/opt/llvm/lib"
    export CPPFLAGS="-I/usr/local/opt/llvm/include"
    
  5. Export the DEVITO_ARCH environment variable

    export DEVITO_ARCH="clang"
    
gcc

On MacOS the gcc executable is a symbolic link to clang, so by defining DEVITO_ARCH=gcc devito will try to add gcc flags to the clang compiler, and the compilation will most probably fail.

You can tell devito to use the correct gcc compiler doing the following:

  1. Install gcc-11

    brew install gcc@11
    
  2. Export the DEVITO_ARCH environment variable

    export DEVITO_ARCH="gcc-11"
    

Docker

You can run NDK inside a docker container with a couple of steps:

  1. Install docker

  2. Execute docker run -p 8888:8888 ghcr.io/agencyenterprise/neurotechdevkit:latest

The output of the command above contains the URL of a jupyter notebook server, you can open the URL in your browser or connect to it using your IDE.

Usage

import neurotechdevkit as ndk

scenario = ndk.make('scenario-0-v0')
result = scenario.simulate_steady_state()
result.render_steady_state_amplitudes(show_material_outlines=False)

Simulation

Acknowledgements

Thanks to Fred Ehrsam for supporting this project, Quintin Frerichs and Milan Cvitkovic for providing direction, and to Sumner Norman for his ultrasound and neuroscience expertise. Thanks to Stride for facilitating ultrasound simulations and providing an MIT license for usage within NDK, Devito for providing the backend solver, Napari for great 3D visualization, and to Jean-Francois Aubry, et al. for the basis of the simulation scenarios.

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

neurotechdevkit-0.1.0.tar.gz (2.1 MB view hashes)

Uploaded Source

Built Distribution

neurotechdevkit-0.1.0-py3-none-any.whl (2.1 MB view hashes)

Uploaded Python 3

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