Skip to content
  • 0 Votes
    8 Posts
    1k Views
    brynB
    You could probably export (XPostProcessor.VtkExporter or XPostProcessor.VtkXmlExporter, not sure it is in s4l_v1) it as a VTK file and modify your neural network DataLoader to support VTK files, e.g., via the meshio package or the much larger vtk package, or many others. Or you could write a little Python script to grab the field data and save it to npy. To access the field, you would get the output of the extractor or pipeline entity in the analysis, say a FloatFieldData object. It has a Field(self, index: int) -> np.ndarray method to get the field as a numpy array, which you could save using e.g., np.save("filename.npy", fd.Field(0))
  • ViP Shells for Sim4Life Users

    Anatomical Models
    4
    0 Votes
    4 Posts
    1k Views
    V
    That's helpful. Thank you for the detailed steps @bryn.
  • Determine distance between bones and Antenna

    Anatomical Models
    2
    0 Votes
    2 Posts
    524 Views
    brynB
    To measure the shortest distance between two entities, you can use the Python API: import XCoreModeling as xcm shell = xcm.GetActiveModel().SelectedEntities[0] coil = xcm.GetActiveModel().SelectedEntities[1] res = xcm.GetEntityEntityDistance(shell, coil) print(f"Shortest distance shell-coil: {res[0].Distance}") p1 = xcm.CreatePoint(res[0].ClosestPosition) p1.Name = "Point on Shell" p2 = xcm.CreatePoint(res[1].ClosestPosition) p2.Name = "Point on Coil" # This line is just to visualize where the measured distance was taken line = xcm.CreatePolyLine([res[0].ClosestPosition, res[1].ClosestPosition]) This would create something like this: [image: 1747752108672-c17b7bff-2d64-408c-88a7-fd83a4dadfdb-image.png] Some other snippets are shared here: https://forum.zmt.swiss/topic/565/geometry-modeling-snapping-to-endpoints-in-python-api/3?_=1747746585465
  • Surface projection tool

    CAD Modeling
    3
    1 Votes
    3 Posts
    385 Views
    V
    @brown Thank you for the suggestion. I can surface project object now.
  • Platform crashes

    Analysis & Postprocessing
    5
    0 Votes
    5 Posts
    647 Views
    A
    Hi, Sorry to bother You. IN ATTACHED VIDEO SHOWS WHAT HAPPENS AFTER CLICKING THE OPTION "CREATE PLOT" AND THE SYSTEM CRASHES. The workstation and memory have been tested, all without errors. Can one of the service engineers help? Kind regards, Thank you, Andrei Andrei Churakov MD,PhD, Associate Professor of the Department of Electronic Engineering and Technology BSUIR E-mail: anchurakov@bsuir.by
  • 0 Votes
    2 Posts
    285 Views
    brynB
    This question is quite old. Maybe you found a solution? Otherwise I guess you could use one of these options: you can crop the field, e.g. via the bounding box (or the extent if you have an E-field on a rectilinear grid) you could use the interpolation filter: define your little box grids, and interpolate from the field sensor field to your box grids you could define small field sensors in the simulation setup (not sure it is scalable to hundreds of sensors)
  • "wire radius"

    Simulations & Solvers
    2
    0 Votes
    2 Posts
    305 Views
    brynB
    Please give more context. E.g., "in the modeler when I use tool X", or in a "Y simulation" there is an option. or in this other thread (link) I asked about Z Then it will be easier to answer your question.
  • impossible drag and drop from non-CAD models

    CAD Modeling
    4
    0 Votes
    4 Posts
    802 Views
    brynB
    For the unstructured version of the EM LF Electro you would first need to generate a tetrahedral mesh. The mesh can be dragged onto such a simulation.
  • 0 Votes
    3 Posts
    427 Views
    brynB
    I would add that in the first approach you might change the tissue property of the original bladder to something else, e.g. fat, to get the desired effect of shrinking or stretching the bladder without creating air holes. Btw, you can measure the volume of a tissue surface in the modeler using the measure tool.
  • 0 Votes
    2 Posts
    354 Views
    C
    Are you able to run other NEURON tutorials (the pre-build versions)? If not then this issue could be related to the NEURON installation or version. It is possible that using an older version of the NEURON solver is causing the error you mentioned. Please make sure you have the correct version of NEURON installed in your Sim4Life folder. For instance, as you are using Sim4Life version 8.2.0.16876, you should download NEURON using NEURON_setup_8.2.0.16876.exe.
  • License Setup for iSolve on Linux

    Installation & Licensing
    2
    0 Votes
    2 Posts
    360 Views
    G
    Did you do one of the following: • Define the FlexNet environment variable FLEXID_LIBRARY_PATH to point to the location of the dongle shared object, libhasp_linux_x86_64.so. • Define the system environment variable LD_LIBRARY_PATH to point to the location of the dongle shared object libhasp_linux_x86_64.so. ? Could you try to send us the output of lmhostid -flexid? that command should return the dongle id. You can also access the dongle firmware - if it is correctly installed - via the loopback address. On a browser, go to http://localhost:1947/ you should see the characteristics of the dongle. Let us know if it works.
  • MATCH returns switched values

    Analysis & Postprocessing
    3
    0 Votes
    3 Posts
    443 Views
    ofliO
    Hi @parsley, Thank you for your feedback and for reporting the issue you experienced. The MATCH tool has already been successfully used/validated by many users and offers several useful features. For example, it allows users to add loading or matching circuits the S-matrix of a simulation and obtain updated scattering parameters without re‑running the full simulation. Have you experienced any problems with this particular workflow? From the information you provided, the issue appears to be related to only the Initial Matching function—the option that generates a matching circuit for a given S-matrix of a simulation at a chosen target frequency. In your case, you reported that it worked with the dipole antenna example but not with your specific antenna model. We would be happy to discuss the details so we can reproduce the problem and resolve it quickly. We will contact you to find out a convenient time to follow up. Thank you again for bringing this to our attention.
  • AttributeError: 'NoneType' object has no attribute 'Results'

    Python API
    2
    0 Votes
    2 Posts
    340 Views
    SylvainS
    Hi, You would get that error if there was no simulation named "0_17_35_29" in the currently opened document. Maybe you should check what simulations you have in your project and if you do have a simulation with that name? One way to list all simulation names via python is to run something like: for s in document.AllSimulations: print(s.Name)
  • 2 Votes
    1 Posts
    206 Views
    No one has replied
  • Start the Linux licensing daemon failed

    Installation & Licensing
    7
    0 Votes
    7 Posts
    1k Views
    G
    This looks like the drivers for the dongle are missing or have not been installed. Did you check the manual on how to install drivers for Linux? Also, it would help if you send us the full log. You can do that by emailing us at: s4l-support-group@zmt.swiss Regards, Guillermo
  • Sim4Life update v8.2

    Installation & Licensing
    2
    0 Votes
    2 Posts
    351 Views
    ofliO
    Hi gc00, Apologies for late response. Do you still have the issue you reported above?
  • Modulated source in thermal simulation

    Simulations & Solvers
    3
    1 Votes
    3 Posts
    429 Views
    P
    @Sylvain Hi, thank you for your reply. I changed modulated field to El. Loss Density and everything works.
  • 0 Votes
    19 Posts
    3k Views
    L
    @halder When I performed TI simulation using the spherical model, I found that if I changed the current direction of one pair of electrodes, the maximum value of the TI Max (x, y, z) slice remained unchanged. Changing the current of one pair of electrodes should have shifted from the original same-direction superposition to a reverse weakening, so why does it remain unchanged? Is it because Max Modulation only uses EM for calculations?
  • Thermal, unable to write input files.

    Simulations & Solvers
    7
    0 Votes
    7 Posts
    848 Views
    R
    Thank you. Uploaded.
  • Access data directly

    Python API
    2
    0 Votes
    2 Posts
    317 Views
    H
    Hi, you can try something like the following to extract the reflection coefficient. You can always try to build extraction manually once and select "To python" by right-clicking on the end of the tree (i.e. the component you extract from your pipeline) import numpy import s4l_v1.analysis as analysis import s4l_v1.document as document import s4l_v1.model as model import s4l_v1.units as units from s4l_v1 import ReleaseVersion from s4l_v1 import Unit sim_name = "MRI Volume Coil Cleg = 29.5 pF" ###### define the sim name in this case this is a multiport FDTD simulation Adding a new EmMultiPortSimulationExtractor simulation = document.AllSimulations[sim_name] em_multi_port_simulation_extractor = simulation.Results() this is extracting a port inputs = [em_multi_port_simulation_extractor.Outputs["MRI Volume Coil Cleg = 29.5 pF - Endring source 1 (Birdcage 1)"]] em_port_simulation_extractor = analysis.extractors.EmPortSimulationExtractor(inputs=inputs) em_port_simulation_extractor.Name = "MRI Volume Coil Cleg = 29.5 pF - Endring source 1 (Birdcage 1)" em_port_simulation_extractor.UpdateAttributes() document.AllAlgorithms.Add(em_port_simulation_extractor) em_sensor_extractor = em_port_simulation_extractor["Endring source 1 (Birdcage 1)"] document.AllAlgorithms.Add(em_sensor_extractor) ref_coef_data = em_sensor_extractor.Outputs["Reflection Coefficient(f)"] ref_coef_data.Update() freqlist = ref_coef_data.Data.Axis ref_coef = refCoeff.Data.GetComponent(0) ref_coef_magnitude = np.sqrt(np.real(ref_coef)**2 + np.imag(ref_coef)**2) import matplotlib.pyplot as plt plt.plot(freqlist,ref_coef_magnitude)