iRoCS Toolbox
1.1.0
|
Data Structures | |
class | _KMeans |
class | LabellingError |
class | MahalanobisDistance |
class | NormalPDF |
Encapsulates a normal pdf. More... | |
class | ProfileFilter |
class | ProfileSampler |
class | SegmentationModel |
Typedefs | |
typedef blitz::Array< std::complex< double >, 1 > | FrequencyArray |
typedef std::vector< FrequencyArray * > | FrequencyVecArray |
typedef blitz::Array< std::complex< double >, 2 > | SpatialArray |
typedef std::vector< SpatialArray * > | SpatialVecArray |
Functions | |
template<class DataT > | |
blitz::Array< DataT, 3 > | _calculateGradients (blitz::Array< DataT, 3 > const &data, blitz::TinyVector< double, 3 > const &elSize, int direction, double scaling, iRoCS::ProgressReporter *progress) |
template<typename T > | |
std::vector< blitz::Array< T, 2 > > | collectSelectedClusterProfiles (const blitz::Array< T, 2 > &profiles, const std::vector< ptrdiff_t > &labels, const std::set< ptrdiff_t > &selected_clusters) |
Builds a vector of blitz Arrays (profiles) for selected clusters each element of the vector corresponds to the profiles of a selected cluster. More... | |
template<class DataT > | |
void | edgeFilter (blitz::Array< DataT, 3 > const &data, blitz::TinyVector< double, 3 > const &elSize, blitz::Array< DataT, 3 > &result, blitz::TinyVector< double, 3 > const &lbUm=0.0, blitz::TinyVector< double, 3 > const &ubUm=(std::numeric_limits< double >::infinity()), iRoCS::ProgressReporter *progress=NULL) |
calculate gradient magnitude with non-maximum-supression More... | |
std::complex< double > | evaluateSH (FrequencyArray const &coeffs, double theta, double phi) |
void | generateMask (FrequencyArray const &coeffs, blitz::Array< bool, 3 > &mask, blitz::TinyVector< double, 3 > const &elementSizeUm, blitz::TinyVector< double, 3 > const ¢erUm) |
Generate a binary mask being true inside the spherical function and false outside. More... | |
void | geodesic_sh (blitz::Array< blitz::TinyVector< float, 3 >, 3 > const &gvf, blitz::TinyVector< float, 3 > const &elementSizeUm, FrequencyArray &coeffs, blitz::TinyVector< float, 3 > positionUm, float radiusUm, int bw, double roundness, int num_iter, iRoCS::ProgressReporter *progress=NULL) |
Geodesic Active contours. More... | |
void | geodesic_sh (blitz::Array< blitz::TinyVector< float, 3 >, 3 > const &gvf, blitz::TinyVector< float, 3 > const &el_size_um, blitz::TinyVector< float, 3 > best_center, float best_radius, int bandwidth, double roundness, int num_iter, blitz::Array< bool, 3 > &mask, blitz::Array< blitz::TinyVector< float, 3 >, 3 > &normals, iRoCS::ProgressReporter *progress=NULL) |
Geodesic Active contours. More... | |
template<typename DataT > | |
void | geodesicSH (blitz::Array< blitz::TinyVector< DataT, 3 >, 3 > const &edgeForce, blitz::TinyVector< double, 3 > const &elementSizeUm, FrequencyArray &coeffs, blitz::TinyVector< double, 3 > const &positionUm, double radiusUm, int bw, double roundness, int nIter, double tau=0.1, iRoCS::ProgressReporter *progress=NULL) |
Evolve an active contour with spherical topology represented by a scalar spherical harmonic function, describing the structure's radius. More... | |
template<typename T > | |
void | gradientVectorFlowSOR (blitz::Array< blitz::TinyVector< T, 3 >, 3 > &gradient, blitz::TinyVector< T, 3 > const &el_size_um, T mu, T nu, int max_iter, iRoCS::ProgressReporter *progress) |
Solve Euler-Lagrange equation for gradient vector flow using successive over-relaxation
u : output gradient vector flow f : input vector field. More... | |
blitz::TinyVector< double, 2 > | indexToAngles (blitz::TinyVector< ptrdiff_t, 2 > const &index, int bw) |
double | indexToPhi (ptrdiff_t index, int bw) |
double | indexToTheta (ptrdiff_t index, int bw) |
template<class DataT , int Dim> | |
double | kmeans (const unsigned int k, const blitz::Array< DataT, 2 > &points, blitz::Array< DataT, 2 > &means, std::vector< int > &labels) |
template<class DataT > | |
double | kmeans (const unsigned int k, const blitz::Array< DataT, 2 > &points, blitz::Array< DataT, 2 > &means, std::vector< int > &labels) |
ptrdiff_t | linearIndex (int bw, int l, int m) |
template<typename T > | |
void | msGradientVectorFlow (blitz::Array< blitz::TinyVector< T, 3 >, 3 > &gradient, blitz::TinyVector< T, 3 > const &el_size_um, T mu, T hs, T hr, int max_iter, iRoCS::ProgressReporter *progress) |
ptrdiff_t | phiToIndex (double phi, int bw) |
template<typename DataT , int Dim> | |
void | radialProjection (blitz::Array< blitz::TinyVector< DataT, Dim >, Dim > const &field, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::TinyVector< double, Dim > const ¢erUm, blitz::Array< DataT, Dim > &result) |
Project the elements of the given vector field to rays originating from the given center point. More... | |
void | SH_curvature (double const *cx, double *curvature, int bw) |
void | SH_curvature (double const *cx, double const *cy, double const *cz, double *curvature, int bw) |
void | SH_curvature_gaussian (double const *cx, double const *cy, double const *cz, double *curvature, int bw) |
void | SH_curvature_hesse (double const *cx, double const *cy, double const *cz, double *curvature, int bw) |
void | SH_dpsi (double const *c, int bw, double *d_psi) |
void | SH_dtheta (FrequencyArray const &c, SpatialArray &d_theta, int degree) |
void | SH_dtheta (double const *c, int bw, double *d_theta, int degree=1) |
void | SH_dtheta_up (double const *c, int bw, double *d_theta) |
void | SH_normal (double const *cx, double const *cy, double const *cz, double *nx, double *ny, double *nz, int bw) |
void | SH_normal (double const *cx, double *nx, double *ny, double *nz, int bw) |
float | SH_volume (double const *cx, int bw) |
ptrdiff_t | thetaToIndex (double theta, int bw) |
typedef blitz::Array<std::complex<double>,2> segmentation::SpatialArray |
Definition at line 37 of file SH_tools.hh.
typedef blitz::Array<std::complex<double>,1> segmentation::FrequencyArray |
Definition at line 38 of file SH_tools.hh.
typedef std::vector<SpatialArray*> segmentation::SpatialVecArray |
Definition at line 39 of file SH_tools.hh.
typedef std::vector<FrequencyArray*> segmentation::FrequencyVecArray |
Definition at line 40 of file SH_tools.hh.
void segmentation::edgeFilter | ( | blitz::Array< DataT, 3 > const & | data, |
blitz::TinyVector< double, 3 > const & | elSize, | ||
blitz::Array< DataT, 3 > & | result, | ||
blitz::TinyVector< double, 3 > const & | lbUm = 0.0 , |
||
blitz::TinyVector< double, 3 > const & | ubUm = (std::numeric_limits< double >::infinity()) , |
||
iRoCS::ProgressReporter * | progress = NULL |
||
) |
calculate gradient magnitude with non-maximum-supression
data | input dataset |
elSize | sampling size in micrometers |
result | gradient magnitude with non-maximum supression |
Definition at line 41 of file EdgeFilter-inl.hh.
blitz::Array< DataT, 3 > segmentation::_calculateGradients | ( | blitz::Array< DataT, 3 > const & | data, |
blitz::TinyVector< double, 3 > const & | elSize, | ||
int | direction, | ||
double | scaling, | ||
iRoCS::ProgressReporter * | progress | ||
) |
Definition at line 138 of file EdgeFilter-inl.hh.
void segmentation::radialProjection | ( | blitz::Array< blitz::TinyVector< DataT, Dim >, Dim > const & | field, |
blitz::TinyVector< double, Dim > const & | elementSizeUm, | ||
blitz::TinyVector< double, Dim > const & | centerUm, | ||
blitz::Array< DataT, Dim > & | result | ||
) |
Project the elements of the given vector field to rays originating from the given center point.
field | The vector field to project |
elementSizeUm | The element size in micrometers |
result | The Array to store the projection of the vectors |
centerUm | The point the rays originate from |
void segmentation::geodesicSH | ( | blitz::Array< blitz::TinyVector< DataT, 3 >, 3 > const & | edgeForce, |
blitz::TinyVector< double, 3 > const & | elementSizeUm, | ||
FrequencyArray & | coeffs, | ||
blitz::TinyVector< double, 3 > const & | positionUm, | ||
double | radiusUm, | ||
int | bw, | ||
double | roundness, | ||
int | nIter, | ||
double | tau = 0.1 , |
||
iRoCS::ProgressReporter * | progress = NULL |
||
) |
Evolve an active contour with spherical topology represented by a scalar spherical harmonic function, describing the structure's radius.
edgeForce | The force field guiding the contour in the data term |
elementSizeUm | The element size of the used Arrays in micrometers |
coeffs | After evolution the final spherical harmonic coefficients will be written to the coeffs array |
positionUm | The center position of the initial sphere |
radiusUm | The radius of the initial sphere |
bw | The bandwidth up to which the spherical harmonics will be computed |
roundness | The weight for the roundness term. This is a value greater zero. The higher the value the worse curvature deviations from a sphere are penalized. The usual parameter range is between zero and one. |
nIter | The maximum number of iterations to apply |
tau | The update step width. 0.1 is stable and should not be increased. If you experience oscillations you can try to decrease this value on the expense of slower convergence |
progress | If you want to get feedback about the progress of the evolution you can attach an iRoCS::ProgressReporter. The fraction of current iteration over all iterations will be reported based on the progress reporter's task min and max progress. This is a worst case estimate. Usually the contour will converge to the solution and immediately return before nIter is reached. |
void segmentation::generateMask | ( | FrequencyArray const & | coeffs, |
blitz::Array< bool, 3 > & | mask, | ||
blitz::TinyVector< double, 3 > const & | elementSizeUm, | ||
blitz::TinyVector< double, 3 > const & | centerUm | ||
) |
Generate a binary mask being true inside the spherical function and false outside.
The spherical function will be centered at the given center point. The mask Array has to be given in the appropriate shape.
coeffs | The SH coefficients describing the surface of the object in spherical topology. |
mask | The binary Array, the mask will be written to |
elementSizeUm | The element size of the mask in micrometers |
centerUm | The center of the object to generate a mask from |
void segmentation::geodesic_sh | ( | blitz::Array< blitz::TinyVector< float, 3 >, 3 > const & | gvf, |
blitz::TinyVector< float, 3 > const & | elementSizeUm, | ||
FrequencyArray & | coeffs, | ||
blitz::TinyVector< float, 3 > | positionUm, | ||
float | radiusUm, | ||
int | bw, | ||
double | roundness, | ||
int | num_iter, | ||
iRoCS::ProgressReporter * | progress = NULL |
||
) |
Geodesic Active contours.
gvf | a gradient vector flow field |
elementSizeUm | element size in um |
coeffs | The SH coefficients describing the evolved surface |
positionUm | center of sphere used for initialization (in um) |
radiusUm | radius of wphere used for initialization (in um) |
bw | cutoff bandwidth |
num_iter | number of gradient descent iterations |
void segmentation::geodesic_sh | ( | blitz::Array< blitz::TinyVector< float, 3 >, 3 > const & | gvf, |
blitz::TinyVector< float, 3 > const & | el_size_um, | ||
blitz::TinyVector< float, 3 > | best_center, | ||
float | best_radius, | ||
int | bandwidth, | ||
double | roundness, | ||
int | num_iter, | ||
blitz::Array< bool, 3 > & | mask, | ||
blitz::Array< blitz::TinyVector< float, 3 >, 3 > & | normals, | ||
iRoCS::ProgressReporter * | progress = NULL |
||
) |
Geodesic Active contours.
gvf | a gradient vector flow field |
el_size_um | element size in um |
best_center | center of sphere used for initialization (in um) |
best_radius | radius of wphere used for initialization (in um) |
bandwidth | cutoff bandwidth |
num_iter | number of gradient descent iterations |
mask | output mask |
normal | normals of mask |
void segmentation::gradientVectorFlowSOR | ( | blitz::Array< blitz::TinyVector< T, 3 >, 3 > & | gradient, |
blitz::TinyVector< T, 3 > const & | el_size_um, | ||
T | mu, | ||
T | nu, | ||
int | max_iter, | ||
iRoCS::ProgressReporter * | progress | ||
) |
Solve Euler-Lagrange equation for gradient vector flow using successive over-relaxation
u : output gradient vector flow f : input vector field.
Definition at line 51 of file gvf-inl.hh.
void segmentation::msGradientVectorFlow | ( | blitz::Array< blitz::TinyVector< T, 3 >, 3 > & | gradient, |
blitz::TinyVector< T, 3 > const & | el_size_um, | ||
T | mu, | ||
T | hs, | ||
T | hr, | ||
int | max_iter, | ||
iRoCS::ProgressReporter * | progress | ||
) |
Definition at line 147 of file gvf-inl.hh.
std::vector<blitz::Array<T, 2> > segmentation::collectSelectedClusterProfiles | ( | const blitz::Array< T, 2 > & | profiles, |
const std::vector< ptrdiff_t > & | labels, | ||
const std::set< ptrdiff_t > & | selected_clusters | ||
) |
Builds a vector of blitz Arrays (profiles) for selected clusters each element of the vector corresponds to the profiles of a selected cluster.
profiles | all profiles, as returned by ProfileSampler. Rows in the Array correspond to indiviual profiles |
labels | a vector which associated a label [0, size() -1] to each profile |
selected_clusters | only labels in this set are processed |
Definition at line 52 of file helpers-inl.hh.
double segmentation::kmeans | ( | const unsigned int | k, |
const blitz::Array< DataT, 2 > & | points, | ||
blitz::Array< DataT, 2 > & | means, | ||
std::vector< int > & | labels | ||
) |
Definition at line 216 of file kmeans-inl.hh.
Referenced by kmeans().
double segmentation::kmeans | ( | const unsigned int | k, |
const blitz::Array< DataT, 2 > & | points, | ||
blitz::Array< DataT, 2 > & | means, | ||
std::vector< int > & | labels | ||
) |
Definition at line 216 of file kmeans-inl.hh.
Referenced by kmeans().
std::complex<double> segmentation::evaluateSH | ( | FrequencyArray const & | coeffs, |
double | theta, | ||
double | phi | ||
) |
ptrdiff_t segmentation::thetaToIndex | ( | double | theta, |
int | bw | ||
) |
ptrdiff_t segmentation::phiToIndex | ( | double | phi, |
int | bw | ||
) |
double segmentation::indexToTheta | ( | ptrdiff_t | index, |
int | bw | ||
) |
double segmentation::indexToPhi | ( | ptrdiff_t | index, |
int | bw | ||
) |
blitz::TinyVector<double,2> segmentation::indexToAngles | ( | blitz::TinyVector< ptrdiff_t, 2 > const & | index, |
int | bw | ||
) |
ptrdiff_t segmentation::linearIndex | ( | int | bw, |
int | l, | ||
int | m | ||
) |
void segmentation::SH_dtheta_up | ( | double const * | c, |
int | bw, | ||
double * | d_theta | ||
) |
void segmentation::SH_dtheta | ( | FrequencyArray const & | c, |
SpatialArray & | d_theta, | ||
int | degree | ||
) |
void segmentation::SH_dtheta | ( | double const * | c, |
int | bw, | ||
double * | d_theta, | ||
int | degree = 1 |
||
) |
void segmentation::SH_dpsi | ( | double const * | c, |
int | bw, | ||
double * | d_psi | ||
) |
void segmentation::SH_normal | ( | double const * | cx, |
double const * | cy, | ||
double const * | cz, | ||
double * | nx, | ||
double * | ny, | ||
double * | nz, | ||
int | bw | ||
) |
void segmentation::SH_normal | ( | double const * | cx, |
double * | nx, | ||
double * | ny, | ||
double * | nz, | ||
int | bw | ||
) |
void segmentation::SH_curvature | ( | double const * | cx, |
double * | curvature, | ||
int | bw | ||
) |
float segmentation::SH_volume | ( | double const * | cx, |
int | bw | ||
) |
void segmentation::SH_curvature | ( | double const * | cx, |
double const * | cy, | ||
double const * | cz, | ||
double * | curvature, | ||
int | bw | ||
) |
void segmentation::SH_curvature_gaussian | ( | double const * | cx, |
double const * | cy, | ||
double const * | cz, | ||
double * | curvature, | ||
int | bw | ||
) |
void segmentation::SH_curvature_hesse | ( | double const * | cx, |
double const * | cy, | ||
double const * | cz, | ||
double * | curvature, | ||
int | bw | ||
) |