MIEN (Model Interaction Environment for Neuroscience) provides a framework for storing, integrating, and interacting with neuroscience data, including anatomy data, physiology data, abstract mathematical models, and detailed compartmental models. MIEN is not a compartmental model simulator, but it provides an interface to the Neuron simulator for evaluation of compartmental models.
Tasks that MIEN is ideally suited for include the following:
Integrating physiological and morphological data into a single realistic physiological model of a neuron.
Converting neuroscience data between a wide range of formats, or integrating data from several distinct formats into a single comprehensive format.
Visualizing, editing, and combining models and data.
Developing abstract mathematical models to process, predict, and analyze time series data.
MIEN is especially well suited to constructing hybrid models where these abstract mathematical systems are used to drive or analyze detailed compartmental models of neurons. MIEN provides the following primary components:
A data model for representing numerical, anatomical, and mathematical information from neuroscience. This model is jointly implemented as a dialect of XML that supports declarative representation of any combination of models and data, and a set of computational objects (implemented as Python classes) that bind to particular tags in the XML dialect (e.g. "Cell" or "AbstractModel") and provide functional descriptions that are semantically appropriate to the type of object being represented. For example, "Cell" objects can report a path length. This is the distance between two points in the cell, traveling only inside cell processes. This type of query requires semantic information about the nature of cells, not simply declarative information about the locations of the points. MIEN distinguishes between "Static" data queries and "Functional" queries. Static queries search only the declarative descriptions (as do all typical database queries), and can run directly on the XML representation. Functional queries require computation, semantic information, and sometimes simulation of abstract or compartmental models. These queries therefor require the computational object tree to evaluate.
An extensive set of file format converters. MIEN's XML dialect (nmpml, the neural model and protocol markup language) is designed to handle a wide range of data types used in neuroscience, as well as numerical data (this is stored using embedded urls, or using a joint file type that combines compressed XML and numerical data, since it is not tractable to store large numerical data sequences directly in XML). The parsers module of MIEN provides conversion from many common formats to and from the MIEN format. One use of mien is to act simply as a format converter between other common formats (but be warned that converting time-series data to an anatomical format, for example, will not have desirable results, even when it is possible). The MIEN parsers module is designed for quick extendibility. Adding a new format often requires writing less than 100 lines of code. In addition to many internal formats used by MIEN and by the Miller/Jacobs labratories, MIEN supports the following common formats: Wav, xml (reads any dialect, but only Mien and limited NeuroML will have semantically meaningful bindings), Raw binary data in Float64 and Float 32, Neuron hoc (full write support, reads some but not all legal hoc code), swc, lieca (format for storing stage position data on Lieca microscopes), bbt Neuron batch output, Neurolucida asc, Matlab mat (version 7), DataMAX, Data Streamer, Ascii
A large and easily expandable library of functions that operate on numerical data. These functions can be chained together (using a graphical interface or Python scripts) into complex mathematical models. MIEN provides tools for parameter search and optimization of these models, storage of the models and protocols in XML format, distributed network evaluation of the models, and binding of these abstract models to compartmental neural models as input sources or output analyzers.
A set of visualization and editing tools. These tools provide interactive 2 and 3D plotting for time-series and anatomical data, and editing for XML and anatomical data.
Several high level GUI applications for interacting with MIEN models. These applications are:
The XML editor. This is the most powerful and flexible of MIEN's GUIs. It can be used to directly view and edit any aspect of a MIEN XML document. It is very useful for combining data from different sources and for restructuring data and protocol representations to produce new models and experiments. This application also provides a powerful search interface. The disadvantage of the editor is that it is largely text based and has limited automation, so repetitive edits on large data collections are time consuming, and some users will find it less intuitive than the other, more graphical, interfaces.
The Data Viewer. This GUI provides flexible and interactive visualization for time-series data. The interface is sufficiently high performance to allow quick visual inspection of data files containing millions of samples. The Data Viewer supports multiple visualization modes and plot styles. In addition, the viewer provides a simple interface to the abstract data processing tools, so filtering, spike detection, event conditioning, and other operations can be implemented directly from the viewer. The viewer's interface is dynamic, so a user can write their own data processing function on the spot and it will appear in the viewer interface and can be applied to data without restarting the Viewer or reloading the data.
The Cell Viewer. This viewer displays and edits anatomical data. It can provide fully 3D interactive representations of cells, fiducial marks, synapses, density clouds, and annotations. This viewer uses OpenGL functions to produce quality 3D images with reasonably high performance. The viewer can display in full 3D, and also simulate the optical sections taken by a microscope with a particular view angle and depth of field. In addition, the viewer allows user interaction, and provides powerful functions for selecting points, sections, paths, and other regions within an anatomical model. These regions can be used to make measurements or assign physiological properties. The viewer is fully integrated with the XML editor, so selected regions can be saved to XML or selected in the editor, where any properties of the entire region can be edited with a single edit. The viewer also allows creation, deletion, and modification of structures, and provides tools for spatial alignment (co-registration) of different anatomical data sets, using fiducial landmarks or direct measurements of relative size and location. This viewer can also load physiological data, and can display properties like channel density and membrane voltage by coloring the displayed cells. The viewer can automatically generate animation sequences of the evolution of physiological data through time, or of moving the point of view through 3D space (saving these animations as movie files requires ImageMagick or Quicktime Pro).
The DSP editor. This is a specialized editor for assembling mathematical functions into abstract models or digital signal processing tool chains. It is more automated and intuitive than the XML editor for this purpose, although slightly less flexible. DSP is integrated with the XML editor and the data viewer, so it is easy to see the effects of a tool chain in real time as you edit it. Completed tool chains can be saved as XML, and it is also possible to quickly set up optimization, parameter search, and distributed computation for a completed chain. Chains can also be saved as macros that can be applied to data from the data viewer interface.
The waveform generator. This interface is a multi-channel synthesizer that provides AM and FM synthesizer functions as well as noise injection and custom function generation. This interface is useful for generating stimuli or input waveforms for models, or for real physiological experiments. In recent versions of MIEN, the waveform generator is deprecated, since all of its features can be provided by the DSP editor using recently added signal generator tools
MIEN is written primarily in Python (version 2.5 required), making extensive use of the numpy extension package (version >=1.0 required). The GUI components also use the wxPython (version >=2.6 required) and PyOpenGL (version >=3.0 recommended). Some advanced features of the DSP block functions and the optimizer module require the full SciPy package (use versions compatible with numpy >1.0).
MIEN also incorporates some python extensions written in C, which will require a C compiler to build. Use of the MIEN GUI applications (with the possible exception of the DSP editor) doesn't require SciPy or compiled C extensions, although you will see lots of warnings about failing to import this or that module from mien.blocks if you don't have these. Evaluation of compartmental and hybrid models currently requires the Neuron simulator. Support for other simulators, notably GENESIS should be easily implemented, and may be added in the future. The preferred method of obtaining MIEN is via subversion, using the command "svn co http://mien.msu.montana.edu/svn/mien".
MIEN is designed for rapid customization. This is primarily accomplished by writing Python modules for the mien.blocks or mien.parsers packages. It is also possible to extend MIEN in C, and it is possible to write blocks in Matlab as well (this requires a licensed install of matlab, and the performance is much worse than with native python modules). It should also be possible to extend MIEN using any language that can be inlined into Python, or any library that can be wrapped with SWIG, but these methods of extension haven't been tested.
Currently I (Graham Cummins) am the primary developer on the MIEN project. It is probable that I will continue developing MIEN until August 2009. It is my hope that the MIEN code can at that point be passed to another developer or incorporated into another open source project at that time.
One of the first tasks that MIEN was applied to was the problem of integrating anatomical and physiological data to generate a complete compartmental model. Here I will document the steps our lab used in this procedure. Firstly, appropriate data must be available. In our case, we had a number of reconstructions of filled, identified, invertebrate interneurons, and several intracellular recordings from these cells. The cells were filled using cobalt, and reconstructed using DIG (which produces output in the BBT format) and later Neurolucida. The physiology data included spike waveforms, recorded in the DataMAX format, and complex transfer impedance and F/I measurements, recorded as raw text.
The first step is to read the anatomy data and have a look at it. Using the cell viewer component, both types of data can be automatically read and displayed. For some of the cells, we then needed to remove some anomalies caused by digitizing errors (or, in the case of the BBT file format, file encoding errors). The editing features in the viewer make this inspection and touch up easy. Cells filled with cobalt are know to undergo shrinkage during the fixing process. We used the scaling tools in the cell viewer to approximately reverse the measured effects of cobalt shrinkage. To fine tune this process, we measured the positions of landmarks and key dimensions on unfixed cells of the same type, stained with florescent dies. These measurements were made using the stage encoders on a Lieca microscope. MIEN was used to read these measurements, make equivalent measurements on the digitized cells, and adjust scaling appropriately.
By visual inspection and comparison to the unfixed preps, we discovered that the cell bodies of some fixed cells had collapsed, decreasing in diameter and becoming less spherical, by amounts larger than the shrinkage of the dendrites. We added a customized function to MIEN to correct this cell-specific issue. This function required about 15 lines of python code to implement. Independently, we used MIEN to build a simplified cable model containing parametric models of ion channels thought to exist in cricket interneurons. We loaded the physiological data of spike waveforms and used the DSP tools to construct a model of the average observed axonal spike.
Next we constructed an abstract model that set the density and kinetic parameters of channels in our cable model, stimulated this model with different levels of current, and recorded spike output waveform and frequency. We produced an optimization routine using a genetic algorithm to take kinetics and densities as parameters and match waveform and F/I as cost function. This optimizer ran (automatically) on a distributed network of computers, and returned channel kinetics that reproduced the observed axonal spiking characteristics almost exactly. To integrate the physiology data with the anatomy, we first constructed an abstract model that adjusted passive electrical properties to fit the observed input and transfer impedances in regions of the cell far from the axon. We selected these parameters using a second optimizer. We then used the cell viewer to select regions of the anatomy corresponding to the electronic axon, the active, but non-electrogenic, proximal dendrite, and the approximately passive distal dendrite.
We used a cell constructor add-on to the XML editor for assigning channel models and densities in these regions. In the proximal dendrite, we used an exponential fall-off function for channel densities. This function, and the passive nature of the distal dendrite, were assumptions of our model, but the rate of fall-off was fit by a third optimizer so that the waveform and F/I behavior in the model axon remained fit to observation.
Finally, we added synaptic inputs to the model by using the probability density features of MIEN to estimate expected overlap between our interneuron and a population of sensory afferents (large numbers of anatomical reconstructions of these afferents were fortunately available). The result of this procedure was a complete physiological model of an interneuron, which could be provided with synaptic inputs and evaluated in the Neuron simulator. After assembling the first model, we were able to use MIEN to assemble three more models of similar interneurons in only a few hours per model.