Skip to content
  • 2 Votes
    2 Posts
    983 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

    Analysis & Postprocessing
    9
    0 Votes
    9 Posts
    2k 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}" )
  • 0 Votes
    18 Posts
    4k Views
    brynB
    your code is still not using the FieldInterpolationFilter to interpolate the T1w image onto the same grid as the E-field. Note, the FieldDataTextExporter takes the output of the interpolator as input
  • 0 Votes
    9 Posts
    3k 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?
  • Source pulse parameter on EM-LF simulation on Yoon-son model

    Unsolved T-Neuro
    5
    0 Votes
    5 Posts
    2k Views
    brynB
    @viniltc, the error looks like you do not have a simulation called "Simple ES" (the returned simulation is None). Please double-check the name, including white-spaces. You can also access by index (document.AllSimulations[0]).
  • XCore.CLog error

    Simulations & Solvers
    2
    0 Votes
    2 Posts
    998 Views
    brynB
    it seems to happen (in Sim4Life 9.0.0) when you switch to the analysis tag after sending a solver job on the cloud. I guess it can be ignored and will be fixed in an upcoming update-fix release
  • 0 Votes
    4 Posts
    2k Views
    C
    Hi, Did you run your simulation using our SMALL server (16 CPU cores, 32 GB RAM) or the LARGE server (48 CPU cores, 96 GB RAM)? Also, could you let us know the total number of cells in your simulation? As a general suggestion for optimizing memory usage, you can start by running a simulation with a coarse grid to identify regions where the fields are negligible. Based on this, you can adjust the grid padding settings to exclude those body regions from the simulation domain, effectively "cropping" unnecessary areas and reducing the computational load.
  • Missing Material Database

    Installation & Licensing
    3
    0 Votes
    3 Posts
    983 Views
    brynB
    I believe the Materials.db) is copied from C:\Program Files\Sim4LIfe XYZ\data\... when you first run Sim4Life.exe
  • 1 Votes
    18 Posts
    9k Views
    L
    Hi, sorry to bother you. Do you happen to know how to calculate the current absorbed by the electrodes and the impedance?
  • can't connect ports

    Analysis & Postprocessing
    2
    0 Votes
    2 Posts
    981 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?
  • 0 Votes
    2 Posts
    1k Views
    M
    I used it to get information for high level workflows. It can also come with suggestions for code, obviously, but it often invents functions that don't exist and implementations for me has not been very AI-powered. But the theoretical discussions are quite good.
  • 0 Votes
    2 Posts
    695 Views
    C
    Here is the Web Manual section containing this information: 2.11.3.9 Neuro-stimulation with Imperfect Electrode-Skin Contact. Additionally, Yoon-Sun Arm Stimulation tutorial also includes this new feature. For more information or examples you can contact us at s4l-support@zmt.swiss. Thanks!
  • Text Exporter 'NaN' error

    Analysis & Postprocessing
    4
    0 Votes
    4 Posts
    1k 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]
  • Help with Petri Dish Geometry & Boolean Subtract Issue

    CAD Modeling
    2
    0 Votes
    2 Posts
    646 Views
    H
    I recommend checking out the “Multiple Electrode in Homogeneous Medium” tutorial in the LF section. It includes a Petri dish with solution in the modeling part, which is directly relevant. You're absolutely right about the importance of the Boolean Subtract order. To ensure it works correctly, try the following setup: (1) Outer Cylinder: Radius = 18 mm, Height = 11 mm, Base at Z = 0 mm (2) Inner Cylinder: Radius = 17 mm, Height = 10.7 mm, Base at Z = 1 mm (i.e., shifted +1 mm in Z) (3) Perform Boolean Subtract: Outer minus Inner This setup should produce the correct bowl shape.
  • 0 Votes
    1 Posts
    626 Views
    No one has replied
  • 0 Votes
    2 Posts
    879 Views
    C
    I would suggest first cloning the nerve trajectory, and then discretizing it. The result is an unlocked axon model. You can then delete the nerve trajectory clone if needed.
  • Sim4Life V9.0 Release

    Announcements
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Advanced Masking of Fields

    Analysis & Postprocessing
    1
    0 Votes
    1 Posts
    638 Views
    No one has replied
  • Export to CSV file

    Python API
    3
    0 Votes
    3 Posts
    1k Views
    K
    The problem has been resolved! Thank you for your assistance!
  • 2 Votes
    4 Posts
    1k Views
    R
    @bryn ahh, I see. Thank you so much!