Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. Exporting Simulation Results for Specific Tissues

Exporting Simulation Results for Specific Tissues

Scheduled Pinned Locked Moved Python API
2 Posts 1 Posters 419 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sayimgokyar
    wrote on last edited by
    #1

    I am trying to export my simulation results (B1 and SAR) to mat files. In order to save disk space, I want to discard some materials (Background, Coil, Shield etc). I am using the following python script to implement field_mask_filter. When I set ent1='Heart_lumen', I can extract the field results for Heart Lumen only. But, I have 357 entities :). I just want to discard PEC and Background regions, but keep all the other materials in my exports. What is the correct way of coding this?
    More specifically, I need learn how to use SetMaterial function for this filter:
    field_masking_filter_B1.SetMaterial(['Background'], False)
    I tried plenty of combinations for the input arguments but not able to figured it out.
    Thanks for your help in advance.

    ents = model.AllEntities()
    ent1 = 'Heart_muscle'
    ent2 = 'Heart_lumen'
    ent3 = 'Coil'
    ent4 = 'RF Shield'
    ent5 = 'Background'

    # Adding a new FieldMaskingFilter for B1
    inputs = [em_multi_port_sensor_combiner.Outputs["B1(x,y,z,f0)"]]
    field_masking_filter_B1 = analysis.core.FieldMaskingFilter(inputs=inputs)
    field_masking_filter_B1.Name = "B1-Mask"
    field_masking_filter_B1.SetAllMaterials(False)
    # field_masking_filter_B1.SetMaterial(ents['Heart_lumen'], False)
    field_masking_filter_B1.SetEntities([ents[ent1]])
    field_masking_filter_B1.SetEntities([ents[ent2]])
    field_masking_filter_B1.UpdateAttributes()
    field_masking_filter_B1.Update()
    document.AllAlgorithms.Add(field_masking_filter_B1)
    
    S 1 Reply Last reply
    0
    • S sayimgokyar

      I am trying to export my simulation results (B1 and SAR) to mat files. In order to save disk space, I want to discard some materials (Background, Coil, Shield etc). I am using the following python script to implement field_mask_filter. When I set ent1='Heart_lumen', I can extract the field results for Heart Lumen only. But, I have 357 entities :). I just want to discard PEC and Background regions, but keep all the other materials in my exports. What is the correct way of coding this?
      More specifically, I need learn how to use SetMaterial function for this filter:
      field_masking_filter_B1.SetMaterial(['Background'], False)
      I tried plenty of combinations for the input arguments but not able to figured it out.
      Thanks for your help in advance.

      ents = model.AllEntities()
      ent1 = 'Heart_muscle'
      ent2 = 'Heart_lumen'
      ent3 = 'Coil'
      ent4 = 'RF Shield'
      ent5 = 'Background'

      # Adding a new FieldMaskingFilter for B1
      inputs = [em_multi_port_sensor_combiner.Outputs["B1(x,y,z,f0)"]]
      field_masking_filter_B1 = analysis.core.FieldMaskingFilter(inputs=inputs)
      field_masking_filter_B1.Name = "B1-Mask"
      field_masking_filter_B1.SetAllMaterials(False)
      # field_masking_filter_B1.SetMaterial(ents['Heart_lumen'], False)
      field_masking_filter_B1.SetEntities([ents[ent1]])
      field_masking_filter_B1.SetEntities([ents[ent2]])
      field_masking_filter_B1.UpdateAttributes()
      field_masking_filter_B1.Update()
      document.AllAlgorithms.Add(field_masking_filter_B1)
      
      S Offline
      S Offline
      sayimgokyar
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Search