ImFusion SDK 4.3
ProjectionPreProcessing Class Reference

#include <ImFusion/CT/Legacy/ProjectionPreProcessing.h>

Pre-processing of projection images. More...

+ Inheritance diagram for ProjectionPreProcessing:

Detailed Description

Pre-processing of projection images.

X-Ray projection images have to be normalized and, if selected, converted from detector intensity to attenuation values. For that purpose, the following steps are applied in order, given that the respective image frames have been provided by the user: 1) Substraction of minFrame 2) Division by (maxFrame - minFrame) 3) Filling gaps due to bad detector pixels (according to mask) 4) Rescaling to full image range, at the same time conversion to attenuation values (if selected)

Steps 1-3 have to be executed in a dry run in order to compute the resulting intensity range, before the actual conversion is applied to all projection images.

Public Member Functions

 ProjectionPreProcessing (SharedImageSet &images)
 Constructor requiring the vector of projection images.
 
void setInputDepth (int depth)
 Specifies the bit depth of the input data in order to detect and skip saturated pixels.
 
void setAirValue (int val)
 Specifies the air value (more precise upper value than using bit depth)
 
void setWaterPreCorrectCoeffs (std::vector< double > coeffs)
 Sepcifies the coefficients for the polynomial (with the projections as variable) for the water pre-correction in order to reduce beam hardening.
 
void init (int numFrames, bool background=true)
 Prepare for parallel pre-processing with the given maximum number of frames.
 
void scheduleFrame (int which)
 Schedule the multi-threaded pre-processing of a single frame.
 
void processFrame (int which)
 Thread-safe method to process a single frame.
 
void process (Progress *progress=0)
 Processes all projection images according to the chosen settings.
 
double getMaxTexVal () const
 Return the maximum texture value in all of the images.
 
std::mutexmutex ()
 Return pointer to the mutex for image synchronization.
 
void configure (const Properties *p) override
 Set pre-processing configuration from properties.
 
void configuration (Properties *p) const override
 Retrieve the current configuration as properties.
 
void options (bool &orig, bool &downsample, int &rotate, int &flip) const
 Directly retrieve some configuration options.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Static Public Member Functions

static int applyMask (MemImage *img, TypedImage< unsigned char > *mask)
 Fill gaps using mask from a single frame.
 

Protected Member Functions

void computeGlobalGain ()
 
template<typename T>
void convertFrame (TypedImage< T > *img, bool apply, double &minOut, double &maxOut, const Mask *imageMask=nullptr)
 Converts a single frame, either computing resulting range or applying the conversion.
 

Protected Attributes

SharedImageSetm_images
 Reference to vector of projection images.
 
std::vector< double > m_frameMin
 Per-frame minimum intensity.
 
std::vector< double > m_frameMax
 Per-frame maximum intensity.
 
std::vector< double > m_waterPreCorrectCoeffs
 Polynomial coefficients for water pre-correction.
 
double m_minVal
 Minimum intensity in all of the images.
 
double m_maxVal
 Maximum intensity in all of the images.
 
double m_maxTexVal
 Maximum resulting texture intensity in all images.
 
TypedImage< unsigned char > * m_mask
 Mask frame denoting bad detector pixels.
 
bool m_deleteMask
 Delete mask on destruction.
 
bool m_origVal
 Are original values kept (no conversion to attenuation)
 
bool m_rotateLeft
 Are the images rotated.
 
bool m_rotateRight
 Are the images rotated.
 
bool m_flipHorizontal
 Are the images flipped.
 
bool m_flipVertical
 Are the images flipped.
 
bool m_downSample
 Are the images downsampled.
 
bool m_scaleIntensities
 Specifies whether intensity scaling is applied after conversion when loading original values.
 
bool m_secondPass
 True if this is the second pass through the images.
 
bool m_onePass
 True if we shall only use one pass.
 
double m_intensityScale
 Computed scale value applied to the images.
 
double m_intensityShift
 Computed shift value applied to the images.
 
vec4i m_crop
 If non-zero, image borders are cropped.
 
TypedImage< float > * m_offsetMap
 Offset map.
 
std::vector< TypedImage< float > * > m_gainMaps
 Gain maps for multipoint gain correction.
 
std::vector< double > m_globalGain
 Mean value of each gain map.
 
int m_depth
 Bit depth of the data, if provided.
 
int m_airValue
 Air value, if provided.
 
std::mutex m_mutex
 Synchronizing multi-threaded access to image data.
 
std::unique_ptr< Threading::ThreadPoolm_threadpool
 Processing threads.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Set methods to provide min/max/mask frames and options

void setOffsetMap (TypedImage< float > *offsetMap)
 
TypedImage< float > * offsetMap ()
 
void setGainMaps (const std::vector< TypedImage< float > * > &gainMaps)
 Set gain maps for multi-point gain correction.
 
const std::vector< TypedImage< float > * > & gainMaps ()
 
void setMask (TypedImage< unsigned char > *mask)
 Specifies a mask of bad pixels.
 
void setMask (const MemImage *img, int threshold)
 
TypedImage< unsigned char > * mask ()
 
void setOrigVal (bool flag)
 If true, no conversion into attenuation values is done.
 
void setRotateLeft (bool flag)
 If true, projections are rotated 90 degrees counter-clockwise.
 
void setRotateRight (bool flag)
 If true, projections are rotated 90 degrees clockwise.
 
void setFlipHorizontal (bool flag)
 If true, projections are horizontally flipped (after optional rotation)
 
void setFlipVertical (bool flag)
 If true, projections are vertically flipped (after optional rotation)
 
void setDownSample (bool flag)
 If true, downsampling by two is executed both in width and height.
 
void setScaleIntensities (bool scaleIntensities)
 Specifies whether intensity scaling is applied after conversion when loading original values.
 
void setCropping (const vec4i &borders)
 Specifies optional cropping of the image borders.
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Member Function Documentation

◆ setOffsetMap()

void setOffsetMap ( TypedImage< float > * offsetMap)

Set offset map for multi-point gain correction

◆ setMask()

void setMask ( TypedImage< unsigned char > * mask)
inline

Specifies a mask of bad pixels.

If the mask value is below the specified threshold, the pixel is discarded and filled from neighboring values, if possible.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Set pre-processing configuration from properties.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Retrieve the current configuration as properties.

Reimplemented from Configurable.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close