Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Analysis & Postprocessing
  4. Optimize electrode placement for brain stimulation

Optimize electrode placement for brain stimulation

Scheduled Pinned Locked Moved Analysis & Postprocessing
4 Posts 3 Posters 657 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mreynes
    wrote on last edited by
    #1

    Hello all,
    I am working on temporal interference on a anatomical model of a human head, with two pairs of electrodes.

    I would like to run an optimization in order to optimize the placement, on the scalp of the participant, of two pairs of electrodes, in order to maximize the stimulation induced on a specific area of the brain. However, I cannot find a way to have parameters that satisfy my needs, especially the two following:

    • the electrodes should move only at the surface of the scalp and not elsewhere
    • both pair of electrodes should be considered to optimize stimulation
    • TI MAM(x,y,z) should be maximized in a predifined entity

    I would be grateful to anyone with ideas on how to tackle that issue.
    Thanks in advance!
    Best

    1 Reply Last reply
    1
    • H Offline
      H Offline
      halder
      ZMT
      wrote on last edited by
      #2

      Hi,
      You could do it with the optimizer/scripting.
      Option (1)
      For 2 electrode pairs you can create LF multiport simulation (see LF tutorial). In the post-pro you will update the Amp/Phase of the electrodes and use the simulation combiner to extract the TI MAM.
      Once you run the simulation once, select the simulation and click on optimize. Switch to the Analysis tab to check if this pipeline is created, click on switch to Expert Mode. Now to include design variables which in your case is the position of the electrode switch to “Model” tab and click on the electrodes, in the controller select “Show Expression” and “Create Expression” . Then switch to Analysis tab and create a pipeline that will look like the following:

      Sim4Life_szrHUU8P6P.png

      Option (2)
      If you are required to do this, please let me know, I can send you an example script to create a similar pipeline.

      If you require further help with creating either of these, please email s4l-support@zmt.swiss.

      Thanks,
      Arjama

      1 Reply Last reply
      1
      • brynB Offline
        brynB Offline
        bryn
        ZMT
        wrote on last edited by
        #3

        You could try using the Python API. We currently don't expose any functionality to parametrize points on a 3D triangle mesh using e.g. 2D coordinates (a, b).

        However, I guess you have following options:

        • use a third-party library to parametrize the surface, to give you a mapping from (a,b) to a point (x,y,z) on the surface. Then the optimization would try to optimize (a, b) for each electrode.
        • parametrize the skin (outer) surface as a sphere, where (a,b) map to (x,y,z) on the sphere surface. The sphere should share the same center as the head, and have a radius larger than the head. A point (x, y, z) on the sphere can then be projected to the head surface using XCoreModeling.GetEntityPointDistance. This function returns an object, which stores the closest point on the surface, as well as the distance, e.g.,
        def project_to_skin(skin: TriangleMesh, point: Vec3) -> Vec3:
            r = XCoreModeling.GetEntityPointDistance(skin, point)
            return r.ClosestPosition
        
        1 Reply Last reply
        1
        • brynB Offline
          brynB Offline
          bryn
          ZMT
          wrote on last edited by bryn
          #4

          e.g. something like this

          def spherical_parametrization(theta: float, phi: float) -> Vec3
              '''Parametrize head skin
              center and radius computed from head, e.g. using:
          
              p1, p2 = XCoreModeling.GetBoundingBox(skin)
              center = 0.5 * (p1 + p2)
              radius = 0.51 * (p2-p1).Length()
              '''
              point_on_sphere = center + Vec3(radius  * sin(theta) * cos(phi), radius  * sin(theta) * sin(phi), radius  * cos(theta))
              r = XCoreModeling.GetEntityPointDistance(skin, point_on_sphere)
              return r.ClosestPosition
          

          This should work quite well, except for the concave regions, e.g. behind the ears.

          1 Reply Last reply
          1
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Search