{"id":20956429,"url":"https://github.com/bluebrain/emsim","last_synced_at":"2025-07-23T02:05:50.384Z","repository":{"id":41817342,"uuid":"274062232","full_name":"BlueBrain/EMSim","owner":"BlueBrain","description":"EMSim is a library that compute different electro-magnetic effects like LPF and VSD. ","archived":false,"fork":false,"pushed_at":"2024-02-09T10:32:37.000Z","size":604,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-14T05:33:35.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueBrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-22T06:54:14.000Z","updated_at":"2024-05-26T17:19:26.000Z","dependencies_parsed_at":"2024-02-08T08:31:54.367Z","dependency_job_id":"d132abfe-915e-4c5b-ad36-d08ea1ad2d4f","html_url":"https://github.com/BlueBrain/EMSim","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BlueBrain/EMSim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FEMSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FEMSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FEMSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FEMSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueBrain","download_url":"https://codeload.github.com/BlueBrain/EMSim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FEMSim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266604009,"owners_count":23954725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T01:25:55.798Z","updated_at":"2025-07-23T02:05:50.368Z","avatar_url":"https://github.com/BlueBrain.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EMSIM\n\nEMSim is a library that computes different electro-magnetic effects\nlike LPF and VSD.\n\n## Features\n\nEMSim provides the following functionality:\n\nIn order to compute LFP or VSD, there are a few common initial steps:\n\n1. Load the circuit data from a circuit file\n2. Create all the static morphology geometry\n3. Apply current and voltage report on the geometry\n4. Finally, specific calculations are done to compute LFP or VSD\n\nThe LFP part of EMSim computes the electric field in the space between neurons, using the following method:\n\n1. Load and place all segments in 3D space\n2. Load the current report for each segment and for every simulation frame\n3. Create a volume with the specified resolution (# of voxels)\n4. 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)\n\nThe VSD part of EMSim simulates the processes of a voltage sensitive dye, using the following method:\n\n1. Load and place all segments in 3D space\n2. Load the voltage report for each segment and for every simulation frame\n3. Create a volume with the specified resolution (# of voxels)\n4. For each voxel, the value is accumulated\n5. Create a projection of the volume into a 2D surface\n\n## Installation\n\nWith a proper installation of [Brion](https://github.com/BlueBrain/brion), installation can be done with CMake:\n\n```\n$ mkdir build\n$ cd build\n$ cmake .. -GNinja\n$ ninja\n```\n\nSee the [CI plan](https://github.com/BlueBrain/EMSim/blob/master/.github/workflows/run-tests.yml) for more details.\n\n## Usage\n\n### emsim\nThe `emsim` program has the following options:\n\n```\n  -i [ --input ] arg    Path to Blueconfig file.\n  -o [ --output ] arg   Path for the output file.\n  --target arg          The circuit's target.\n  --report arg          The name of the report.\n  --start-time arg      The start time\n  --end-time arg        The end time\n  --fraction arg        Specify the fraction [0.0 1.0] of gids to be used\n                        during the computation. Default is 1.0.\n  --export-volume       Will export a floating point volume for each time\n                        steps.\n  --voxel-size arg      The size in each dimension of a voxel in circuit units.\n                        Default is 4.0,4.0,4.0. Must be written in the form:\n                        --voxel-size rx,ry,rz\n  --volume-extent arg   Specify an additional 3d extent for the volume in\n                        micrometers. Default is 0.0,0.0,0.0. Must be written in\n                        the form: --volume-extent ex,ey,ez\n  --sample-point arg    The x y z positions of a sample point. Must be written\n                        in the form: --sample-point x,y,z\n```\n\nSo, for example, to compute the LFP values on 2 probes:\n```\n    emsim                        \\\n        -i blueconfigFile        \\\n        -o outputFileName        \\\n        --target cuirtcuitTarget \\\n        --report currentReport   \\\n        --sample-point 12,34,32  \\\n        --sample-point 43,56,43  \\\n```\n\n### emsimVSD\n\nThe `emsim` program has the following options:\n\n```\n  -i [ --input ] arg                   Path to Blueconfig file.\n  -o [ --output ] arg                  Name of the output volume (if\n                                       'export-volume' specified) and 2D image\n                                       files\n  --target arg                         The circuit's target.\n  --report-voltage arg                 The name of the voltage report in the BlueConfig.\n  --report-area arg                    The name of the area report in the BlueConfig.\n  --sensor-res arg (=512)              Number of pixels per side of the square\n                                       sensor.\n  --sensor-dim arg (=1000)             Length of side of the square sensor in\n                                       micrometers.\n  --curve arg                          Path to the dye curve file (default: no\n                                       attenuation)\n  --start-time arg                     The start time of the simulation\n  --end-time arg                       The end time of the simulation\n  --time-step arg                      The time between frames, in milliseconds\n  --fraction arg                       Specify the fraction [0.0 1.0] of gids\n                                       to be used during the computation.\n                                       Default is 1.0.\n  --export-volume                      Will export a floating point volume for\n                                       each time steps.\n  --depth arg (=2081.7561)             Depth of the attenuation curve area of\n                                       influence. It also defines the\n                                       Y-coordinate at which it starts being\n                                       applied down until y=0 (default:\n                                       2081.756 micrometers).\n  --interpolate-attenuation            Will interpolate the attenuation curve.\n  --sigma arg (=0.00449999981)         Absorption + scattering coefficient\n                                       (units per micrometer) in the\n                                       Beer-Lambert law. Must be a positive\n                                       value (default: 0.0045).\n  --v0 arg (=-65)                      Resting potential (default: -65 mV).\n  --g0 arg (=0)                        Multiplier for surface area in\n                                       background fluorescence term.\n  --ap-threshold arg (=3.40282347e+38) Action potential threshold in\n                                       millivolts.\n  --soma-pixels                        Produce a text file containing the GIDs\n                                       loaded and their corresponding 3D\n                                       positions and indices in the resulting\n                                       2D image.\n```\n\nFor example, to compute the VSD with 1000um sensor size with a 512 resolution:\n\n```\n    emsimVSD                           \\\n        -i blueconfigFile              \\\n        -o outputFileName              \\\n        --target cuirtcuitTarget       \\\n        --report-voltage voltageReport \\\n        --report-area areaReport       \\\n        --sensor-dim 1000              \\\n        --sensor-res 512\n```\n\n## Input Formats\n\n###  VSD Curve File\n\nWhen using the `--curve` option, a file must be supplied.\nThis 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\n\n\n## Output Format\n\n### LFP\n\n#### export-volume\nTriggered by the `export-volume` option.\n\n#### sample-point\n\nThis writes a file called `$output$_sample_points` where `$output$` is the value of the `--output` argument.\nLines in this file starting with `#` are comments;\nFor each frame in the report a line is generated with the following format:\n\n```\ntimestamp samplePoint1 samplePoint2 ... samplePointN\n```\n\nWhere the `samplePointN` is the voltage at that point.\n\n#### export-volume\nTriggered by the `export-volume` option.\n\nThis option writes two files (where `$output$` is the value of the `--output` argument):\n* a `raw` file called: `$output$_volume_floats$timestamp$.raw` for each frame, containing the LFP voxel values for each voxel\n* a txt file called `$output$_volume_info_$timestamp$.txt` for each frame.\n\n### VSD\n\n* `$output$_image_floats_$timestamp$.raw`, containing the raw binary data of the 2 dimensional viewport.\n* an `MHD` file for each frame called `$output$_image_floats_$timestamp$.mhd`, containg the header information for the above.\n\n#### volume-info\nThis option writes two files (where `$output$` is the value of the `--output` argument):\n* `$output$_volume_floats_$timestamp$.raw`, much like the one from LFP.\n* an `MHD` file for each frame called `$output$_volume_floats_$timestamp$.mhd`, containing the header imformation for the above.\n\n## Acknowledgement \u0026 Funding\n\nThis project was supported by funding to the Blue Brain Project, a research\ncenter of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss\ngovernment's ETH Board of the Swiss Federal Institutes of Technology.\n\nCopyright (c) 2017-2024 Blue Brain Project/EPFL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Femsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluebrain%2Femsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Femsim/lists"}