Skip to content
  • 0 Votes
    7 Posts
    135 Views
    T
    @halder I hope this message finds you well. I am currently conducting a temporal interference (TI) simulation using the LF Electro Ohmic Quasi-Static solver in Sim4Life, and I have encountered an issue regarding the electric field distribution at the electrode–skin interface. Here are the specific settings I used: There are four electrodes in total. For the first pair of stimulating electrodes, I assigned PEC material type to the other two electrodes (which are not used for stimulation). The stimulating electrodes were not assigned a material type; instead, I only applied Dirichlet boundary conditions to them. In the voxel settings, the four electrodes were set with priority = 1, and the Duke model with priority = 0. For the second pair of electrodes, I applied the same procedure accordingly. However, during post-processing, I noticed that the region where the electrodes overlap with the skin shows no electric field distribution, which seems physically unreasonable. Could you please advise if there might be an issue with my setup or if there are additional steps required to properly model the electrode–skin contact in TI simulations? Thank you very much for your time and support. I truly appreciate your help.
  • 1 Votes
    3 Posts
    112 Views
    2
    Thank you for your response. Additionally, I would appreciate it if you could tell me how to output the temperatures from the thermal simulation results to text files, spreadsheets, Excel, etc. Ideally, I would like to be able to extract the temperatures at specified coordinates or average values for each model (Lung, Spleen, etc.). If specifying the model is difficult, it would also be acceptable to obtain the post-simulation temperature at specified coordinates.
  • Multiport Simulations Export Huygens Source

    Analysis & Postprocessing
    11
    0 Votes
    11 Posts
    720 Views
    L
    Hi Sylvain, thanks again for your detailed answer. I also talked with Arjama; I guess the best solution is to import both Huygens sources (Even if this means loosing the information about the input power) and to simulate the exposure field not with the BC coil, but with the two imported sources. Then, the other simulations (as in the youtube tutorial) can be linked to the field sensor used when simulating the two Huygens-imported sources.
  • 0 Votes
    2 Posts
    162 Views
    H
    Hi @Kihyun, To create an acoustic simulation, click on “Sources”, then change the excitation signal from “Sinusoidal” to “User Defined.” This will provide an “Expression” field that you can edit as needed. I also recommend checking the Acoustic Tutorial in Section 3.7 of the Sim4Life Manual, which you can access from the top ribbon under “Help.” [image: 1761036820889-sim4life_jvkul06rui.png] [image: 1761036826795-sim4life_q3dc6omg4u.png]
  • Export Huygens Source

    Sim4Life
    2
    0 Votes
    2 Posts
    105 Views
    H
    Hi @MB, The solution would be to export a separate Huygens source for each port individually (i.e., without using the Simulation Combiner). You can then set the amplitudes and phases of each Huygens source when you use them. This approach is quite powerful if you need to simulate multiple amplitude/phase configurations. However, we understand this might be a concern if you have a large number of ports involved. That said, we’re aware of this limitation and are working on adding this feature in an upcoming release.
  • 0 Votes
    5 Posts
    187 Views
    G
    @bryn Thank you very much for your reply. Both the visualization of the electric field in the nerve region and the extraction of the field data as a .mat file have been successfully resolved. I really appreciate your kind support and clear explanations.
  • How to sense values on head.

    Simulations & Solvers
    3
    1 Votes
    3 Posts
    157 Views
    R
    Solved it - Model the electrode as PEC and use the voltage reader
  • 0 Votes
    9 Posts
    3k Views
    M
    Hi everyone, I'm using Sim4Life and currently working with the Optimizer tool. I would like to run the optimization algorithm on a network server using ARES instead of executing it on my local machine. However, I can't seem to find an option in the simulation settings that allows me to select the server as the execution target — the optimizer always defaults to running locally. Is it now possible to run parameter sweeps and optimization tasks on a remote machine in the network (without using a remote desktop session)? If so, how can I configure this in Sim4Life? Thanks in advance!
  • 0 Votes
    3 Posts
    718 Views
    brynB
    Btw, this topic is quite similar https://forum.zmt.swiss/topic/735/the-shape-of-the-t1-image-and-the-shape-of-the-electric-field-are-different
  • Understand the h5 file structure

    Analysis & Postprocessing
    3
    0 Votes
    3 Posts
    720 Views
    brynB
    to get the current density in Python you could use a script like import s4l_v1.document as document try: # add a SimulationExtractor for the simulation call "LF" simulation = document.AllSimulations["LF"] simulation_extractor = simulation.Results() # create an EmSensorExtractor em_sensor_extractor = simulation_extractor["Overall Field"] em_sensor_extractor.FrequencySettings.ExtractedFrequency = u"All" document.AllAlgorithms.Add(em_sensor_extractor) # update the pipeline, make sure current density is extracted em_sensor_extractor.Outputs["J(x,y,z,f0)"].Update() # get data current_density_field = em_sensor_extractor.Outputs["J(x,y,z,f0)"].Data except Exception as exc: import traceback traceback.print_exc()
  • 0 Votes
    5 Posts
    853 Views
    G
    Dear, @AntoninoMC Thank you very much for your detailed clarification. I now understand the fundamental difference between the Ohmic solver and the QS solver, and I have also tried some test runs with the QS solver, which helped me to grasp the impact of frequency dependence more clearly. In my current application, I am applying a voltage to the human body and measuring the potential difference between two points on the head. I am particularly interested in how the measured potential difference changes with the frequency of the applied current. The frequency range I am considering is typically from about 10 kHz up to 100 kHz, but I am also exploring much lower frequencies, down to around 100 Hz. If you could kindly point me to relevant references or scientific literature that discuss similar applications or provide guidance on which dielectric properties are most suitable in this frequency range, it would be extremely helpful. Thank you again for your support.
  • 0 Votes
    1 Posts
    391 Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    brynB
    preview (still working on the distance from e.g. F7 to F9) [image: 1757340222351-c2ee64b1-55df-41d6-9583-bd5832ceb962-image.png]
  • 0 Votes
    2 Posts
    787 Views
    brynB
    To get the bounding box of some tissues, say Large_intestine_lumen Large_intestine_wall and test if some points are inside these tissues you can use the GetEntityPointDistance API, e.g., something like this: import numpy as np import s4l_v1.model as s4l_model Vec3 = s4l_model.Vec3 def sample_box(p1: Vec3, p2: Vec3) -> list[Vec3]: xs = np.linspace(p1[0], p2[0], 10) ys = np.linspace(p1[1], p2[1], 10) zs = np.linspace(p1[2], p2[2], 10) X, Y, Z = np.meshgrid(xs, ys, zs, indexing="ij") points = np.vstack([X.ravel(), Y.ravel(), Z.ravel()]).T return [Vec3(p) for p in points] def find_entities(root_group: s4l_model.EntityGroup, names: list[str]): entities = s4l_model.CollectEntities([root_group]) entities = [e for e in entities if e.Name in names] return entities if __name__ == "__main__": model_group = s4l_model.AllEntities()["Thelonious_6y_m_v3.1b02_posable"] entities = find_entities(model_group, ["Large_intestine_lumen", "Large_intestine_wall"]) p1, p2 = s4l_model.GetBoundingBox(entities) points = sample_box(p1, p2) inside_gi_tract = np.zeros(len(points), dtype=np.uint8) for entity in entities: distance = s4l_model.GetEntityPointDistance(entity, points) for idx, dist in enumerate(distance): # note: negative distance means inside the closed surface if dist.Distance <= 0.0: inside_gi_tract[idx] = True
  • Current density to CSV

    Python API
    1
    0 Votes
    1 Posts
    592 Views
    No one has replied
  • 0 Votes
    2 Posts
    916 Views
    B
    If simulations are queued indefinitely, this could be an indication of a license issue. To run a simulation, the solver needs to 'check out' a license feature from the license server. When it completes, it marks that license feature as available again. Sometimes, if the application were to crash for some reason, the license feature is not correctly marked as available, preventing other simulations from proceeding because they think the feature isn't currently available to checkout. To resolve this, one thing to try would be to stop and restart license software, or to reinstall the license to ensure that all license features are reset.
  • 0 Votes
    2 Posts
    866 Views
    B
    After creating the voxels for a simulation, the input file can be created without submitting the simulation by right-clicking on 'Solver' in the simulation configuration and selecting 'Write Input File'.
  • 0 Votes
    2 Posts
    913 Views
    B
    The Thickness Factor defines the thickness of the Piezo element and the Reflector as a fraction of the acoustic wavelength (determined from frequency and Speed of Sound). By default, n=10, so the fraction is 1/10. This is a parameter which should help to nicely design the SEFT such that it gets correctly voxeled later on (so not too thin) but also doesn't cover too much space (not too thick). Theoretically, the reflector and the active element can be as thin as a single cell layer, but you don't know the computational cell size when drawing the model. Since the voxeler is set to have a max step size of lambda/10, due to stability considerations, the Piezo and reflector will always be nicely and continuously voxeled when using the default Thickness Factor of 1/10. You can find more information about the Acoustic Solver, including relevant equations, in a thesis titled "Multi-Physics Computational Modeling of Focused Ultrasound Therapies", upon which the Acoustic Solver in Sim4Life is based.
  • 0 Votes
    2 Posts
    941 Views
    AntoninoMCA
    Dear @lorenero_99, Thank you for contacting us! Please have a read to my recent comment to this post, where I tried to be very detail in explaining how the current flux normalization works and what are the limitations. https://forum.zmt.swiss/topic/733/normalization-for-precise-current-control-via-jupyter/5 For what concerns the impedance, if you use the Ohmic-Current Dominated solver, the Ohmic laws apply and you can extract the resistance (impedance) knowing the applied voltages at the electrodes and the current through them. If you need further explanations, please do not hesitate to contact us immediately! All the best, Antonino
  • Inquiry Regarding TI Simulation Setup in Sim4Life

    Python API
    2
    0 Votes
    2 Posts
    706 Views
    SylvainS
    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: 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 :) 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) 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: 1756718002390-0c790cba-feab-4bf1-a1c2-c6c1b959649c-image.png] [image: 1756718129268-fdbe02f0-7b3a-4d2e-a68d-989752dd05a7-image.png]