Skip to content

Analysis & Postprocessing

Postprocessing results

117 Topics 348 Posts
  • Simulation Combiner Channel Parameters

    2
    0 Votes
    2 Posts
    297 Views
    C
    If I understand correctly, you would like to have one simulation with a total current of 2.47mA and another one with 1.98mA. Sim4Life EQS solvers use Dirichlet boundary conditions for the electrodes (fixed voltage) as they solve for electric potential and electrode surfaces are assumed to be equipotential, hence the flux should be able to vary to ensure an equipotential surface. Moreover, when you check “Treat as port” for the LF solvers, you should be able to see in the log that they run 1 simulation per port, by setting this port to 1V and all the rest to 0V. With only 2 electrodes, and assuming you have one anode and one cathode, I would suggest the following: Assign Dirichlet boundary conditions to the electrodes (one setting per electrode, for instance 0.5V and -0.5V). Run the simulation Extract the total current of the simulation (select the "Overall Field" and use the "Current Extractor" from the ribbon). Normalize your fields of interest by the scaling factor: desired current/total current. Visualize the output of your normalized field. I hope this helps!
  • Normalization for precise current control via Jupyter

    5
    0 Votes
    5 Posts
    241 Views
    AntoninoMCA
    Dear @cbenj33 The automatic flux integrator (“Current Extractor”) works when it is possible to clearly separate an anode and a cathode. It is not suitable for cases with multiple sources. The reason is that the software chooses the isosurface for the numerical surface integral of the current density J as the surface where the potential equals the average between the two Dirichlet (voltage) boundary conditions. This default choice ensures that the surface is not too close to the electrodes, where the E- and J-field gradients are high, and where small discretization errors could lead to large uncertainties in the integrated flux. However, there is an option to adjust the isosurface to a different percentage of the potential difference. This setting—“Iso surface level as percentage of the potential difference”—lets you move the surface closer to one electrode (e.g., 10%) or the other (e.g., 90%). A value of 50% corresponds to the default midpoint. I do not recommend placing the surface too close to the electrodes for the reasons explained above. [image: 1755072017016-flux.png] The “Surface refinement” option allows you to increase the discretization density on the surface. You can perform a convergence analysis by refining the surface until the extracted current changes by only a few percent or less. That said, the user can also perform this operation manually. You can create any closed surface that encloses one electrode—or that divides the computational domain into two parts, each containing either the anode or the cathode—and use this surface to interpolate the J-field. After interpolation, the software provides the option to calculate the flux. I assume you are using the LF Ohmic Current dominated solver. Since you know the voltage applied between the contacts and the current through the electrode for that voltage, you can simply apply Ohm’s law to determine the voltage needed for a desired current. Alternatively, you can use the “Multiplier” function in the Field Data Tools to scale the E- or E-potential field to the desired current by applying the factor: scaling factor = I_desired/I_measured In my EM–neuronal coupled simulations, I usually use the multiplier method and link the neuronal simulation via the Analysis/Cache option in the source settings, selecting the multiplier applied to the E-potential. I hope this clears up your doubts. All the best!
  • 1 Votes
    2 Posts
    136 Views
    brynB
    Hi @Seifeldin_E I assume you’re referring to the second row, where the field is shown on the surface of the spinal cord and peripheral nerves. Here’s the simplest way to achieve this: In the Field Sensor, select Current Density. Add a Masking Filter: Set selection to None (deselect everything). Type Nerve in the search filter and activate all nerve structures. Search for the spinal cord and activate it as well. Add a Surface Viewer — this will extract the surface at the masked regions. How it works: The masking filter replaces all unselected field values with NaN (not-a-number). The surface viewer detects NaN values and extracts the surface surrounding the masked voxels. Alternative method (less robust): Drag a TriangleMesh entity (e.g., Spinal_cord) to the Analysis tab. Select Current Density and the spinal cord mesh (now in Analysis, apply the Model to Grid filter). Add the Interpolation filter. Add a Surface Viewer Be aware: if the field changes abruptly near the surface, this method may interpolate the field on the "wrong" side of the surface. That’s why the masking approach is usually more reliable and easier to use.
  • Extract EMLF Results via Jupyter

    9
    0 Votes
    9 Posts
    404 Views
    brynB
    The RestoreCamera function has a second argument animate=True. Setting this to False should fix your issue. If you are using s4l_v1.renderer.SaveScreenCapture to save an image of the scene in your script, you might need to give the GUI a chance to refresh during script execution. On Windows, you can do this with win32gui.PumpWaitingMessages() I typically do something like this def refresh_gui() if sys.platform == "win32": import win32gui win32gui.PumpWaitingMessages() for config in all_configurations: # change the model, run a simulation, change camera settings, etc. do_something(config) refresh_gui() s4l_v1.renderer.SaveScreenCapture( width=1024, height=1024, multi_sample=True, transparent_background=True, output_folder="C\temp\screenshots" output_prefix=f"subcase_{config}" )
  • How do I export multiple MATLAB files together?

    9
    0 Votes
    9 Posts
    1k Views
    M
    Hi there, I hope you can help, and that my questions fits within this thread. I have simulated an overall field and I would like to export it to matlab. At first I can live with the UI way i.e. by the import/export menu, but later I'd like to script it too. Now selecting e.g. the E-field and clicking the Imp/Export menu gives me no options but Import. Can anyone show the workflow? And/Or can anyone post a snippet of python code that does the export? Does exporting require a certain license?
  • 0 Votes
    1 Posts
    115 Views
    No one has replied
  • 1 Votes
    18 Posts
    6k Views
    L
    Hi, sorry to bother you. Do you happen to know how to calculate the current absorbed by the electrodes and the impedance?
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • can't connect ports

    2
    0 Votes
    2 Posts
    144 Views
    M
    I ran the simulation again. This time it ran completely. Physical results the same but without any errors, i.e. the analysis section could indeed connect ports. So is there a random seed thing and a voxeling issue after all?
  • Text Exporter 'NaN' error

    4
    0 Votes
    4 Posts
    175 Views
    H
    Please select the overall field and select the E field, then look under "Field Data Tools". Please "Go to the HTML manual" from "Help" and search for NaN filter. I would recommend using the latest version of Sim4Life v9.0. [image: 1753361215835-bc62f2dd-580a-4b6b-b11d-728454d14416-sim4life_xhh8cgbkwm.png]
  • Advanced Masking of Fields

    1
    0 Votes
    1 Posts
    97 Views
    No one has replied
  • Platform crashes

    5
    0 Votes
    5 Posts
    814 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
  • Fractional Anisotropy and Max Eigen vector from DTI

    2
    0 Votes
    2 Posts
    374 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)
  • MATCH returns switched values

    3
    0 Votes
    3 Posts
    563 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.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • Normal vector to a tissue surface

    2
    0 Votes
    2 Posts
    409 Views
    H
    [image: 1736961843959-327c9ace-0099-4e59-b102-4a34c31e609c-sim4life_fxfwepw8sg.gif] to extract the inner normal vector to the cortical surface mask the field (set NaN outside GM) using the Mask Filter available under "Field Data Tools" in the top ribbion. add the Grey Matter Surface in the post-pro interpolate the (masked) field to the grey matter surface using the "Interpolator" which is active when the masked field and surface is selected. get the normal component via the NormalFieldEvaluator under the "Field Data Tools"
  • How do we put electrodes on the skin surface?

    16
    0 Votes
    16 Posts
    3k Views
    G
    @bryn @gc00 @halder Thank you so much, You've been very helpful !
  • Export large files to matlab

    3
    0 Votes
    3 Posts
    896 Views
    L
    @ofli Can the conductivity map after head segmentation be exported?
  • Problems when simulating antenna efficiency

    2
    0 Votes
    2 Posts
    426 Views
    SylvainS
    Hi, you can get additional information by enabling the "Far Field" sensor and then choosing the "Radiation Report" evaluator (see for example the Phased Array Patch Antenna tutorial). It will not solve your problem, but might help you get a clearer picture. From what you describe, it's possible you have a very low mismatch efficiency (most of the energy is reflected). This could be addressed by improving the way you are modeling your source, or by just ignoring it if it is not important (i.e. if you are not actually simulating the real feed and are only interested in the antenna itself). You would do that by considering the Radiation Efficiency (ratio of Radiated Power to Accepted Power) instead.