PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
List of all members | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
PlusMath Class Reference

A utility class that contains static functions for various useful commonly used computations. More...

#include <src/PlusCommon/PlusMath.h>

Static Public Member Functions

static void ConvertVnlMatrixToVtkMatrix (const vnl_matrix_fixed< double, 4, 4 > &inVnlMatrix, vtkMatrix4x4 *outVtkMatrix)
 
static void ConvertVtkMatrixToVnlMatrix (const vtkMatrix4x4 *inVtkMatrix, vnl_matrix_fixed< double, 4, 4 > &outVnlMatrix)
 
static void LogMatrix (const vnl_matrix_fixed< double, 4, 4 > &matrix, int precision=3)
 
static PlusStatus LSQRMinimize (const std::vector< std::vector< double > > &aMatrix, const std::vector< double > &bVector, vnl_vector< double > &resultVector, double *mean=NULL, double *stdev=NULL, vnl_vector< unsigned int > *notOutliersIndices=NULL)
 
static PlusStatus LSQRMinimize (const std::vector< vnl_vector< double > > &aMatrix, const std::vector< double > &bVector, vnl_vector< double > &resultVector, double *mean=NULL, double *stdev=NULL, vnl_vector< unsigned int > *notOutliersIndices=NULL)
 
static PlusStatus LSQRMinimize (const vnl_sparse_matrix< double > &sparseMatrixLeftSide, const vnl_vector< double > &vectorRightSide, vnl_vector< double > &resultVector, double *mean=NULL, double *stdev=NULL, vnl_vector< unsigned int > *notOutliersIndices=NULL)
 
static void PrintMatrix (vnl_matrix_fixed< double, 4, 4 > matrix, std::ostringstream &stream, int precision=3)
 

Protected Member Functions

 PlusMath ()
 
 ~PlusMath ()
 

Static Protected Member Functions

static PlusStatus RemoveOutliersFromLSQR (vnl_sparse_matrix< double > &sparseMatrixLeftSide, vnl_vector< double > &vectorRightSide, vnl_vector< double > &resultVector, bool &outlierFound, double thresholdMultiplier=3.0, double *mean=NULL, double *stdev=NULL, vnl_vector< unsigned int > *nonOutlierIndices=NULL)
 

Detailed Description

A utility class that contains static functions for various useful commonly used computations.

Definition at line 37 of file PlusMath.h.

Constructor & Destructor Documentation

◆ PlusMath()

PlusMath::PlusMath ( )
protected

Definition at line 22 of file PlusMath.cxx.

◆ ~PlusMath()

PlusMath::~PlusMath ( )
protected

Definition at line 28 of file PlusMath.cxx.

Member Function Documentation

◆ ConvertVnlMatrixToVtkMatrix()

void PlusMath::ConvertVnlMatrixToVtkMatrix ( const vnl_matrix_fixed< double, 4, 4 > &  inVnlMatrix,
vtkMatrix4x4 *  outVtkMatrix 
)
static

Convert matrix between VTK and VNL

Definition at line 361 of file PlusMath.cxx.

◆ ConvertVtkMatrixToVnlMatrix()

void PlusMath::ConvertVtkMatrixToVnlMatrix ( const vtkMatrix4x4 *  inVtkMatrix,
vnl_matrix_fixed< double, 4, 4 > &  outVnlMatrix 
)
static

Definition at line 347 of file PlusMath.cxx.

◆ LogMatrix()

void PlusMath::LogMatrix ( const vnl_matrix_fixed< double, 4, 4 > &  matrix,
int  precision = 3 
)
static

Print matrix into log as info

Definition at line 385 of file PlusMath.cxx.

◆ LSQRMinimize() [1/3]

PlusStatus PlusMath::LSQRMinimize ( const std::vector< std::vector< double > > &  aMatrix,
const std::vector< double > &  bVector,
vnl_vector< double > &  resultVector,
double *  mean = NULL,
double *  stdev = NULL,
vnl_vector< unsigned int > *  notOutliersIndices = NULL 
)
static

Solve Ax = b sparse linear equations with robust linear least squares method (vnl_lsqr and outlier removal)

Parameters
aMatrixThe coefficient matrix of size m-by-n.
bVectorColumn vector of length m.
meanPointer to get the resulting mean of the the LSQR fit error
stdevPointer to get the resulting standard deviation of the the LSQR fit error
resultVectorto store the results
notOutlierIndicesRow that were not removed during the outliers rejection process

Definition at line 34 of file PlusMath.cxx.

◆ LSQRMinimize() [2/3]

PlusStatus PlusMath::LSQRMinimize ( const std::vector< vnl_vector< double > > &  aMatrix,
const std::vector< double > &  bVector,
vnl_vector< double > &  resultVector,
double *  mean = NULL,
double *  stdev = NULL,
vnl_vector< unsigned int > *  notOutliersIndices = NULL 
)
static

Solve Ax = b sparse linear equations with robust linear least squares method (vnl_lsqr and outlier removal)

Parameters
aMatrixThe coefficient matrix of size m-by-n.
bVectorColumn vector of length m.
meanPointer to get the resulting mean of the the LSQR fit error
stdevPointer to get the resulting standard deviation of the the LSQR fit error
resultVectorto store the results
notOutlierIndicesRow that were not removed during the outliers rejection process

Definition at line 70 of file PlusMath.cxx.

◆ LSQRMinimize() [3/3]

PlusStatus PlusMath::LSQRMinimize ( const vnl_sparse_matrix< double > &  sparseMatrixLeftSide,
const vnl_vector< double > &  vectorRightSide,
vnl_vector< double > &  resultVector,
double *  mean = NULL,
double *  stdev = NULL,
vnl_vector< unsigned int > *  notOutliersIndices = NULL 
)
static

Solve Ax = b sparse linear equations with robust linear least squares method (vnl_lsqr and outlier removal)

Parameters
sparseMatrixLeftSideThe coefficient matrix of size m-by-n. (aMatrix)
vectorRightSideColumn vector of length m. (bVector)
meanPointer to get the resulting mean of the the LSQR fit error
stdevPointer to get the resulting standard deviation of the the LSQR fit error
resultVectorto store the results

Definition at line 111 of file PlusMath.cxx.

◆ PrintMatrix()

void PlusMath::PrintMatrix ( vnl_matrix_fixed< double, 4, 4 >  matrix,
std::ostringstream &  stream,
int  precision = 3 
)
static

Print matrix into STL stream

Definition at line 377 of file PlusMath.cxx.

◆ RemoveOutliersFromLSQR()

PlusStatus PlusMath::RemoveOutliersFromLSQR ( vnl_sparse_matrix< double > &  sparseMatrixLeftSide,
vnl_vector< double > &  vectorRightSide,
vnl_vector< double > &  resultVector,
bool &  outlierFound,
double  thresholdMultiplier = 3.0,
double *  mean = NULL,
double *  stdev = NULL,
vnl_vector< unsigned int > *  nonOutlierIndices = NULL 
)
staticprotected

Remove outliers from Ax = b sparse linear equations after linear least squares method (vnl_lsqr)

Definition at line 196 of file PlusMath.cxx.


The documentation for this class was generated from the following files: