UFF - Ultrasound File Format
Points
USTB.UFF.Point — TypePoint(r, θ, ϕ)Point contains the position of a point in a tridimensional space. It express that location in spherical coordinates which allows to place points at infinity but in a given direction.
The Julia implementation of the UFF Point type is a derivation of the CoordinateTransformations.jl Spherical type. The UFF Point defines the azimuth θ as the angle from the point location to the YZ plane. The elevation ϕ is the angle from the point location to the XZ plane.
USTB.UFF.PointFromCartesian — Type(::PointFromCartesian)(x::AbstractVector)Transformation functor to map 3D Cartesian coordinates into UFFs Point type. The conversion for $[x, y, z]$ is given by
\[\begin{aligned} r &= \sqrt{x^2+y^2+z^2} \\ \theta &= \text{atan}(x, z) \\ \phi &= \text{asin}(y, r) \end{aligned}\]
USTB.UFF.CartesianFromPoint — Type(::CartesianFromPoint)(x::Point)Transformation functor to map UFF Point into Cartesian coordinates. The conversion for $[r, \theta, \phi]$ is given by
\[\begin{aligned} x &= r\cdot\sin(\theta)\cdot\cos(\phi) \\ y &= r\cdot\sin(\phi) \\ z &= r\cdot\cos(\theta)\cdot\cos(\phi) \end{aligned}\]
Probe
USTB.UFF.Probe — TypeProbeProbe contains the position and attitude of all elements of a probe. Optionally PROBE can hold each element width and height, assuming the elements were rectangular. Information is stored in a single matrix form called geometry, one row per element containing: [x y z azimuth elevation width height]
Base.length — MethodReturn the number of elements in the Probe
Interfaces
Probe implements the Instance Properties interface from Base allowing to access specific properties of Probe easily, through the . operator.
Base.propertynames — FunctionImplement the property interface for the same variables used by MATLAB
Base.getproperty — MethodBase.getproperty(p::Probe, s::Symbol)Allow indexing by property, similar to MATLABs dependent get methods, getproperty is extended to allow getting the geometries columns by symbols for lookups. Available symbols and [aliases] for lookup are given by
:x = p.geometry[:, 1] # center of the element in the x axis[m]
:y = p.geometry[:, 2] # center of the element in the y axis[m]
:z = p.geometry[:, 3] # center of the element in the z axis[m]
:θ [:az, :azimuth] = p.geometry[:, 4] # orientation of the element in the azimuth direction [rad]
:ϕ [:alt, :elevation] = p.geometry[:, 5] # orientation of the element in the elevation direction [rad]
:w [:width] = p.geometry[:, 6] # element width [m]
:h [:height] = p.geometry[:, 7] # element height [m]
:r [:distance] = norm(p.geometry[:,1:3], dims=2) # Distance from elements to origin [m] Base.setproperty! — MethodSet property function
Property Interface Example
julia> a = Probe(Point([2,0,4]), rand(3,7));julia> a[:,1:3] = [1 2 3; 4 5 6; 7 8 9];julia> a.x3-element Vector{Float64}: 1.0 4.0 7.0julia> a.y = [10, 11, 12];julia> a.geometry3×7 Matrix{Float64}: 1.0 10.0 3.0 0.407818 0.359121 0.489465 0.182945 4.0 11.0 6.0 0.141045 0.741779 0.290317 0.0460081 7.0 12.0 9.0 0.361392 0.759326 0.371401 0.692036
Method delegations
Probe also forwards Base.size and Base.getindex to Probe.geometry, meaning size(p::Probe) and getindex(p::Probe,...) work as they do for matrices, but operate on Probe.geometry.
Base.size — MethodForwarded Base.size to Probe.geometry
Base.getindex — MethodForwarded Base.getindex to Probe.geometry
Base.setindex! — MethodForwarded Base.setindex! to Probe.geometry
Linear Array
Curvilinear Array
USTB.UFF.CurvilinearArray — Typemutable struct CurvilinearArray <: USTB.UFF.AbstractProbeArrayComposite type to define a curvilinear array probe geometry CurvilinearArray defines an array of regularly space elements on an arc in the azimuth dimensions. Optionally it can hold each element width and height, assuming the elements are rectangular.
Fields
probe::USTB.UFF.Probe: Wrapped probeN::Integer: Number of elements in arraypitch::Float64: Distance between the elements in the azimuth direction [m]radius::Float64: Radius of the curvilinear array [m]element_width::Float64: Width of the elements in the azimuth direction [m]element_height::Float64: Height of the elements in the elecation direction [m]
Example
prb = CurvilinearArray()
prb.N = 128;
prb.pitch = 500e-6;
prb.radius = 70e-3;TODO: Link up Probe
Wavefronts
USTB.UFF.Wavefront — ModuleWavefrontEnumeration for wave types. Exported through USTB.UFF submodule. Available options are
| Wavefront Type | Value |
|---|---|
| Plane | 0 |
| Spherical | 1 |
| Photoacustic | 1 |
See also WAVE
TODO: Cross link WAVE
USTB.UFF.Wavefront.Plane — ConstantWavefront instance describing a plane wave
USTB.UFF.Wavefront.Spherical — ConstantWavefront instance describing a spherical wave
USTB.UFF.Wavefront.Photoacustic — ConstantWavefront instance describing a photoacustic wave
Windows
USTB.UFF.Window — ModuleWindowEnumeration for window types. Available options and corresponding values are
| Window Type | Value |
|---|---|
| None | 0 |
| Boxcar | 1 |
| Flat | 1 |
| Rectangular | 1 |
| Hanning | 2 |
| Hamming | 3 |
| Tukey25 | 4 |
| Tukey50 | 5 |
| Tukey75 | 6 |
| Tukey80 | 7 |
| Sta | 7 |
| Scanline | 8 |
See also PULSE, BEAM, PHANTOM, PROBE
TODO: Link up PULSE
TODO: Link up BEAM
TODO: Link up PHANTOM
TODO: Link up PROBE