Carna Version 3.3.3
Loading...
Searching...
No Matches
DRRStage.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef DRRSTAGE_H_6014714286
13#define DRRSTAGE_H_6014714286
14
16#include <Carna/Carna.h>
17#include <Carna/base/HUV.h>
18#include <memory>
19
24namespace Carna
25{
26
27namespace presets
28{
29
30
31
32// ----------------------------------------------------------------------------------
33// DRRStage
34// ----------------------------------------------------------------------------------
35
106class CARNA_LIB DRRStage : public VolumeRenderingStage
107{
108
109 struct Details;
110 const std::unique_ptr< Details > pimpl;
111
112public:
113
114 const static float DEFAULT_WATER_ATTENUATION;
115 const static float DEFAULT_BASE_INTENSITY;
118 const static float DEFAULT_UPPER_MULTIPLIER;
119 const static bool DEFAULT_RENDER_INVERSE;
120
125 const static unsigned int ROLE_INTENSITIES = 0;
126
131 explicit DRRStage( unsigned int geometryType );
132
136 virtual ~DRRStage();
137
138 DRRStage* clone() const override;
139
140 virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
141
146 virtual void renderPass
147 ( const base::math::Matrix4f& viewTransform
148 , base::RenderTask& rt
149 , const base::Viewport& vp ) override;
150
155 float waterAttenuation() const;
156
160 float baseIntensity() const;
161
167
173
178 float upperMultiplier() const;
179
184 bool isRenderingInverse() const;
185
190 void setWaterAttenuation( float muWater );
191
196 void setBaseIntensity( float baseIntensity );
197
203
209
214 void setUpperMultiplier( float multiplier );
215
227 void setRenderingInverse( bool inverse );
228
229protected:
230
231 virtual unsigned int loadVideoResources() override;
232
233 virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
234
238 virtual const base::ShaderProgram& acquireShader() override;
239
243 virtual const std::string& uniformName( unsigned int role ) const override;
244
248 virtual void configureShader() override;
249
253 virtual void configureShader( const base::Renderable& ) override;
254
255}; // DRRStage
256
257
258
259} // namespace Carna :: presets
260
261} // namespace Carna
262
263#endif // DRRSTAGE_H_6014714286
Defines Carna::base::HUV.
Defines Carna::presets::VolumeRenderingStage.
Defines logic for rendering frames from given scenes.
Invokes the rendering stages of the frame renderer successively.
Definition RenderTask.h:41
Represents a Geometry object that has been queued into a RenderQueue. The object's model-view transfo...
Definition Renderable.h:46
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition Sampler.h:45
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.h:49
Renders digital radiograph reconstructs of volume geometries in the scene.
Definition DRRStage.h:107
float upperMultiplier() const
Tells . The parameters are described here.
static const base::HUV DEFAULT_UPPER_THRESHOLD
Holds default value for .
Definition DRRStage.h:117
void setUpperMultiplier(float multiplier)
Sets to multiplier. The parameters are described here.
void setWaterAttenuation(float muWater)
Sets to muWater. The parameters are described here.
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...
float baseIntensity() const
Tells . The parameters are described here.
virtual ~DRRStage()
Deletes.
virtual unsigned int loadVideoResources() override
Loads video resources when rendering is triggered for the first time. Override this method if you nee...
void setUpperThreshold(base::HUV upper)
Sets to upper. The parameters are 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 dimensions.
DRRStage * clone() const override
Returns same RenderStage implementation with same configuration.
static const bool DEFAULT_RENDER_INVERSE
Holds default value for inverse rendering.
Definition DRRStage.h:119
base::HUV upperThreshold() const
Tells . The parameters are described here.
virtual const base::ShaderProgram & acquireShader() override
Acquires the drr_accumulation shader from the base::ShaderManager.
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 base::HUV DEFAULT_LOWER_THRESHOLD
Holds default value for .
Definition DRRStage.h:116
float waterAttenuation() const
Tells . The parameters are described here.
virtual void configureShader() override
Uploads the parameters to the shader.
void setLowerThreshold(base::HUV lower)
Sets to lower. The parameters are described here.
DRRStage(unsigned int geometryType)
Instantiates. The created stage will render such base::Geometry scene graph nodes,...
virtual void configureShader(const base::Renderable &) override
Does nothing.
static const float DEFAULT_WATER_ATTENUATION
Holds default value for .
Definition DRRStage.h:114
base::HUV lowerThreshold() const
Tells . The parameters are described here.
virtual const std::string & uniformName(unsigned int role) const override
Maps ROLE_INTENSITIES to huVolume.
static const float DEFAULT_BASE_INTENSITY
Holds default value for .
Definition DRRStage.h:115
static const float DEFAULT_UPPER_MULTIPLIER
Holds default value for .
Definition DRRStage.h:118
void setBaseIntensity(float baseIntensity)
Sets to baseIntensity. The parameters are described here.
virtual void renderPass(const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override
Computes the digital radiograph reconstruct like described here.
bool isRenderingInverse() const
Tells whether ray attenuation at any particular pixel is inverse proportional to the brightness of th...
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.h:193
Represents values in .
Definition HUV.h:35