iRoCS Toolbox  1.1.0
Public Member Functions
atb::IRoCS Class Reference

The IRoCS class provides means to attach iRoCS to different kinds of processed root images. More...

#include "libArrayToolbox/Array.hh"

Collaboration diagram for atb::IRoCS:

Public Member Functions

 IRoCS (iRoCS::ProgressReporter *progressReporter=NULL)
 Default constructor. More...
 
 ~IRoCS ()
 Destructor. More...
 
BSpline< blitz::TinyVector< double, 3 > > const & axisSpline () const
 
CoupledBSplineModel< 3 > const & ccm () const
 
template<typename DataT >
void computeStraightenedView (blitz::Array< DataT, 3 > const &data, blitz::TinyVector< double, 3 > const &originalElementSizeUm, blitz::Array< DataT, 3 > &straightened, blitz::TinyVector< double, 3 > const &straightenedElementSizeUm, blitz::TinyVector< double, 3 > const &originUm, double phiOffset) const
 Compute a straightened view of the given dataset according to this iRoCS instance. More...
 
void fit (blitz::TinyVector< double, 3 > const &qcPositionUm, std::list< Nucleus > const &nuclei, double kappa=1.0, double lambda=0.0, double mu=0.0, int nIter=1000, double tau=0.1, double searchRadiusUm=0.0)
 Fit iRoCS to a given list of nuclei. More...
 
void fit (blitz::TinyVector< double, 3 > const &qcPositionUm, std::vector< Nucleus > const &nuclei, double kappa=1.0, double lambda=0.0, double mu=0.0, int nIter=1000, double tau=0.1, double searchRadiusUm=0.0)
 Fit iRoCS to a given vector of nuclei. More...
 
void fit (blitz::TinyVector< double, 3 > const &qcPositionUm, Array< int, 3 > const &segmentation, double kappa=1.0, double lambda=0.0, double mu=0.0, int nIter=1000, double tau=0.1, double searchRadiusUm=0.0)
 Fit iRoCS to a given cellular segmentation. More...
 
void fit (blitz::TinyVector< double, 3 > const &qcPositionUm, std::vector< blitz::TinyVector< double, 3 > > &positionsUm, double kappa=1.0, double lambda=0.0, double mu=0.0, int nIter=1000, double tau=0.1, double searchRadiusUm=0.0)
 Fit iRoCS to a given vector of Euclidean points. More...
 
blitz::TinyVector< double, 3 > getAxisPosition (double u) const
 
blitz::TinyVector< double, 3 > getCoordinates (blitz::TinyVector< double, 3 > const &pos) const
 Get the iRoCS position for the given image position in micrometers. More...
 
double getDistanceToSurface (blitz::TinyVector< double, 3 > const &pos) const
 Get the signed euclidean distance of the given point to the tubular surface. More...
 
blitz::TinyVector< double, 3 > getEuclideanPositionUm (blitz::TinyVector< double, 3 > const &coordinates) const
 Get the euclidean position in micrometers for the given iRoCS coordinate vector. More...
 
blitz::Array< blitz::TinyVector< ptrdiff_t, 3 >, 1 > & indices ()
 
blitz::TinyMatrix< double, 4, 4 > const & inverseNormalizationTransformation () const
 
void load (std::string const &fileName, std::string const &groupName, bool throwErrors=false)
 
void load (BlitzH5File const &inFile, std::string const &groupName)
 
blitz::TinyMatrix< double, 4, 4 > const & normalizationTransformation () const
 
blitz::Array< blitz::TinyVector< double, 3 >, 1 > & normals ()
 
void save (std::string const &fileName, std::string const &groupName, bool throwErrors=false) const
 
void save (BlitzH5File &outFile, std::string const &groupName) const
 
void setProgressReporter (iRoCS::ProgressReporter *progressReporter)
 Attach a iRoCS::ProgressReporter through which progress will be output. More...
 
double thickness (double u) const
 
BSpline< double > const & thicknessSpline () const
 
double uQC () const
 
blitz::Array< blitz::TinyVector< double, 3 >, 1 > & vertices ()
 

Detailed Description

The IRoCS class provides means to attach iRoCS to different kinds of processed root images.

It contains all functions necessary to transform Euclidean image coordinates (z,y,x) (in micrometers) to iRoCS coordinates (z,r,phi) and vice-versa. It also provides functions to load and save the coordinate system in a format understood by labelling. You can access the underlying coupled curves model from within this class and manipulate it if required.

Definition at line 69 of file iRoCS.hh.

Constructor & Destructor Documentation

◆ IRoCS()

atb::IRoCS::IRoCS ( iRoCS::ProgressReporter progressReporter = NULL)

Default constructor.

Parameters
progressReporterIf given, fitting progress will be output through the given iRoCS::ProgressReporter. The user has to ensure, that the progress reporter is available during the lifetime of the IRoCS object or until it is detached using setProgressReporter().

◆ ~IRoCS()

atb::IRoCS::~IRoCS ( )

Destructor.

Member Function Documentation

◆ setProgressReporter()

void atb::IRoCS::setProgressReporter ( iRoCS::ProgressReporter progressReporter)

Attach a iRoCS::ProgressReporter through which progress will be output.

You can pass NULL here if you want to disable progress reporting.

Parameters
progressReporterThe iRoCS::ProgressReporter through which output will be passed to the caller

◆ fit() [1/4]

void atb::IRoCS::fit ( blitz::TinyVector< double, 3 > const &  qcPositionUm,
std::list< Nucleus > const &  nuclei,
double  kappa = 1.0,
double  lambda = 0.0,
double  mu = 0.0,
int  nIter = 1000,
double  tau = 0.1,
double  searchRadiusUm = 0.0 
)

Fit iRoCS to a given list of nuclei.

Only nuclei with label 2 (epidermis) will be used, all others will not influence the fit. For fitting, the coupled curves model is applied.

Schmidt, T. et al. Modeling of Sparsely Sampled Tubular Surfaces Using Coupled Curves. LNCS, 7476, pp. 83-92, 2012

Parameters
qcPositionUmThe Euclidean position (z,y,x) of the quiescent centre (QC) in micrometers. The root axis does not need to pass through the given point, but its projection onto the iRoCS axis is used as z-origin.
nucleiThe nuclei to fit iRoCS to. Only nuclei with label 2 will be considered.
kappaThe data term weight of the coupled curves model
lambdaThe weight for the smoothness regularizer. Since the underlying splines are intrinsically smooth, this parameter is only needed if the model starts to ascillate around the real solution.
muThe weight for the thickness constancy regularizer. Use this parameter if you want to enforce low thickness variations because you know, that the tube has no such variation. For roots it should be chosen small to allow the model to adapt to the thickness variations of the root.
nIterThe maximum number of iterations until the model is reparametrized. Choose this large to avoid the model to end up in local optima. The default leads to good results in most cases.
tauThe initial evolution time step. Bigger values for tau increase the evolution speed in the beginning, but the risk of oscillations which again reduce the convergence speed increases. During the optimization tau will be gradually reduced if no Energy decrease could be reached with the current step size.
searchRadiusUmThis parameter is the threshold at which the loss function psi becomes saturated. Low values reduce the evolution speed but also reduce the risk of 'jumping' out of the tube into neighboring structures. When fitting to one single straight root segment the radius should be chosen large to increase performance and reduce the risk of early termination due to low nucleus density. If a value less than or equal to zero is given here, the distance is automatically determined and set to half the average distance between neighboring epidermis markers along the point cloud's main axis.

◆ fit() [2/4]

void atb::IRoCS::fit ( blitz::TinyVector< double, 3 > const &  qcPositionUm,
std::vector< Nucleus > const &  nuclei,
double  kappa = 1.0,
double  lambda = 0.0,
double  mu = 0.0,
int  nIter = 1000,
double  tau = 0.1,
double  searchRadiusUm = 0.0 
)

Fit iRoCS to a given vector of nuclei.

Only nuclei with label 2 (epidermis) will be used, all others will not influence the fit. For fitting, the coupled curves model is applied.

Schmidt, T. et al. Modeling of Sparsely Sampled Tubular Surfaces Using Coupled Curves. LNCS, 7476, pp. 83-92, 2012

Parameters
qcPositionUmThe Euclidean position (z,y,x) of the quiescent centre (QC) in micrometers. The root axis does not need to pass through the given point, but its projection onto the iRoCS axis is used as z-origin.
nucleiThe nuclei to fit iRoCS to. Only nuclei with label 2 will be considered.
kappaThe data term weight of the coupled curves model
lambdaThe weight for the smoothness regularizer. Since the underlying splines are intrinsically smooth, this parameter is only needed if the model starts to ascillate around the real solution.
muThe weight for the thickness constancy regularizer. Use this parameter if you want to enforce low thickness variations because you know, that the tube has no such variation. For roots it should be chosen small to allow the model to adapt to the thickness variations of the root.
nIterThe maximum number of iterations until the model is reparametrized. Choose this large to avoid the model to end up in local optima. The default leads to good results in most cases.
tauThe initial evolution time step. Bigger values for tau increase the evolution speed in the beginning, but the risk of oscillations which again reduce the convergence speed increases. During the optimization tau will be gradually reduced if no Energy decrease could be reached with the current step size.
searchRadiusUmThis parameter is the threshold at which the loss function psi becomes saturated. Low values reduce the evolution speed but also reduce the risk of 'jumping' out of the tube into neighboring structures. When fitting to one single straight root segment the radius should be chosen large to increase performance and reduce the risk of early termination due to low nucleus density. If a value less than or equal to zero is given here, the distance is automatically determined and set to half the average distance between neighboring epidermis markers along the point cloud's main axis.

◆ fit() [3/4]

void atb::IRoCS::fit ( blitz::TinyVector< double, 3 > const &  qcPositionUm,
Array< int, 3 > const &  segmentation,
double  kappa = 1.0,
double  lambda = 0.0,
double  mu = 0.0,
int  nIter = 1000,
double  tau = 0.1,
double  searchRadiusUm = 0.0 
)

Fit iRoCS to a given cellular segmentation.

For fitting, the coupled curves model is applied to the perimeter pixels of the root.

Schmidt, T. et al. Modeling of Sparsely Sampled Tubular Surfaces Using Coupled Curves. LNCS, 7476, pp. 83-92, 2012

Parameters
qcPositionUmThe Euclidean position (z,y,x) of the quiescent centre (QC) in micrometers. The root axis does not need to pass through the given point, but its projection onto the iRoCS axis is used as z-origin.
segmentationThe Array containing the segmentation masks. Segments with value below 2 will be ignored, since 0 is the label for the edges between the segments and 1 the background label.
kappaThe data term weight of the coupled curves model
lambdaThe weight for the smoothness regularizer. Since the underlying splines are intrinsically smooth, this parameter is only needed if the model starts to ascillate around the real solution.
muThe weight for the thickness constancy regularizer. Use this parameter if you want to enforce low thickness variations because you know, that the tube has no such variation. For roots it should be chosen small to allow the model to adapt to the thickness variations of the root.
nIterThe maximum number of iterations until the model is reparametrized. Choose this large to avoid the model to end up in local optima. The default leads to good results in most cases.
tauThe initial evolution time step. Bigger values for tau increase the evolution speed in the beginning, but the risk of oscillations which again reduce the convergence speed increases. During the optimization tau will be gradually reduced if no Energy decrease could be reached with the current step size.
searchRadiusUmThis parameter is the threshold at which the loss function psi becomes saturated. Low values resuce the evolution speed but also reduce the risk of 'jumping' out of the tube into neighboring structures. When fitting to one single straight root segment the radius should be chosen large to increase performance. If a value less than or equal to zero is given here, the distance is automatically determined and set to half the average distance between neighboring pixels along the point cloud's main axis. That will be very accurate but also very slow.

◆ fit() [4/4]

void atb::IRoCS::fit ( blitz::TinyVector< double, 3 > const &  qcPositionUm,
std::vector< blitz::TinyVector< double, 3 > > &  positionsUm,
double  kappa = 1.0,
double  lambda = 0.0,
double  mu = 0.0,
int  nIter = 1000,
double  tau = 0.1,
double  searchRadiusUm = 0.0 
)

Fit iRoCS to a given vector of Euclidean points.

For fitting, the coupled curves model is applied.

Schmidt, T. et al. Modeling of Sparsely Sampled Tubular Surfaces Using Coupled Curves. LNCS, 7476, pp. 83-92, 2012

Parameters
qcPositionUmThe Euclidean position (z,y,x) of the requested iRoCS origin in micrometers. The root axis does not need to pass through the given point, but its projection onto the iRoCS axis is used as z-origin.
nucleiThe nuclei to fit iRoCS to. Only nuclei with label 2 will be considered.
kappaThe data term weight of the coupled curves model
lambdaThe weight for the smoothness regularizer. Since the underlying splines are intrinsically smooth, this parameter is only needed if the model starts to ascillate around the real solution.
muThe weight for the thickness constancy regularizer. Use this parameter if you want to enforce low thickness variations because you know, that the tube has no such variation. For roots it should be chosen small to allow the model to adapt to the thickness variations of the root.
nIterThe maximum number of iterations until the model is reparametrized. Choose this large to avoid the model to end up in local optima. The default leads to good results in most cases.
tauThe initial evolution time step. Bigger values for tau increase the evolution speed in the beginning, but the risk of oscillations which again reduce the convergence speed increases. During the optimization tau will be gradually reduced if no Energy decrease could be reached with the current step size.
searchRadiusUmThis parameter is the threshold at which the loss function psi becomes saturated. Low values reduce the evolution speed but also reduce the risk of 'jumping' out of the tube into neighboring structures. When fitting to one single straight root segment the radius should be chosen large to increase performance and reduce the risk of early termination due to low nucleus density. If a value less than or equal to zero is given here, the distance is automatically determined and set to half the average distance between neighboring epidermis markers along the point cloud's main axis.

◆ getCoordinates()

blitz::TinyVector<double,3> atb::IRoCS::getCoordinates ( blitz::TinyVector< double, 3 > const &  pos) const

Get the iRoCS position for the given image position in micrometers.

Parameters
posThe image position (x,y,z) in micrometers to transform into iRoCS coordinates
Returns
The iRoCS coordinate vector (z,r,phi) corresponding to the given Euclidean image position

◆ getDistanceToSurface()

double atb::IRoCS::getDistanceToSurface ( blitz::TinyVector< double, 3 > const &  pos) const

Get the signed euclidean distance of the given point to the tubular surface.

Negative values indicate, that the point is inside the tubular structure, positive values mean it is outside.

Parameters
posThe point position (z,y,x) in micrometers
Returns
The distance in micrometers of the given position to the surface of the tubular structure.

◆ getEuclideanPositionUm()

blitz::TinyVector<double,3> atb::IRoCS::getEuclideanPositionUm ( blitz::TinyVector< double, 3 > const &  coordinates) const

Get the euclidean position in micrometers for the given iRoCS coordinate vector.

Parameters
coordinatesThe iRoCS coordinates (z,r,phi) to transform into Euclidean image coordinates
Returns
The Euclidean coordinates (z,y,x) corresponding to the given iRoCS coordinate vector

◆ computeStraightenedView()

template<typename DataT >
void atb::IRoCS::computeStraightenedView ( blitz::Array< DataT, 3 > const &  data,
blitz::TinyVector< double, 3 > const &  originalElementSizeUm,
blitz::Array< DataT, 3 > &  straightened,
blitz::TinyVector< double, 3 > const &  straightenedElementSizeUm,
blitz::TinyVector< double, 3 > const &  originUm,
double  phiOffset 
) const

Compute a straightened view of the given dataset according to this iRoCS instance.

The output Array must be resized to its final shape and its coordinates are (y, x, z), where z is the axis direction and x and y are the orthogonal plane dimensions.

Parameters
dataThe original dataset to transform
originalElementSizeUmThe element size of the original dataset
straightenedThe Array to write the straightened view into
straightenedElementSizeUmThe output element size
originUmThe coordinate origin (z = 0, r = 0, phi = 0) will be mapped to the given micrometer position

◆ getAxisPosition()

blitz::TinyVector<double,3> atb::IRoCS::getAxisPosition ( double  u) const

◆ thickness()

double atb::IRoCS::thickness ( double  u) const

◆ ccm()

CoupledBSplineModel<3> const& atb::IRoCS::ccm ( ) const

◆ axisSpline()

BSpline< blitz::TinyVector<double,3> > const& atb::IRoCS::axisSpline ( ) const

◆ thicknessSpline()

BSpline<double> const& atb::IRoCS::thicknessSpline ( ) const

◆ uQC()

double atb::IRoCS::uQC ( ) const

◆ normalizationTransformation()

blitz::TinyMatrix<double,4,4> const& atb::IRoCS::normalizationTransformation ( ) const

◆ inverseNormalizationTransformation()

blitz::TinyMatrix<double,4,4> const& atb::IRoCS::inverseNormalizationTransformation ( ) const

◆ vertices()

blitz::Array<blitz::TinyVector<double,3>,1>& atb::IRoCS::vertices ( )

◆ indices()

blitz::Array<blitz::TinyVector<ptrdiff_t,3>,1>& atb::IRoCS::indices ( )

◆ normals()

blitz::Array<blitz::TinyVector<double,3>,1>& atb::IRoCS::normals ( )

◆ save() [1/2]

void atb::IRoCS::save ( std::string const &  fileName,
std::string const &  groupName,
bool  throwErrors = false 
) const

◆ load() [1/2]

void atb::IRoCS::load ( std::string const &  fileName,
std::string const &  groupName,
bool  throwErrors = false 
)

◆ save() [2/2]

void atb::IRoCS::save ( BlitzH5File outFile,
std::string const &  groupName 
) const

◆ load() [2/2]

void atb::IRoCS::load ( BlitzH5File const &  inFile,
std::string const &  groupName 
)

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