Edit this page

NA-MIC Project Weeks

Back to Projects List

Real-time visualization in transcranial magnetic stimulation (TMS)

Key Investigators

Project Description

Transcranial magnetic stimulation is a nonivasive procedure used for treating depression with magnetic and electric fields to stimulate nerve cells. A TMS coil is slowly moved over the subject’s head suface to target certain areas in the brain. Our project aims to develop a deep-learning powered software for real-time E-Field prediction and a visualization of TMS within 3D Slicer.


Real-time visualization of an electric field (E-field) for transcranial magnetic stimulation (TMS) on the brain surface as well as visualizing the E-field along fiber bundles (DTI), and later the possibility to optimize the exact coil position or to target certain fibers.

Approach and Plan

Integrate the visualization process as a new module within the MRML scene architecture:

Progress and Next Steps

  1. Visualize Efield (volume) on brain surface (polydata/mesh) by adjusting the models orientation and applying the vtkProbeFilter within a new Slicer Module.
  2. Tested the rendering time of our visualization approach with renderer.GetLastRenderTimeInSeconds() resulted in an average of 0.8 milliseconds.
  3. Added a functionality to create fiducials and to move it along the brain model’s surface.

Next steps:


Fiducial (yellow sphere) moving along the brain surface with mapped vector field: Fiducial (Sphere) moving along brain surface The fiducial in this screenshot will later be replaced by a TMS coil model.

The vector field volume and the brain surface mesh overlapping after applying the module’s functionalities: Moving vector field

Visualization goal from another software we want to implement as Module in 3D Slicer: Brain surface and DT

Visualization process also on tractography for fiber bundle targeting: Visualization Process

Background and References

vtkProbeFilter: https://vtk.org/doc/nightly/html/classvtkProbeFilter.html Moving fiducials with CPYY: https://gist.github.com/pieper/f9da3e0a73c70981b48d0747132526d5

Measure rendering time in 3D Slicer:

  1. Getting renderer: https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#access-vtk-views-renderers-and-cameras
  2. Then applying renderer.GetLastRenderTimeInSeconds()