EMSim is a library that computes different electro-magnetic effects like LPF and VSD.
EMSim provides the following functionality:
In order to compute LFP or VSD, there are a few common initial steps:
- Load the circuit data from a circuit file
- Create all the static morphology geometry
- Apply current and voltage report on the geometry
- Finally, specific calculations are done to compute LFP or VSD
The LFP part of EMSim computes the electric field in the space between neurons, using the following method:
- Load and place all segments in 3D space
- Load the current report for each segment and for every simulation frame
- Create a volume with the specified resolution (# of voxels)
- Compute the value for each voxel, using the current point model (one can also compute the values of some sample points instead of the full volume)
The VSD part of EMSim simulates the processes of a voltage sensitive dye, using the following method:
- Load and place all segments in 3D space
- Load the voltage report for each segment and for every simulation frame
- Create a volume with the specified resolution (# of voxels)
- For each voxel, the value is accumulated
- Create a projection of the volume into a 2D surface
With a proper installation of Brion, installation can be done with CMake:
$ mkdir build
$ cd build
$ cmake .. -GNinja
$ ninja
See the CI plan for more details.
The emsim
program has the following options:
-i [ --input ] arg Path to Blueconfig file.
-o [ --output ] arg Path for the output file.
--target arg The circuit's target.
--report arg The name of the report.
--start-time arg The start time
--end-time arg The end time
--fraction arg Specify the fraction [0.0 1.0] of gids to be used
during the computation. Default is 1.0.
--export-volume Will export a floating point volume for each time
steps.
--voxel-size arg The size in each dimension of a voxel in circuit units.
Default is 4.0,4.0,4.0. Must be written in the form:
--voxel-size rx,ry,rz
--volume-extent arg Specify an additional 3d extent for the volume in
micrometers. Default is 0.0,0.0,0.0. Must be written in
the form: --volume-extent ex,ey,ez
--sample-point arg The x y z positions of a sample point. Must be written
in the form: --sample-point x,y,z
So, for example, to compute the LFP values on 2 probes:
emsim \
-i blueconfigFile \
-o outputFileName \
--target cuirtcuitTarget \
--report currentReport \
--sample-point 12,34,32 \
--sample-point 43,56,43 \
The emsim
program has the following options:
-i [ --input ] arg Path to Blueconfig file.
-o [ --output ] arg Name of the output volume (if
'export-volume' specified) and 2D image
files
--target arg The circuit's target.
--report-voltage arg The name of the voltage report in the BlueConfig.
--report-area arg The name of the area report in the BlueConfig.
--sensor-res arg (=512) Number of pixels per side of the square
sensor.
--sensor-dim arg (=1000) Length of side of the square sensor in
micrometers.
--curve arg Path to the dye curve file (default: no
attenuation)
--start-time arg The start time of the simulation
--end-time arg The end time of the simulation
--time-step arg The time between frames, in milliseconds
--fraction arg Specify the fraction [0.0 1.0] of gids
to be used during the computation.
Default is 1.0.
--export-volume Will export a floating point volume for
each time steps.
--depth arg (=2081.7561) Depth of the attenuation curve area of
influence. It also defines the
Y-coordinate at which it starts being
applied down until y=0 (default:
2081.756 micrometers).
--interpolate-attenuation Will interpolate the attenuation curve.
--sigma arg (=0.00449999981) Absorption + scattering coefficient
(units per micrometer) in the
Beer-Lambert law. Must be a positive
value (default: 0.0045).
--v0 arg (=-65) Resting potential (default: -65 mV).
--g0 arg (=0) Multiplier for surface area in
background fluorescence term.
--ap-threshold arg (=3.40282347e+38) Action potential threshold in
millivolts.
--soma-pixels Produce a text file containing the GIDs
loaded and their corresponding 3D
positions and indices in the resulting
2D image.
For example, to compute the VSD with 1000um sensor size with a 512 resolution:
emsimVSD \
-i blueconfigFile \
-o outputFileName \
--target cuirtcuitTarget \
--report-voltage voltageReport \
--report-area areaReport \
--sensor-dim 1000 \
--sensor-res 512
When using the --curve
option, a file must be supplied.
This is a depth-dependent dye attenuation curve file that contains a column of floating point values, one for every micrometer specified by the --depth
argument
Triggered by the export-volume
option.
This writes a file called $output$_sample_points
where $output$
is the value of the --output
argument.
Lines in this file starting with #
are comments;
For each frame in the report a line is generated with the following format:
timestamp samplePoint1 samplePoint2 ... samplePointN
Where the samplePointN
is the voltage at that point.
Triggered by the export-volume
option.
This option writes two files (where $output$
is the value of the --output
argument):
- a
raw
file called:$output$_volume_floats$timestamp$.raw
for each frame, containing the LFP voxel values for each voxel - a txt file called
$output$_volume_info_$timestamp$.txt
for each frame.
$output$_image_floats_$timestamp$.raw
, containing the raw binary data of the 2 dimensional viewport.- an
MHD
file for each frame called$output$_image_floats_$timestamp$.mhd
, containg the header information for the above.
This option writes two files (where $output$
is the value of the --output
argument):
$output$_volume_floats_$timestamp$.raw
, much like the one from LFP.- an
MHD
file for each frame called$output$_volume_floats_$timestamp$.mhd
, containing the header imformation for the above.
This project was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.
Copyright (c) 2017-2024 Blue Brain Project/EPFL