![]() |
ImFusion SDK 4.3
|
#include <ImFusion/US/GlSweepReconstruction.h>
Reconstruction of pixel data of one or multiple UltrasoundSweep image sets into an arbitrary 2D frame in 3D space. More...
Inheritance diagram for GlSweepReconstruction:Reconstruction of pixel data of one or multiple UltrasoundSweep image sets into an arbitrary 2D frame in 3D space.
This class tries to sample from all the sweep's 2D frames positioned in space in an optimal way to efficiently reconstruct a single 2D image without streaks. It is needed everywhere in the framework where image information is sampled in 3D space regardless of where the underlying 2D frames of the (freehand) UltrasoundSweep are located. As such, it is - among others - used in the framework to:
This class performs the inverse operation of VolumeReslicingAlgorithm.
Fundamentally, there are two GPU-based reconstructions available:
DUAL mode blends between these two.Example for rendering into an MPR view:
Classes | |
| struct | FourCorners |
Public Types | |
| enum | Mode { ORTHOGONAL = 0 , PARALLEL = 1 , DUAL = 2 , BACKWARD_COMPOUNDING = 3 } |
| Enumeration of possible reconstruction modes. More... | |
Public Member Functions | |
| GlSweepReconstruction () | |
| Constructor, which does not initialize shaders and working variables yet. | |
| void | setSweep (const UltrasoundSweep *sweep, const Selection *sel=0) |
| Set the freehand sweep data and optional selection. | |
| void | setSweeps (const std::vector< const UltrasoundSweep * > &sweeps) |
| Set multiple sweeps to render. | |
| Mode | mode () const |
| Returns the reconstruction mode. | |
| void | setMode (Mode mode) |
| Set the reconstruction mode. | |
| double | thickness () const |
| Returns the slice thickness (mm) in backward compounding mode; 0 if using automatic setting. | |
| void | setThickness (double value) |
| Sets the slice thickness (mm) in backward compounding mode; set to 0 to use automatic setting. | |
| bool | nearestNeighbor () const |
| Returns the flag whether to use nearest neighbor interpolation. | |
| void | setNearestNeighbor (bool value) |
| Sets the flag whether to use nearest neighbor interpolation. | |
| bool | encodeDistToBorder () const |
| Returns the flag whether to encode the distance to the border into the second FBO attachment. | |
| void | setEncodeDistToBorder (bool value) |
| Sets the flag whether to encode the distance to the border in into the second FBO attachment. | |
| bool | encodeAngleInformation () const |
| Returns the flag whether to write out angle between US frame and render slice into the third FBO attachment. | |
| void | setEncodeAngleInformation (bool value) |
| Sets the flag whether to write out angle between US frame and render slice into the third FBO attachment. | |
| void | setMaxDistance (double dist) |
Sets the maximum distance between slices to render if dist is positive, otherwise uses automatic setting (10% of max. sweep extent) | |
| void | renderSlice (const GL::ViewState &viewState, const Slice &slice) |
| Render a 2D slice specified by the given matrix using default display options. | |
| void | renderSlice (const GL::ViewState &viewState, const Slice &slice, const DisplayOptions2d &displayOptions) |
| Render a 2D slice specified by the given matrix using the given display options. | |
Protected Member Functions | |
| void | updateOrthogonal (const Slice &s) |
| Update the orthogonal reconstruction. | |
| void | updateParallel (const GL::ViewState &viewState, const Slice &s, const DisplayOptions2d &displayOptions) |
| Update the parallel reconstruction. | |
| void | updateParallelDrawSlices (const Slice &slice, int unit=0) |
| Auxiliary method used in parallel reconstruction. | |
| void | drawOrthogonal (const GL::ViewState &viewState, const Slice &slice, const DisplayOptions2d &displayOptions) |
| Draw the orthogonal reconstruction. | |
| void | drawParallel (const DisplayOptions2d &displayOptions) |
| Draw the parallel reconstruction. | |
| void | drawBackward (const GL::ViewState &viewState, const Slice &slice, const DisplayOptions2d &displayOptions) |
| Draw the backward reconstruction. | |
| void | updateMdmc () |
| Updates the MaskDistanceMapComponent if needed. | |
Protected Attributes | |
| Mode | m_mode = DUAL |
| Reconstruction mode. | |
| const UltrasoundSweep * | m_sweep = nullptr |
| Sweep to reconstruct. | |
| std::unique_ptr< UltrasoundSweep > | m_proxySweep |
| Optional proxy sweep in case setSweeps was called; owns the data there created. | |
| std::vector< int > | m_gaps |
| Textures who are followed by a gap. | |
| std::unique_ptr< GlProgramIncludeManager > | m_progOrthogonal |
| Shader program for orthogonal reconstruction. | |
| std::unique_ptr< GlProgramIncludeManager > | m_progParallelDist |
| Distance shader program. | |
| std::unique_ptr< GL::Program > | m_progParallelInterp |
| Interpolation shader program. | |
| std::unique_ptr< GlProgramIncludeManager > | m_modernProg |
| Shader used for backward compounding. | |
| std::unique_ptr< GL::Framebuffer > | m_fbo |
| std::unique_ptr< GL::VertexBuffer > | m_vbo |
| std::unique_ptr< GL::Sampler > | m_sampler |
| Sampler for specifying interpolation. | |
| std::vector< std::unique_ptr< GlImage > > | m_parTex |
| Auxiliary textures. | |
| bool | m_mdmcDirty = false |
| SweepReconDirectComponent * | m_srdc = nullptr |
| DataComponent caching per-sweep geometry data. | |
| detail::MaskDistanceMapComponent * | m_mdmc = nullptr |
| DataComponent storing mask-aware distance-to-border image. | |
| double | m_desiredMaxDist = 0.5 |
| Desired maximum distance between slices to render, used only if m_autoChooseMaxDist is true. | |
| double | m_maxDist = 0.0 |
| Effective maximum distance between slices to render. | |
| double | m_thickness = 0.0 |
| Slice thickness (mm) in backward compounding mode. | |
| bool | m_nearestNeighbor = false |
| Use nearest neighbor interpolation instead of linear interpolation. | |
| bool | m_encodeDistToBorder = false |
| Flag whether to encode the distance to the border into the second FBO attachment. | |
| bool | m_encodeAngleInformation = false |
| Flag whether to write out angle between US frame and render slice to the third FBO attachment. | |
| bool | m_autoChooseMaxDist = true |
| Flag whether maximum distance between slices to render should be automatically determined. | |
| enum Mode |
Enumeration of possible reconstruction modes.
| bool encodeDistToBorder | ( | ) | const |
Returns the flag whether to encode the distance to the border into the second FBO attachment.
See GlSliceRenderer::render for more details.
| void setEncodeDistToBorder | ( | bool | value | ) |
Sets the flag whether to encode the distance to the border in into the second FBO attachment.
See GlSliceRenderer::render for more details.