ImFusion SDK 4.3
PointExtraction Class Reference

#include <ImFusion/CT/PointExtraction.h>

Utility class for extracting calibration points from images. More...

Detailed Description

Utility class for extracting calibration points from images.

Provides static methods for bead detection and tracking in calibration phantoms.

Static Public Member Functions

static int extractPoints (const MemImage *img, std::vector< ConeBeamCalibration::PointInfo > &points, double minDiameter=3.0, double maxDiameter=30.0, double gradientThreshold=0.2, double isoThreshold=0.9, double pointContrast=0.05, bool inpaint=true, bool meanCorrection=false, const Mask *imgMask=nullptr)
 Extract points from input image.
 
static std::pair< int, std::vector< std::vector< ConeBeamCalibration::PointInfo > > > trackPoints (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, double matchingThreshold=20.0, bool removeIncompleteTracks=true, int minTrackLength=2, int pointTolerance=4, bool trackPoints=true, bool joinTracks=true, bool sortTracks=true, bool detectCollisions=true, bool checkConvexity=false)
 Track extracted points over image sequence.
 
static int joinTracks (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, const std::vector< std::vector< int > > &joinedTracks)
 Join tracks over sequence.
 
static int removeIncompleteTracks (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, int minTrackLength, std::vector< std::vector< ConeBeamCalibration::PointInfo > > *deletedPoints=nullptr)
 Remove tracks with too few points.
 
static void sortTracks (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, bool inverted=true, bool circular=false)
 Sort tracks along y-axis or by angle if circular is true.
 
static bool isConvex (std::vector< int > &leftTrack, std::vector< int > &rightTrack, std::vector< std::vector< std::pair< Eigen::Vector2d, int > > > &pointsOfSegment)
 Check whether the polygon formed by segments of two tracks is convex (i.e.
 
static void removeBigPoints (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, double radThreshold=1.2)
 Remove points which have radius significantly bigger than the neigbouring points, for proper results use it only after the tracking has been performed.
 
static void addPointsOnEllipsoid (std::vector< std::vector< ConeBeamCalibration::PointInfo > > &points, const std::vector< std::vector< ConeBeamCalibration::PointInfo > > &deletedPoints, const bool addDeletedPoints=true, const bool addMirrorPoints=true, const bool removeDuplicatePoints=true, const float deletedPointsMaxDist=1e-4, const float duplicatePointDistTol=0.5)
 Fit points on each track to an ellipse in order to complete each track with points on the corresponding ellipse.
 

Member Function Documentation

◆ extractPoints()

static int extractPoints ( const MemImage * img,
std::vector< ConeBeamCalibration::PointInfo > & points,
double minDiameter = 3.0,
double maxDiameter = 30.0,
double gradientThreshold = 0.2,
double isoThreshold = 0.9,
double pointContrast = 0.05,
bool inpaint = true,
bool meanCorrection = false,
const Mask * imgMask = nullptr )
static

Extract points from input image.

Parameters
imginput image
pointsextracted points
minDiameterminimum diameter of points
maxDiametermaximum diameter of points
gradientThresholdnormalized gradient threshold for discarding objects
isoThresholdnormalized isolevel at which to extract points
pointContrastrelative difference between the intensity of the point and the background (backround intensity is at least pointContrast higher than point intensity)
inpaintif true, bead extraction is performed on an image with substracted background, otherwise it is performed on the original image
meanCorrectionif true, a vertical mean is computed and any pixel is divided by the corresponding mean value.
maskif mask is set the extractPoints will be computed with taking mask into account
Returns
number of extracted points

◆ trackPoints()

static std::pair< int, std::vector< std::vector< ConeBeamCalibration::PointInfo > > > trackPoints ( std::vector< std::vector< ConeBeamCalibration::PointInfo > > & points,
double matchingThreshold = 20.0,
bool removeIncompleteTracks = true,
int minTrackLength = 2,
int pointTolerance = 4,
bool trackPoints = true,
bool joinTracks = true,
bool sortTracks = true,
bool detectCollisions = true,
bool checkConvexity = false )
static

Track extracted points over image sequence.

Parameters
pointsinput and output points
matchingThresholddistance threshold for tracking points over frames
removeIncompleteTracksif true incomplete tracks with a length below minTrackLength are removed
minTrackLengthused in conjunction with remove incompleteTracks
joinTracksjoin tracks whose start and end points are close
sortTrackssort tracks descending in image y-direction
Returns
number of point tracks and points which are deleted from
Parameters
pointsby this function

◆ isConvex()

static bool isConvex ( std::vector< int > & leftTrack,
std::vector< int > & rightTrack,
std::vector< std::vector< std::pair< Eigen::Vector2d, int > > > & pointsOfSegment )
static

Check whether the polygon formed by segments of two tracks is convex (i.e.

the segments of polygon have the same direction (clockwise or counter-clockwise) and they don't intersect with each other)

Parameters
leftTracksegments that form a track which might be needed to be connected with the rightTrack from the right
rightTracksegments that form a track which might be needed to be connected with the leftTrack from the left
pointsOfSegmentpoints that form the segments, each entry contains the coordinate of the point and the frame where it was detected
Returns
true if the shape formed by the leftTrack and the rightTrack is estimated to be convex, false otherwise

◆ removeBigPoints()

static void removeBigPoints ( std::vector< std::vector< ConeBeamCalibration::PointInfo > > & points,
double radThreshold = 1.2 )
static

Remove points which have radius significantly bigger than the neigbouring points, for proper results use it only after the tracking has been performed.

Parameters
radThresholda relative factor. Points with a radius larger than radThreshold * avgRadius will be removed.

◆ addPointsOnEllipsoid()

static void addPointsOnEllipsoid ( std::vector< std::vector< ConeBeamCalibration::PointInfo > > & points,
const std::vector< std::vector< ConeBeamCalibration::PointInfo > > & deletedPoints,
const bool addDeletedPoints = true,
const bool addMirrorPoints = true,
const bool removeDuplicatePoints = true,
const float deletedPointsMaxDist = 1e-4,
const float duplicatePointDistTol = 0.5 )
static

Fit points on each track to an ellipse in order to complete each track with points on the corresponding ellipse.

Parameters
pointspoints per frame
deletedPointspoints per frame previously deleted
addDeletedPointsre-evaluate if points in
deletedPointsare on any track by reinserting them if they lie on any ellipse
addMirrorPointsmirroring the points on the ellipse center and adding them to points
removeDuplicatePointsremoving inserted points when they are too close to already existing points

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