Software Requirements Specification for Live Neuro - liang-bo96/Eelbrain GitHub Wiki
Introduction
Neuron data based on brain activity is often complex and multi-sourced. To clearly describe the activity of different neurons, multidimensional data is typically required. Live Neuro - an interactive data visualization tool is particularly useful for effectively presenting these data, allowing users to explore and understand the relationships and transformations between different data points.
Purpose of Document
The following section provides an overview of the Software Requirements Specification (SRS) for the interactive neural data visualization tool.The developed program will be referred to as “Live Neuro” based on the original, manually created version and the purpose of this program is to serve as a basic data visualization foundation module in Eelbrain, making all neuro-related plots interactive within jupyter notebook, which is not currently available in Eelbrain This section explains the purpose of this document, the scope of the requirements, the characteristics of the intended reader, and the organization of the document.
Scope of Requirements
The scope of requirements include the interactive data visualization
Characteristics of Intended Reader
Reviewers of this documentation should have an undergraduate-level understanding of math and neuro science
Organization of Document
The organization of this document follows the template for an SRS for scientific computing software proposed by koothoor2013, smithEtAl2007 , and smithKoothoor2016 . The presentation follows the standard pattern of pre- senting goals, theories, definitions, and assumptions. For readers that would like a more bottom up approach, they can start reading the instance models and trace back to find any additional information they require.
General System Description
This section provides general information about the system. It identifies the interfaces between the system and its environment, describes the user characteristics and lists the system constraints.
System Context
Fig1 shows the system context. A circle represents an external entity outside the software, the user in this case. A rectangle represents the software system itself (Live Neuro). Arrows are used to show the data flow
• User Responsibilities:
– Provide the input data to the system, ensuring no errors in the data entry
Live Neuro Responsibilities:
– Detect data type mismatch, such as a string of characters instead of a floating point number
– Determine if the inputs satisfy the required software constraints, excluding invalid or corrupt data from analysis
– Calculate the required outputs
User Characteristics
The end user of Live Neuro should have an understanding of Neuro Science including the basic neuro data structure
System Constraints
The project should be developed under the plot module of Eelbrain, and the basic visualization fundamental Library should be Plotly or any other Library with interactive function in jupyter notebook.
Specific System Description
This section first presents the problem description, which gives a high-level view of the problem to be solved. This is followed by the solution characteristics specification, which presents the assumptions, theories, and definitions that are used.
Problem Description
Live Neuro is intended to solve the problem of interactive neuro data visualization
Terminology and Definitions
This subsection provides a list of terms that are used in the subsequent sections and their meaning, with the purpose of reducing ambiguity and making it easier to correctly understand the requirements: • dipole: In neuroscience, a dipole refers to a pair of opposite electrical charges (positive and negative) that are separated by a small distance, typically generated by neuron activity.
Physical System Description
The physical system of Live Neuro, as shown in Figure 2, includes the following elements: PS: Arrows in the Figure 2 are neuronal current dipole, representing the intensity of neuronal activity
Goal Statements
Given the Neuro Data, the goal statements are: GS1: Implement multidimensional neural data visualization GS2: Link Interactive neural data plots together
Solution Characteristics Specification
Assumptions
A: The neuron data is complete
Theoretical Model
Electromagnetic source imaging assumes a linear forward model that links brain source activity to sensor measurements. In mathematical form, one can write the forward model as:
$$\mathbf{y}(t) = \mathbf{L}\ \mathbf{j}(t) + \mathbf{n}(t) ,,$$
where $\mathbf{y}(t)$ is the vector of measured signals at the sensors (EEG electrodes or MEG magnetometers) at time t, $\mathbf{j}(t)$ is the vector of source currents (dipole moments) at each brain location (voxel or source grid point), and $\mathbf{L}$ is the lead field matrix (also called the gain matrix) that encodes the contribution of each unit source to each sensor .$\mathbf{n}(t) $represents measurement noise
Reconstructing brain activity at each voxel from sensor data requires solving the inverse problem, which is ill-posed (infinitely many source distributions can explain the same sensor measurements). To obtain a unique solution, additional constraints or priors are imposed, yielding an inverse model (a method to estimate source currents $\hat{\mathbf{j}}$ from $\mathbf{y}$ In practice, one defines an inverse operator (often denoted $\mathbf{W}$ or $\mathbf{M}$) such that:
$$ \hat{\mathbf{j}}(t) = \mathbf{M}\ \mathbf{y}(t) \ $$
Minimum-Norm Estimation (Linear Inverse Solution)
Minimum-norm estimation assumes that out of all source configurations that explain the data, In a Bayesian interpretation, one assumes a Gaussian prior on source amplitudes favoring smaller values, and Gaussian sensor noise. The result is a regularized linear inverse operator $\mathbf{M}$ (of size [#sources × #sensors]) that can be expressed as:
$$\mathbf{M} = \mathbf{R}\ \mathbf{L}^T \big(\mathbf{L}\ \mathbf{R},\mathbf{L}^T + \lambda^2 \mathbf{C}\big)^{-1} ,,$$
where $\mathbf{L}$ is the lead field, $\mathbf{C}$ is the noise covariance matrix, $\mathbf{R}$ is the source covariance (source prior) matrix, and $\lambda$ is a regularization hyperparameter controlling the trade-off between fidelity to the data and the norm of the sources .
Requirements
Functional Requirements Via Use Cases
https://github.com/liang-bo96/Eelbrain/issues/6
https://github.com/liang-bo96/Eelbrain/issues/7
https://github.com/liang-bo96/Eelbrain/issues/8
https://github.com/liang-bo96/Eelbrain/issues/9
https://github.com/liang-bo96/Eelbrain/issues/10
Nonfunctional Requirements
NFR1: The generated data visualizations should not only accurately represent the underlying data but also adhere to the standards of scientific rigor, including clarity, reproducibility, and interpretability. They must effectively convey key patterns, relationships, and trends in a manner that facilitates meaningful analysis and supports evidence-based conclusions.
NFR2: Users with knowledge of neuro science and computer science, should be able to successfully use the software with minimal training.
NFR3: The effort required to make any of the likely changes listed for Live Neuro should be less than 20% of the original development time.
NFR4: LiveNeuro shall run on Linux Windows 10+ and MacOS operating system
Likely Changes
The interactive method(mouse clicking, dragging, zooming etc.) may be modified or added according to the real needs
The supported plotting function may increase
Unlikely Changes
The underlying source localization algorithm will not change.
References
Proloy Das, Christian Brodbeck, Jonathan Z. Simon, Behtash Babadi, Neuro-current response functions: A unified approach to MEG source analysis under the continuous stimuli paradigm, NeuroImage, Volume 211, 2020, 116528, ISSN 1053-8119,
Gramfort, A., Luessi, M., Larson, E., Engemann, D. A., Strohmeier, D., Brodbeck, C., ... Hämäläinen, M. (2013). MEG and EEG data analysis with MNE-Python.Frontiers in Neuroinformatics 7, 267.
Gramfort, A., Luessi, M., Larson, E., Engemann, D.A., Strohmeier, D., Brodbeck, C., Parkkonen, L. and Hämäläinen, M.S., 2014. MNE software for processing MEG and EEG data. neuroimage, 86, pp.446-460. xix