LibCarna Version 3.4.0
Loading...
Searching...
No Matches
DRRStage.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef DRRSTAGE_H_6014714286
16#define DRRSTAGE_H_6014714286
17
19#include <LibCarna/LibCarna.hpp>
20#include <LibCarna/base/HUV.hpp>
21#include <memory>
22
28namespace LibCarna
29{
30
31namespace presets
32{
33
34
35
36// ----------------------------------------------------------------------------------
37// DRRStage
38// ----------------------------------------------------------------------------------
39
109class LIBCARNA DRRStage : public VolumeRenderingStage
110{
111
112 struct Details;
113 const std::unique_ptr< Details > pimpl;
114
115public:
116
117 const static float DEFAULT_WATER_ATTENUATION;
118 const static float DEFAULT_BASE_INTENSITY;
121 const static float DEFAULT_UPPER_MULTIPLIER;
122 const static bool DEFAULT_RENDER_INVERSE;
123
128 const static unsigned int ROLE_INTENSITIES = 0;
129
134 explicit DRRStage( unsigned int geometryType );
135
139 virtual ~DRRStage();
140
141 virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
142
147 virtual void renderPass
148 ( const base::math::Matrix4f& viewTransform
149 , base::RenderTask& rt
150 , const base::Viewport& vp ) override;
151
156 float waterAttenuation() const;
157
161 float baseIntensity() const;
162
168
174
179 float upperMultiplier() const;
180
185 bool isRenderingInverse() const;
186
191 void setWaterAttenuation( float muWater );
192
197 void setBaseIntensity( float baseIntensity );
198
204
210
215 void setUpperMultiplier( float multiplier );
216
228 void setRenderingInverse( bool inverse );
229
230protected:
231
232 virtual unsigned int loadVideoResources() override;
233
234 virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
235
239 virtual const base::ShaderProgram& acquireShader() override;
240
244 virtual const std::string& uniformName( unsigned int role ) const override;
245
249 virtual void configureShader() override;
250
254 virtual void configureShader( const base::Renderable& ) override;
255
256}; // DRRStage
257
258
259
260} // namespace LibCarna :: presets
261
262} // namespace LibCarna
263
264#endif // DRRSTAGE_H_6014714286
Defines LibCarna::base::HUV.
Contains forward-declarations.
Defines LibCarna::presets::VolumeRenderingStage.
Defines logic for rendering frames from given scenes.
Invokes the rendering stages of the frame renderer successively.
Represents a Geometry object that has been queued into a RenderQueue. The object's model-view transfo...
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition Sampler.hpp:48
Maintains an OpenGL shader program. Realizes the RAII-idiom.
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition Viewport.hpp:52
Renders digital radiograph reconstructs of volume geometries in the scene.
Definition DRRStage.hpp:110
float upperMultiplier() const
Tells . The parameters are described here.
static const float DEFAULT_BASE_INTENSITY
Holds default value for .
Definition DRRStage.hpp:118
virtual void configureShader(const base::Renderable &) override
Does nothing.
virtual void createVolumeSamplers(const std::function< void(unsigned int, base::Sampler *) > &registerSampler) override
Creates texture samplers for volume textures and uses registerSampler to assign them to the roles tha...
DRRStage(unsigned int geometryType)
Instantiates. The created stage will render such base::Geometry scene graph nodes,...
void setWaterAttenuation(float muWater)
Sets to muWater. The parameters are described here.
virtual unsigned int loadVideoResources() override
Loads video resources when rendering is triggered for the first time. Override this method if you nee...
virtual void renderPass(const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override
Computes the digital radiograph reconstruct like described here.
virtual void reshape(base::FrameRenderer &fr, unsigned int width, unsigned int height) override
Orders this stage to reshape its buffers according to the specified width and height.
void setLowerThreshold(base::HUV lower)
Sets to lower. The parameters are described here.
void setUpperThreshold(base::HUV upper)
Sets to upper. The parameters are described here.
virtual const std::string & uniformName(unsigned int role) const override
Maps ROLE_INTENSITIES to huVolume.
bool isRenderingInverse() const
Tells whether ray attenuation at any particular pixel is inverse proportional to the brightness of th...
base::HUV upperThreshold() const
Tells . The parameters are described here.
base::HUV lowerThreshold() const
Tells . The parameters are described here.
float waterAttenuation() const
Tells . The parameters are described here.
virtual const base::ShaderProgram & acquireShader() override
Acquires the drr_accumulation shader from the base::ShaderManager.
virtual void configureShader() override
Uploads the parameters to the shader.
static const base::HUV DEFAULT_UPPER_THRESHOLD
Holds default value for .
Definition DRRStage.hpp:120
void setUpperMultiplier(float multiplier)
Sets to multiplier. The parameters are described here.
static const float DEFAULT_WATER_ATTENUATION
Holds default value for .
Definition DRRStage.hpp:117
void setRenderingInverse(bool inverse)
Sets whether the colors of the DRR should be inverse or not. The ray attenuation at a particular pixe...
static const float DEFAULT_UPPER_MULTIPLIER
Holds default value for .
Definition DRRStage.hpp:121
void setBaseIntensity(float baseIntensity)
Sets to baseIntensity. The parameters are described here.
static const bool DEFAULT_RENDER_INVERSE
Holds default value for inverse rendering.
Definition DRRStage.hpp:122
float baseIntensity() const
Tells . The parameters are described here.
static const base::HUV DEFAULT_LOWER_THRESHOLD
Holds default value for .
Definition DRRStage.hpp:119
virtual ~DRRStage()
Deletes.
Defines abstract base class for rendering stages that render volume geometries in the scene.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.hpp:197
Represents Hounsfield Units Values in , usually used in CT imaging.
Definition HUV.hpp:45