37 #include <blitz/array.h> 64 NucleusId(
double r,
const bool m)
75 if (radius == ncId.radius &&
76 mitotic == ncId.mitotic)
return true;
80 bool operator<(
const NucleusId& ncId)
const 82 if (radius < ncId.radius)
return true;
83 if (radius > ncId.radius)
return false;
84 if (!mitotic && ncId.mitotic)
return true;
97 : _id(
"marker"), _positionUm(-1.0), _label(-1), _predictedLabel(-1),
98 _manual(false), _needsFeatureUpdate(true), _features(),
99 _probabilityMap(), _qcDistanceUm(-1.0), _radialDistanceUm(-1.0),
100 _phi(-1.0), _radiusUm(-1.0), _coefficients(),
101 _value(-1.0), _confidence(-1.0), _sphase(-1.0),
102 _borderDistanceUm(-1.0), _volumeUm3(-1.0), _mitotic(false),
103 _predictedMitotic(false), _subtype(-1), _predictedSubtype(-1),
104 _cellfile(-1), _predictedCellfile(-1)
114 : _id(nc._id), _positionUm(nc._positionUm), _label(nc._label),
115 _predictedLabel(nc._predictedLabel), _manual(nc._manual),
116 _needsFeatureUpdate(nc._needsFeatureUpdate),
117 _features(nc._features), _probabilityMap(nc._probabilityMap),
118 _qcDistanceUm(nc._qcDistanceUm),
119 _radialDistanceUm(nc._radialDistanceUm), _phi(nc._phi),
120 _radiusUm(nc._radiusUm), _coefficients(nc._coefficients.shape()),
121 _value(nc._value), _confidence(nc._confidence),
122 _sphase(nc._sphase), _borderDistanceUm(nc._borderDistanceUm),
123 _volumeUm3(nc._volumeUm3), _mitotic(nc._mitotic),
124 _predictedMitotic(nc._predictedMitotic), _subtype(nc._subtype),
125 _predictedSubtype(nc._predictedSubtype), _cellfile(nc._cellfile),
126 _predictedCellfile(nc._predictedCellfile)
128 _coefficients = nc._coefficients;
150 _positionUm = nc._positionUm;
152 _predictedLabel = nc._predictedLabel;
153 _manual = nc._manual;
154 _needsFeatureUpdate = nc._needsFeatureUpdate;
155 _features = nc._features;
156 _probabilityMap = nc._probabilityMap;
157 _qcDistanceUm = nc._qcDistanceUm;
158 _radialDistanceUm = nc._radialDistanceUm;
160 _radiusUm = nc._radiusUm;
161 _coefficients.resize(nc._coefficients.shape());
162 _coefficients = nc._coefficients;
164 _confidence = nc._confidence;
165 _sphase = nc._sphase;
166 _borderDistanceUm = nc._borderDistanceUm;
167 _volumeUm3 = nc._volumeUm3;
168 _mitotic = nc._mitotic;
169 _predictedMitotic = nc._predictedMitotic;
170 _subtype = nc._subtype;
171 _predictedSubtype = nc._predictedSubtype;
172 _cellfile = nc._cellfile;
173 _predictedCellfile = nc._predictedCellfile;
187 std::string
const &
id()
const 297 return _predictedLabel;
365 return _needsFeatureUpdate;
417 return _probabilityMap;
432 return _probabilityMap;
447 return _qcDistanceUm;
475 return _radialDistanceUm;
555 return _coefficients;
570 return _coefficients;
667 return _borderDistanceUm;
755 return _predictedMitotic;
820 return _predictedSubtype;
836 _predictedSubtype = subType;
883 return _predictedCellfile;
913 return _value < rhs.
value();
932 template<
typename NucleusSequenceT>
934 NucleusSequenceT
const &nuclei,
BlitzH5File &outFile,
935 std::string
const &group);
951 template<
typename NucleusSequenceT>
953 NucleusSequenceT
const &nuclei, std::string
const &outFileName,
954 std::string
const &group);
975 template<
typename NucleusSequenceT>
976 static void loadList(NucleusSequenceT &nuclei,
977 BlitzH5File const &inFile, std::string
const &group,
978 bool showWarnings =
false);
996 template<
typename NucleusSequenceT>
998 NucleusSequenceT &nuclei, std::string
const &inFileName,
999 std::string
const &group,
bool showWarnings =
false);
1003 static void _loadFixedSize(
1004 blitz::Array<bool,1> &buf,
BlitzH5File const &inFile,
1005 std::string
const &dsName,
bool showWarnings =
false);
1007 template<
typename DataT>
1008 static void _loadFixedSize(
1009 blitz::Array<DataT,1> &buf,
BlitzH5File const &inFile,
1010 std::string
const &dsName,
bool showWarnings =
false);
1014 blitz::TinyVector<double,3> _positionUm;
1015 int _label, _predictedLabel;
1016 bool _manual, _needsFeatureUpdate;
1017 std::vector<double> _features;
1018 std::map<int,double> _probabilityMap;
1019 double _qcDistanceUm, _radialDistanceUm, _phi;
1025 blitz::Array<std::complex<double>,1> _coefficients;
1028 double _value, _confidence, _sphase, _borderDistanceUm, _volumeUm3;
1029 bool _mitotic, _predictedMitotic;
1030 int _subtype, _predictedSubtype, _cellfile, _predictedCellfile;
1049 #include "ATBNucleus.icc" void setPredictedSubtype(int subType)
Set the predicted sub-type of this Nucleus.
std::string const & id() const
Get the id string for this Nucleus.
TinyMatrix< bool, NRows, NColumns > operator==(TinyMatrix< DataT, NRows, NColumns > const &lhs, TinyMatrix< DataT, NRows, NColumns > const &rhs)
Elementwise comparison for equality of two blitz::TinyMatrices.
bool needsFeatureUpdate() const
This function should return true if the feature vector needs to be recomputed prior to a classificati...
The Nucleus class contains cell nucleus attributes and provides methods to load and save single nucle...
void setPredictedLabel(int predictedLabel)
Set the predicted cell layer label of the nucleus.
double sphase() const
Get the S-Phase probability of this Nucleus (if available).
void setRadialDistanceUm(double radialDistanceUm)
Set the distance of this nucleus to the root axis in micrometers.
std::map< int, double > & probabilityMap()
Get a random-access reference to the probability map of this Nucleus.
void setPredictedCellfile(int predictedCellfile)
Set the predicted cell file index of this nucleus.
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...
static void loadList(NucleusSequenceT &nuclei, BlitzH5File const &inFile, std::string const &group, bool showWarnings=false)
File IO Function for reading a list of Nuclei.
Exception specialization for error handling within libArrayToolbox.
std::ostream & operator<<(std::ostream &os, BasicTreeNode< KeyT, ContentT > const &n)
double qcDistanceUm() const
Get the (signed) distance between this nucleus and the root's quiescent center along the root axis in...
int predictedCellfile() const
Get the predicted cell file index of this nucleus.
int subtype() const
Get the sub-type of this Nucleus.
std::map< int, double > const & probabilityMap() const
Get a read-only reference to the probability map of this Nucleus.
std::vector< double > & features()
Get a random-access reference to the feature vector of this Nucleus.
bool operator<(const Nucleus &rhs) const
Less than operator comparing the value field of this Nucleus and the given right-hand-side Nucleus...
std::vector< double > const & features() const
Get a read-only reference to the feature vector of this Nucleus.
bool predictedMitotic() const
Get the predicted mitotic state (dividing/not dividing) of this Nucleus.
Lightweight alternative to libBlitzHDF5 providing its basic functionality.
void setPhi(const double phi)
Set the angle around the root axis of this nucleus in radians.
int predictedSubtype() const
Get the predicted sub-type of this Nucleus.
void setSubtype(int subType)
Set the sub-type of this Nucleus.
void setManual(bool manual)
Set the manual flag for this Nucleus.
void setId(std::string const &id)
Set the id string for this Nucleus.
blitz::TinyVector< double, 3 > const & positionUm() const
Get the Nucleus position in micrometers.
Query specific information about different data types.
void setConfidence(double confidence)
Set the content of the confidence field of this Nucleus.
void setRadiusUm(const double radiusUm)
Set the radius of the Nucleus in micrometers.
double value() const
Get the content of the value field of this Nucleus.
Nucleus & operator=(Nucleus const &nc)
Copy assignment operator.
void setMitotic(bool mitotic)
Set the mitotic state (dividing/not dividing) of this Nucleus.
void setQcDistanceUm(double qcDistanceUm)
Set the (signed) distance between this nucleus and the root's quiescent center along the root axis in...
double radiusUm() const
Get the radius of the Nucleus in micrometers.
void setLabel(int label)
Set the cell layer label of the nucleus.
Nucleus(Nucleus const &nc)
Copy constructor.
void setValue(double value)
Set the content of the value field of this Nucleus.
int cellfile() const
Get the cell file index of this nucleus.
int label() const
Get the cell layer label of the nucleus.
void setVolumeUm3(double volumeUm3)
Set the volume of this nucleus in micrometers cube.
void setPositionUm(blitz::TinyVector< double, 3 > const &positionUm)
Set the Nucleus position in micrometers.
bool manual() const
Get the manual flag for this Nucleus.
bool mitotic() const
Get the mitotic state (dividing/not dividing) of this Nucleus.
static void saveList(NucleusSequenceT const &nuclei, BlitzH5File &outFile, std::string const &group)
File IO Function for writing a list of Nuclei.
double phi() const
Get the angle around the root axis of this nucleus in radians.
void setSphase(double sphase)
Set the S-Phase probability of this Nucleus.
void setBorderDistanceUm(double borderDistanceUm)
Set the distance of this nucleus to the outer root boundary in micrometers.
Nucleus()
Default constructor.
void setPredictedMitotic(bool predictedMitotic)
Set the predicted mitotic state (dividing/not dividing) of this Nucleus.
double radialDistanceUm() const
Get the distance of this nucleus to the root axis in micrometers.
blitz::Array< std::complex< double >, 1 > & shCoefficients()
Get a random-access reference to the spherical harmonic coefficients describing the shape of this Nuc...
double borderDistanceUm() const
Get the distance of this nucleus to the outer root boundary in micrometers.
double confidence() const
Get the content of the confidence field of this Nucleus.
void setCellfile(int cellfile)
Set the cell file index of this nucleus.
int predictedLabel() const
Get the predicted cell layer label of the nucleus.
void setNeedsFeatureUpdate(bool needsFeatureUpdate)
Set or reset the needsFeatureUpdate flag.
double volumeUm3() const
Get the volume of this nucleus in micrometers cube.