iRoCS Toolbox
1.1.0
|
The Nucleus class contains cell nucleus attributes and provides methods to load and save single nuclei and sets of nuclei from/to hdf5 files in a format compatible to labelling. More...
#include "libArrayToolbox/ATBNucleus.hh"
Public Member Functions | |
Nucleus () | |
Default constructor. More... | |
Nucleus (Nucleus const &nc) | |
Copy constructor. More... | |
~Nucleus () | |
Destructor. More... | |
double | borderDistanceUm () const |
Get the distance of this nucleus to the outer root boundary in micrometers. More... | |
int | cellfile () const |
Get the cell file index of this nucleus. More... | |
double | confidence () const |
Get the content of the confidence field of this Nucleus. More... | |
std::vector< double > & | features () |
Get a random-access reference to the feature vector of this Nucleus. More... | |
std::vector< double > const & | features () const |
Get a read-only reference to the feature vector of this Nucleus. More... | |
std::string const & | id () const |
Get the id string for this Nucleus. More... | |
int | label () const |
Get the cell layer label of the nucleus. More... | |
bool | manual () const |
Get the manual flag for this Nucleus. More... | |
bool | mitotic () const |
Get the mitotic state (dividing/not dividing) of this Nucleus. More... | |
bool | needsFeatureUpdate () const |
This function should return true if the feature vector needs to be recomputed prior to a classification, false otherwise. More... | |
bool | operator< (const Nucleus &rhs) const |
Less than operator comparing the value field of this Nucleus and the given right-hand-side Nucleus. More... | |
Nucleus & | operator= (Nucleus const &nc) |
Copy assignment operator. More... | |
double | phi () const |
Get the angle around the root axis of this nucleus in radians. More... | |
blitz::TinyVector< double, 3 > const & | positionUm () const |
Get the Nucleus position in micrometers. More... | |
int | predictedCellfile () const |
Get the predicted cell file index of this nucleus. More... | |
int | predictedLabel () const |
Get the predicted cell layer label of the nucleus. More... | |
bool | predictedMitotic () const |
Get the predicted mitotic state (dividing/not dividing) of this Nucleus. More... | |
int | predictedSubtype () const |
Get the predicted sub-type of this Nucleus. More... | |
std::map< int, double > & | probabilityMap () |
Get a random-access reference to the probability map of this Nucleus. More... | |
std::map< int, double > const & | probabilityMap () const |
Get a read-only reference to the probability map of this Nucleus. More... | |
double | qcDistanceUm () const |
Get the (signed) distance between this nucleus and the root's quiescent center along the root axis in micrometers. More... | |
double | radialDistanceUm () const |
Get the distance of this nucleus to the root axis in micrometers. More... | |
double | radiusUm () const |
Get the radius of the Nucleus in micrometers. More... | |
void | setBorderDistanceUm (double borderDistanceUm) |
Set the distance of this nucleus to the outer root boundary in micrometers. More... | |
void | setCellfile (int cellfile) |
Set the cell file index of this nucleus. More... | |
void | setConfidence (double confidence) |
Set the content of the confidence field of this Nucleus. More... | |
void | setId (std::string const &id) |
Set the id string for this Nucleus. More... | |
void | setLabel (int label) |
Set the cell layer label of the nucleus. More... | |
void | setManual (bool manual) |
Set the manual flag for this Nucleus. More... | |
void | setMitotic (bool mitotic) |
Set the mitotic state (dividing/not dividing) of this Nucleus. More... | |
void | setNeedsFeatureUpdate (bool needsFeatureUpdate) |
Set or reset the needsFeatureUpdate flag. More... | |
void | setPhi (const double phi) |
Set the angle around the root axis of this nucleus in radians. More... | |
void | setPositionUm (blitz::TinyVector< double, 3 > const &positionUm) |
Set the Nucleus position in micrometers. More... | |
void | setPredictedCellfile (int predictedCellfile) |
Set the predicted cell file index of this nucleus. More... | |
void | setPredictedLabel (int predictedLabel) |
Set the predicted cell layer label of the nucleus. More... | |
void | setPredictedMitotic (bool predictedMitotic) |
Set the predicted mitotic state (dividing/not dividing) of this Nucleus. More... | |
void | setPredictedSubtype (int subType) |
Set the predicted sub-type of this Nucleus. More... | |
void | setQcDistanceUm (double qcDistanceUm) |
Set the (signed) distance between this nucleus and the root's quiescent center along the root axis in micrometers. More... | |
void | setRadialDistanceUm (double radialDistanceUm) |
Set the distance of this nucleus to the root axis in micrometers. More... | |
void | setRadiusUm (const double radiusUm) |
Set the radius of the Nucleus in micrometers. More... | |
void | setSphase (double sphase) |
Set the S-Phase probability of this Nucleus. More... | |
void | setSubtype (int subType) |
Set the sub-type of this Nucleus. More... | |
void | setValue (double value) |
Set the content of the value field of this Nucleus. More... | |
void | setVolumeUm3 (double volumeUm3) |
Set the volume of this nucleus in micrometers cube. More... | |
blitz::Array< std::complex< double >, 1 > const & | shCoefficients () const |
Get a read-only reference to the spherical harmonic coefficients describing the shape of this Nucleus. More... | |
blitz::Array< std::complex< double >, 1 > & | shCoefficients () |
Get a random-access reference to the spherical harmonic coefficients describing the shape of this Nucleus. More... | |
double | sphase () const |
Get the S-Phase probability of this Nucleus (if available). More... | |
int | subtype () const |
Get the sub-type of this Nucleus. More... | |
double | value () const |
Get the content of the value field of this Nucleus. More... | |
double | volumeUm3 () const |
Get the volume of this nucleus in micrometers cube. More... | |
Static Public Member Functions | |
template<typename NucleusSequenceT > | |
static void | loadList (NucleusSequenceT &nuclei, BlitzH5File const &inFile, std::string const &group, bool showWarnings=false) |
File IO Function for reading a list of Nuclei. More... | |
template<typename NucleusSequenceT > | |
static void | loadList (NucleusSequenceT &nuclei, std::string const &inFileName, std::string const &group, bool showWarnings=false) |
File IO Function for reading a list of Nuclei. More... | |
template<typename NucleusSequenceT > | |
static void | saveList (NucleusSequenceT const &nuclei, BlitzH5File &outFile, std::string const &group) |
File IO Function for writing a list of Nuclei. More... | |
template<typename NucleusSequenceT > | |
static void | saveList (NucleusSequenceT const &nuclei, std::string const &outFileName, std::string const &group) |
File IO Function for writing a list of Nuclei. More... | |
The Nucleus class contains cell nucleus attributes and provides methods to load and save single nuclei and sets of nuclei from/to hdf5 files in a format compatible to labelling.
Definition at line 59 of file ATBNucleus.hh.
|
inline |
Default constructor.
Creates a new Nucleus object with default values.
Definition at line 96 of file ATBNucleus.hh.
|
inline |
Copy constructor.
Creates a new Nucleus object identical to the given one.
Definition at line 113 of file ATBNucleus.hh.
|
inline |
Destructor.
Definition at line 136 of file ATBNucleus.hh.
Copy assignment operator.
Copies the attributes of the given Nucleus object into this object.
nc | The nucleus to copy |
Definition at line 147 of file ATBNucleus.hh.
|
inline |
Get the id string for this Nucleus.
The id will not be written or loaded. It exists only for convenience to identify a nucleus. The user has to ensure that this field has a unique value per nucleus if required.
Definition at line 187 of file ATBNucleus.hh.
Referenced by setId().
|
inline |
Set the id string for this Nucleus.
The id will not be written or loaded. It exists only for convenience to identify a nucleus. The user has to ensure that this field has a unique value per nucleus if required.
id | The new id string of this Nucleus |
Definition at line 202 of file ATBNucleus.hh.
|
inline |
Get the Nucleus position in micrometers.
Definition at line 214 of file ATBNucleus.hh.
Referenced by setPositionUm().
|
inline |
Set the Nucleus position in micrometers.
positionUm | The new Nucleus position in micrometers |
Definition at line 226 of file ATBNucleus.hh.
|
inline |
Get the cell layer label of the nucleus.
If the manual flag is set this is the manually assigned ground truth label which should not have been touched by automatic classifications.
label | The label of the nucleus, the following list are the defaults: -1 : unknown 0 : no nucleus 1 : Root Cap 2 : Epidermis 3 : Cortex 4 : Endodermis 5 : Pericycle 6 : Vasculature |
Definition at line 249 of file ATBNucleus.hh.
Referenced by setLabel().
|
inline |
Set the cell layer label of the nucleus.
If you additionally set the manual flag this label is treated as groundtruth label and should not be altered by automatic classification algorithms.
label | The label of the nucleus, the following list are the defaults: -1 : unknown 0 : no nucleus 1 : Root Cap 2 : Epidermis 3 : Cortex 4 : Endodermis 5 : Pericycle 6 : Vasculature |
Definition at line 272 of file ATBNucleus.hh.
|
inline |
Get the predicted cell layer label of the nucleus.
This field should be set by automatic classifiers to allow comparison to manually assigned labels.
label | The predicted label of the nucleus, the following list are the defaults: -1 : unknown 0 : no nucleus 1 : Root Cap 2 : Epidermis 3 : Cortex 4 : Endodermis 5 : Pericycle 6 : Vasculature |
Definition at line 295 of file ATBNucleus.hh.
Referenced by setPredictedLabel().
|
inline |
Set the predicted cell layer label of the nucleus.
This field should be set by automatic classifiers to allow comparison to manually assigned labels.
label | The predicted label of the nucleus, the following list are the defaults: -1 : unknown 0 : no nucleus 1 : Root Cap 2 : Epidermis 3 : Cortex 4 : Endodermis 5 : Pericycle 6 : Vasculature |
Definition at line 318 of file ATBNucleus.hh.
|
inline |
Get the manual flag for this Nucleus.
This flag should be set for manual ground truth annotations. The manually assigned label, sub-type and division status can then be queried using the label(), subType() and mitotic() methods. If this flag is set automatic classifiers may not alter the label, sub-type or mitotic state.
Definition at line 334 of file ATBNucleus.hh.
Referenced by setManual().
|
inline |
Set the manual flag for this Nucleus.
This flag should be set for manual ground truth annotations. The manually assigned label, sub-type and division status can then be queried using the label(), subType() and mitotic() methods. If this flag is set automatic classifiers may not alter the label, sub-type or mitotic state.
manual | A bool indicating whether the Nucleus is manually annotated. |
Definition at line 350 of file ATBNucleus.hh.
|
inline |
This function should return true if the feature vector needs to be recomputed prior to a classification, false otherwise.
Definition at line 363 of file ATBNucleus.hh.
Referenced by setNeedsFeatureUpdate().
|
inline |
Set or reset the needsFeatureUpdate flag.
needsFeatureUpdate | A bool indicating whether a feature recomputation is required |
Definition at line 376 of file ATBNucleus.hh.
|
inline |
Get a random-access reference to the feature vector of this Nucleus.
Definition at line 388 of file ATBNucleus.hh.
|
inline |
Get a read-only reference to the feature vector of this Nucleus.
Definition at line 400 of file ATBNucleus.hh.
|
inline |
Get a random-access reference to the probability map of this Nucleus.
The probability map should be used to store soft class assignments. For each possible label it should contain the probability that the Nucleus belongs to that class.
Definition at line 415 of file ATBNucleus.hh.
|
inline |
Get a read-only reference to the probability map of this Nucleus.
The probability map should be used to store soft class assignments. For each possible label it should contain the probability that the Nucleus belongs to that class.
Definition at line 430 of file ATBNucleus.hh.
|
inline |
Get the (signed) distance between this nucleus and the root's quiescent center along the root axis in micrometers.
This is the iRoCS z coordinate.
Definition at line 445 of file ATBNucleus.hh.
Referenced by setQcDistanceUm().
|
inline |
Set the (signed) distance between this nucleus and the root's quiescent center along the root axis in micrometers.
This is the iRoCS z coordinate.
qcDistanceUm | The distance of this nucleus to the quiescent center along the axis |
Definition at line 460 of file ATBNucleus.hh.
|
inline |
Get the distance of this nucleus to the root axis in micrometers.
This is the iRoCS r coordinate.
Definition at line 473 of file ATBNucleus.hh.
Referenced by setRadialDistanceUm().
|
inline |
Set the distance of this nucleus to the root axis in micrometers.
This is the iRoCS r coordinate.
radialDistanceUm | The distance of this nucleus to the root axis |
Definition at line 486 of file ATBNucleus.hh.
|
inline |
Get the angle around the root axis of this nucleus in radians.
This is the iRoCS phi coordinate.
Definition at line 499 of file ATBNucleus.hh.
Referenced by setPhi().
|
inline |
Set the angle around the root axis of this nucleus in radians.
This is the iRoCS phi coordinate.
Definition at line 512 of file ATBNucleus.hh.
|
inline |
Get the radius of the Nucleus in micrometers.
This should be the nucleolus radius.
Definition at line 525 of file ATBNucleus.hh.
Referenced by setRadiusUm().
|
inline |
Set the radius of the Nucleus in micrometers.
This should be set to the nucleolus radius if possible.
radiusUm | The nucleolus radius in micrometers |
Definition at line 538 of file ATBNucleus.hh.
|
inline |
Get a read-only reference to the spherical harmonic coefficients describing the shape of this Nucleus.
If the coefficients are empty the Nucleus is assumed to be perfectly spherical with the stored radius.
Definition at line 553 of file ATBNucleus.hh.
|
inline |
Get a random-access reference to the spherical harmonic coefficients describing the shape of this Nucleus.
If the coefficients are empty the Nucleus is assumed to be perfectly spherical with the stored radius.
Definition at line 568 of file ATBNucleus.hh.
|
inline |
Get the content of the value field of this Nucleus.
The value field is a general purpose parameter which is mainly used to sort the Nuclei. It can be used to store probabilities or the like.
Definition at line 582 of file ATBNucleus.hh.
Referenced by operator<(), and setValue().
|
inline |
Set the content of the value field of this Nucleus.
The value field is a general purpose parameter which is mainly used to sort the Nuclei. It can be used to store probabilities or the like.
value | The new content of the value field |
Definition at line 596 of file ATBNucleus.hh.
|
inline |
Get the content of the confidence field of this Nucleus.
The confidence field is a general purpose parameter. It can be used to store classification confidences or the like.
Definition at line 610 of file ATBNucleus.hh.
Referenced by setConfidence().
|
inline |
Set the content of the confidence field of this Nucleus.
The confidence field is a general purpose parameter. It can be used to store classification confidences or the like.
confidence | The new confidence |
Definition at line 624 of file ATBNucleus.hh.
|
inline |
Get the S-Phase probability of this Nucleus (if available).
S-Phase is the DNA synthesis phase in the cell cycle.
Definition at line 637 of file ATBNucleus.hh.
Referenced by setSphase().
|
inline |
Set the S-Phase probability of this Nucleus.
S-Phase is the DNA synthesis phase in the cell cycle.
sphase | The probability of being in S-Phase |
Definition at line 650 of file ATBNucleus.hh.
|
inline |
Get the distance of this nucleus to the outer root boundary in micrometers.
This parameter is more stable than the distance to the axis, but is hard to get without cell boundary markers. Usually it will be unused.
Definition at line 665 of file ATBNucleus.hh.
Referenced by setBorderDistanceUm().
|
inline |
Set the distance of this nucleus to the outer root boundary in micrometers.
This parameter is more stable than the distance to the axis, but is hard to get without cell boundary markers. Usually it will be unused.
The distance of this nucleus to the root boundary
Definition at line 680 of file ATBNucleus.hh.
|
inline |
Get the volume of this nucleus in micrometers cube.
A segmentation should store the segment volume here.
Definition at line 693 of file ATBNucleus.hh.
Referenced by setVolumeUm3().
|
inline |
Set the volume of this nucleus in micrometers cube.
A segmentation should store the segment volume using this method.
volumeUm3 | The nucleus volume in micrometers |
Definition at line 706 of file ATBNucleus.hh.
|
inline |
Get the mitotic state (dividing/not dividing) of this Nucleus.
The mitotic flag is specifically designed to store manual annotations that will not be altered by automatic classifications if the manualFlag for this Nucleus is set.
Definition at line 722 of file ATBNucleus.hh.
Referenced by setMitotic().
|
inline |
Set the mitotic state (dividing/not dividing) of this Nucleus.
The mitotic flag is specifically designed to store manual annotations that will not be altered by automatic classifications if the manualFlag for this Nucleus is set.
mitotic | A bool indicating whether the cell the nucleus belongs to is currently dividing |
Definition at line 738 of file ATBNucleus.hh.
|
inline |
Get the predicted mitotic state (dividing/not dividing) of this Nucleus.
The predictedMitotic flag is specifically designed to store automatic classification results.
Definition at line 753 of file ATBNucleus.hh.
Referenced by setPredictedMitotic().
|
inline |
Set the predicted mitotic state (dividing/not dividing) of this Nucleus.
The predictedMitotic flag is specifically designed to store automatic classification results.
Definition at line 768 of file ATBNucleus.hh.
|
inline |
Get the sub-type of this Nucleus.
The subtype can be used to differentiate between sub-populations within layers (with are distinguished using the label attribute). E.g. epidermis has two sub-types: trichoblasts and atrichoblasts. The subtype field is specifically designed for manual ground-truth annotations and should not be touched by automatic classification if the manual flag is set.
Definition at line 785 of file ATBNucleus.hh.
|
inline |
Set the sub-type of this Nucleus.
The subtype can be used to differentiate between sub-populations within layers (with are distinguished using the label attribute). E.g. epidermis has two sub-types: trichoblasts and atrichoblasts. The subtype field is specifically designed for manual ground-truth annotations and should not be touched by automatic classification if the manual flag is set.
subType | The subtype of this Nucleus |
Definition at line 802 of file ATBNucleus.hh.
|
inline |
Get the predicted sub-type of this Nucleus.
The subtype can be used to differentiate between sub-populations within layers (with are distinguished using the label attribute). E.g. epidermis has two sub-types: trichoblasts and atrichoblasts. The predictedSubtype field is specifically designed for automatic classifications.
Definition at line 818 of file ATBNucleus.hh.
|
inline |
Set the predicted sub-type of this Nucleus.
The subtype can be used to differentiate between sub-populations within layers (with are distinguished using the label attribute). E.g. epidermis has two sub-types: trichoblasts and atrichoblasts. The predictedSubtype field is specifically designed for automatic classifications.
subType | The predicted subtype of this Nucleus |
Definition at line 834 of file ATBNucleus.hh.
|
inline |
Get the cell file index of this nucleus.
A cell file is a linear chain of cells aligned along the root axis with common lineage. The cellfile field is specifically designed for manual ground-truth annotations and should not be touched by automatic classification if the manual flag is set.
Definition at line 850 of file ATBNucleus.hh.
Referenced by setCellfile().
|
inline |
Set the cell file index of this nucleus.
A cell file is a linear chain of cells aligned along the root axis with common lineage. The cellfile field is specifically designed for manual ground-truth annotations and should not be touched by automatic classification if the manual flag is set.
cellfile | The cell file index of this Nucleus |
Definition at line 866 of file ATBNucleus.hh.
|
inline |
Get the predicted cell file index of this nucleus.
A cell file is a linear chain of cells aligned along the root axis with common lineage. The cellfile field is specifically designed for automatic classifications.
Definition at line 881 of file ATBNucleus.hh.
Referenced by setPredictedCellfile().
|
inline |
Set the predicted cell file index of this nucleus.
A cell file is a linear chain of cells aligned along the root axis with common lineage. The cellfile field is specifically designed for automatic classifications.
predictedCellfile | The predicted cell file index of this Nucleus |
Definition at line 896 of file ATBNucleus.hh.
|
inline |
|
static |
File IO Function for writing a list of Nuclei.
nuclei | A set of nuclei in some stl-sequence like list or vector. More specific: the type NucleusSequenceT must support stl-like iteration, push_back(), pop_back(), back() and empty(). |
outFile | A file handle to the hdf5 I/O file, which must be opened for writing |
group | The group to write the nuclei to. |
BlitzH5Error | If something goes wrong this error will be thrown |
Referenced by operator<().
|
static |
File IO Function for writing a list of Nuclei.
On error it prints an error message to std::cerr and the program exits with a status of -1
nuclei | A set of nuclei in some stl-sequence like list or vector. More specific: the type NucleusSequenceT must support stl-like iteration, push_back(), pop_back(), back() and empty(). |
outFileName | A file with the given name will be created or if existing opened for writing the nuclei to |
group | The group to write the nuclei to. |
|
static |
File IO Function for reading a list of Nuclei.
nuclei | A set of nuclei in some stl-sequence like list or vector. More specific: the type NucleusSequenceT must support stl-like iteration, push_back(), pop_back(), back() and empty(). |
inFile | A file handle to the hdf5 I/O file |
group | The group to read the nuclei from. |
showWarnings | If this flag is set to true, missing meta data will produce output of warnings. |
BlitzH5Error | If something goes wrong this error will be thrown |
RuntimeError | If the read position information is not 3-D this error is thrown (only version 2) |
Referenced by operator<().
|
static |
File IO Function for reading a list of Nuclei.
On error it prints an error message to std::cerr and the program exits with a status of -1
nuclei | A set of nuclei in some stl-sequence like list or vector. More specific: the type NucleusSequenceT must support stl-like iteration, push_back(), pop_back(), back() and empty(). |
inFileName | A file with the given name will be opened for reading the nuclei from |
group | The group to read the nuclei from. |
showWarnings | If this flag is set to true, missing meta data will produce warnings. |