Skip to content

Note

Click here to download the full example code

Adding multiple sources

Note

NDK and its examples are under constant development, more information and content will be added to this example soon!

Adding multiple sources for transcranial ultrasound stimulation enables greater precision and control in targeting specific areas of the brain.

By choosing the phase of ultrasound waves for each source, a combined beam can be created that is focused on the desired target precisely. This allows for complex wave patterns that open up new possibilities for therapies.

Out:

Estimated time to complete simulation: 2 minutes. Memory required is 27.853101606717864 GB (available 73.624408064 GB). These values are approximated.
/home/circleci/.cache/pypoetry/virtualenvs/neurotechdevkit-3aSsmiER-py3.10/lib/python3.10/site-packages/devito/finite_differences/differentiable.py:224: DeprecationWarning: NotImplemented should not be used in a boolean context
  return super(Differentiable, self).__eq__(other) and\
/home/circleci/.cache/pypoetry/virtualenvs/neurotechdevkit-3aSsmiER-py3.10/lib/python3.10/site-packages/devito/finite_differences/differentiable.py:224: DeprecationWarning: NotImplemented should not be used in a boolean context
  return super(Differentiable, self).__eq__(other) and\
gcc -O3 -g -fPIC -Wall -std=c99 -march=native -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -fopenmp /tmp/devito-jitcache-uid1001/284ade1f61cfd35c1dc7508ee5c551ecfab22af0.c -lm -o /tmp/devito-jitcache-uid1001/284ade1f61cfd35c1dc7508ee5c551ecfab22af0.so
/home/circleci/project/src/neurotechdevkit/rendering/_animations.py:118: UserWarning: You passed in an explicit save_count=142 which is being ignored in favor of frames=142.
  anim = FuncAnimation(


import neurotechdevkit as ndk

scenario = ndk.built_in.Scenario0()

s1 = ndk.sources.FocusedSource2D(
    position=[0.01, 0.0],
    direction=[0.92, 0.25],
    aperture=0.01,
    focal_length=0.022,
    num_points=1000,
)

s2 = ndk.sources.FocusedSource2D(
    position=[0.04, -0.002],
    direction=[-0.85, 0.35],
    aperture=0.01,
    focal_length=0.011,
    num_points=1000,
    delay=5.1e-6,
)

scenario.sources = [s1, s2]
scenario.make_grid()
scenario.compile_problem()
result = scenario.simulate_pulse()
assert isinstance(result, ndk.results.PulsedResult2D)
result.render_pulsed_simulation_animation()

Total running time of the script: ( 1 minutes 54.507 seconds)

Download Python source code: plot_multiple_sources.py

Download Jupyter notebook: plot_multiple_sources.ipynb

Gallery generated by mkdocs-gallery