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. Simulate a concave multi-element ultrasound array

Simulate a concave multi-element ultrasound array

Scheduled Pinned Locked Moved Sim4Life
4 Posts 2 Posters 829 Views
  • 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.
  • A Offline
    A Offline
    Andrew.yukai
    wrote on last edited by
    #1

    How can I create a spherically concave multi-element random ultrasound array in the Sim4Life acoustic simulation platform? The template acoustic apertures in the Sim4Life does not include the spherical concave model. How can I customize the element arrangement using X, Y and Z coordinates? Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      montanaro
      wrote on last edited by
      #2

      The easiest way would be to design it yourself and automate it via python (create spheres and cylinders and use the binary operations to 'subtract' them from one another until you have the geometry you want). Let me know if you need some support with this and I can help.

      If I remember correctly the SEFT tutorial python script shows a similar method to create the SEFT (single element curved transducer) transducer from scratch

      A 1 Reply Last reply
      0
      • M montanaro

        The easiest way would be to design it yourself and automate it via python (create spheres and cylinders and use the binary operations to 'subtract' them from one another until you have the geometry you want). Let me know if you need some support with this and I can help.

        If I remember correctly the SEFT tutorial python script shows a similar method to create the SEFT (single element curved transducer) transducer from scratch

        A Offline
        A Offline
        Andrew.yukai
        wrote on last edited by
        #3

        @montanaro Hi Montanaro, I have created a spherically concave surface as you instructed for simulating multi-element ultrasound. Would you please advise how I can assign 128 ultrasound elements to this customized concave surface?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          montanaro
          wrote on last edited by admin
          #4

          Assuming 'sim' is the acoustic simulation you're interested in and that 'elements' is a list of the elements (gotten from entities = model.AllEntities()) and that 'amp' and 'phase' are numpy arrays with the amplitude, phase values you're interested in assigning:

          # Print current simulation name
          print(sim.Name)
          
          # Remove all sources before adding them
          to_del = []
          for s in sim.AllSettings:
          	if isinstance(s,acoustic.SourceSettings):
          		to_del.append(s)
          for d in to_del:
          	sim.Remove(d)
          
          # Add sources with correct element and parameters
          for source_idx in np.arange(len(elements)):
          	source_settings = acoustic.SourceSettings()
          	source_settings.Amplitude = amp[source_idx]
          	source_settings.Phase = phases[source_idx]
          	sim.Add(source_settings, rings[source_idx])
          	print(rings[source_idx].Name, amp[source_idx], phases[source_idx])
          

          Sorry I'm not providing a full example. Easiest way to do that would be to manually create the whole simulation without the sources (just make all sources as materials), then right click on simulation and select 'To Python...' and then add the lines above to your code

          You could do something like this to get the elements as a list:

          src_ents = []
          entities = model.AllEntities()
          for e in entities:
              if 'Element' in e.Name:
                  src_ents.append(e)
          

          Careful, I have no idea how the elements will be sorted in that case but you could use a fixed size numerical suffix and then sort them.

          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