Skip to content
  • Normal vector to a tissue surface

    Analysis & Postprocessing
    2
    0 Votes
    2 Posts
    948 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"
  • Evaluation of head segmentation quality

    Anatomical Models
    7
    0 Votes
    7 Posts
    2k Views
    G
    Okay, I will take those considerations into account. Thanks for the fast reply!
  • 0 Votes
    1 Posts
    473 Views
    No one has replied
  • How to suppress messages in the Python console?

    Python API
    2
    0 Votes
    2 Posts
    1k Views
    L
    As far as I'm aware it is not possible to suppress those messages. Maybe try writing your customized messages into a log file instead?
  • How to create voxels using a script?

    Python API
    2
    0 Votes
    2 Posts
    1k Views
    L
    Hi! In all the tutorial python scripts this is shown. Within the python scripter you can click on the folder icon and choose "Open Example Script". There you will find lots of python scripts, that show how this is done. Here a small excerpt from the script "tutorial_emlf_parallel_plate.py": sim = CreateSimulation() s4l_v1.document.AllSimulations.Add(sim) sim.UpdateGrid() sim.CreateVoxels(path) sim.RunSimulation(wait=True) I suggest always creating a simulation, and an analysis function, that is then called in the RunTutorial function. It's best to then also create a main: def RunTutorial( path ): import s4l_v1.document s4l_v1.document.New() CreateModel() sim = CreateSimulation() s4l_v1.document.AllSimulations.Add(sim) sim.UpdateGrid() sim.CreateVoxels(path) sim.RunSimulation(wait=True) AnalyzeSimulation(sim) def main(data_path=None, project_dir=None): """ data_path = path to a folder that contains data for this simulation (e.g. model files) project_dir = path to a folder where this project and its results will be saved """ import sys import os print("Python ", sys.version) print("Running in ", os.getcwd(), "@", os.environ['COMPUTERNAME']) if project_dir is None: project_dir = os.path.expanduser(os.path.join('~', 'Documents', 's4l_python_tutorials') ) if not os.path.exists(project_dir): os.makedirs(project_dir) fname = os.path.splitext(os.path.basename(_CFILE))[0] + '.smash' project_path = os.path.join(project_dir, fname) RunTutorial( project_path ) if __name__ == '__main__': main()
  • import element inside a group using python

    Python API
    5
    0 Votes
    5 Posts
    2k Views
    M
    Thank you, I could obtain the same also using this: analysis.exporters.MatlabExporter.ExportTo(matlab_exporter,matlab_exporter.FileName) Do you think it is a good solution as well?
  • How to get inhomogeneous B0 maps

    Unsolved Simulations & Solvers
    1
    0 Votes
    1 Posts
    297 Views
    No one has replied
  • python script to run in the cloud

    Python API
    1
    0 Votes
    1 Posts
    427 Views
    No one has replied
  • 1 Votes
    30 Posts
    34k Views
    L
    @bryn Is the 6.8 displayed on the color bar the actual maximum field strength value? I exported the values and found that the maximum is around 5.9 instead. [image: 1735124755536-42fb974e-d830-42c2-8373-84c85ee63339-image.png]
  • How do we put electrodes on the skin surface?

    Analysis & Postprocessing
    16
    0 Votes
    16 Posts
    5k Views
    G
    @bryn @gc00 @halder Thank you so much, You've been very helpful !
  • 0 Votes
    1 Posts
    688 Views
    No one has replied
  • Is it possible to use Python API without opening Sim4Life?

    Python API
    4
    0 Votes
    4 Posts
    2k Views
    brynB
    You can open a smash file using import s4l_v1 as s4l s4l.document.Open(smash_file_path) You can save it using s4l.document.Save(smash_file_path) You can find a simulation using (assuming you have unique simulation names sim = [sim for sim in s4l.document.AllSimulations if sim.Name == "the name of your simulation"][0] If you want to load different models (from .sab file or .smash), but don't need to load e.g. simulations (in .smash file), you can import the file entities = s4l.model.Import(file_path) if you need to reset the document or model because you are accumulating too many entities and memory use is getting too high, you can use e.g. # reset the model sl4.model.Clear() # or keep entities, but discard model history import XCoreModeling as xcm xcm.GetActiveModel().ClearHistory() # or reset entire document (reset model, simulations, analysis) s4l.document.New()
  • Head tissue segmentation

    Anatomical Models
    1
    0 Votes
    1 Posts
    514 Views
    No one has replied
  • Brain atlas

    Anatomical Models
    1
    0 Votes
    1 Posts
    493 Views
    No one has replied
  • Location of Simulation Outputs and Voxel Coordinates?

    Python API
    1
    0 Votes
    1 Posts
    304 Views
    No one has replied
  • Export large files to matlab

    Analysis & Postprocessing
    3
    0 Votes
    3 Posts
    2k Views
    L
    @ofli Can the conductivity map after head segmentation be exported?
  • About TI Simulation

    Python API
    4
    0 Votes
    4 Posts
    995 Views
    L
    I want to see the impact of different grid sizes on the simulation, so I cloned a pair of simulations and modified the maximum step size of the grid. However, I found that if I create a new pair of simulations using the same settings, the grid sizes, simulation durations, and results of the new simulations and the cloned simulations are all different. Why does this happen?
  • Volt and sensitivity of transducer sim4lite

    Sim4Life
    2
    0 Votes
    2 Posts
    1k Views
    M
    Assuming a linear relation between voltage and pressure amplitude, you should be able to map the input voltage to the input pressure (I think its 1 MPa by default), and then use this as a scaling factor, but it's unclear to me what you mean with voltage at the focused area. What exactly do you mean by transducer sensitivity? You could run additional simulations where you shift the transducer or slightly change some parameters to get a sense of the sensitivity.
  • Simulation outputs

    Simulations & Solvers
    6
    0 Votes
    6 Posts
    1k Views
    A
    Great! Goit it, thank you so much. One last question regarding where the simulation outputs are located and saved. The coordinates of the voxelized entities where can be found? Thank you so much for your time :)
  • White matter anisotropy

    Simulations & Solvers
    8
    0 Votes
    8 Posts
    2k Views
    G
    @bryn Thanks, I found it!