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. Python API
  4. Inquiry Regarding TI Simulation Setup in Sim4Life

Inquiry Regarding TI Simulation Setup in Sim4Life

Scheduled Pinned Locked Moved Python API
2 Posts 2 Posters 120 Views 2 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.
  • A Offline
    A Offline
    abbytang
    wrote on last edited by
    #1

    Dear ZMT team,

    I am a new user of Sim4Life and currently exploring TI simulations. While setting up the simulation, I encountered a few questions and would appreciate your guidance.

    1.Electrode Frequency Configuration

    Is the frequency setting for TI stimulation configured exclusively through the GUI path Setup > Frequency?

    745911be-c239-4fb0-931e-949c7b7f9e84-921424028e30407db94a761a46bd4a3c.png

    If scripting is preferred, is the following Python code snippet correct for setting the frequency to 2 kHz?

    quasi_static_setup_settings.Frequency = 2000.0 * units.Hz
    

    2.Current Amplitude Setup (2 mA)

    To achieve a total current of 2 mA through a circular electrode (radius = 4 mm), I calculated the current density as 1/ΠR2 mA/mm² and applied it via Boundary Conditions > Constant Flux.

    8a985873-cdb9-4988-95ce-32d316bfc63a-55aef6539fa7126c89bca486b74f02d2.png

    However, the Analysis > Max Modulation output appears empty. Could you confirm if this approach is correct or suggest alternative methods to define the current?

    3. Result Export for TI Interference

    How can I export the TI interference results (e.g., electric field magnitude) for all voxels or a specific point in the brain? Are there predefined scripts or GUI options for this purpose?

    I apologize if these questions are basic, but your clarification would greatly help my learning process. Thank you for your time and support.

    1 Reply Last reply
    0
    • SylvainS Offline
      SylvainS Offline
      Sylvain
      ZMT
      wrote last edited by
      #2

      Hi,
      I strongly recommend you have a look at the tutorial 3.2.12 called Temporal Interference with Complex Head Model. It should be of significant help for setting up a TI simulation correctly.

      As for your specific questions:

      1. yes, that's correct. You can actually get the full Python script that generates a given simulation from the GUI by right-clicking on the simulation in the Explorer tree and selecting "To Python". Very useful :)
      2. That will most likely not work. Instead, you should apply fixed voltage Dirichlet conditions (e.g. +/- 1V) and re-normalize your results at post-processing (see screenshot below)
      3. For most fields that you can see in the analysis, you can use the Imp/Export menu in the ribbon and find a format in which to export (e.g. Matlab, VTK, or even plain text).

      image.png

      image.png

      1 Reply Last reply
      0
      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