Materials
AttenuationConstant
dataclass
The parameters of the attenuation constant.
calculate_absorption(frequency)
Calculate the absorption coefficient for a given center frequency.
The absorption coefficient is calculated using the following formula
α(f) = α0 * f^b
We convert the absorption coefficient from Np/m/Hz to dB/m/Hz multiplying it by 8.6860000037.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frequency |
float
|
in Hz |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
attenuation in dB/cm/MHz |
Material
dataclass
Bases: _BaseMaterial
An NDK Material with an attenuation coefficient.
to_struct()
Return a Struct representation of the material.
Returns:
Name | Type | Description |
---|---|---|
Struct |
Struct
|
a Struct representation of the material. |
get_material(material_name, center_frequency=500000.0)
Get a material with properties used in the neurotechdevkit scenarios.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
material_name |
str
|
the name of the material. E.g. "water" |
required |
center_frequency |
float
|
The center frequency of the transducer. Defaults to 5.0e5. |
500000.0
|
Raises:
Type | Description |
---|---|
ValueError
|
raised if the material is not supported. |
Returns:
Name | Type | Description |
---|---|---|
Material |
Material
|
a material with properties used in the neurotechdevkit. |
get_render_color(material_name)
Get the render color for a material.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
material_name |
str
|
the name of the material. E.g. "water" |
required |
Raises:
Type | Description |
---|---|
ValueError
|
raised if the material is not supported. |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the render color of the material. |