27 namespace ReleaseToolsMisc {
59 std::vector<size_t> *matchedRegExIdxVec=
nullptr);
64 const std::string ®Ex);
69 const std::string ®Ex,
107 const bool useRegularExpression,
108 const std::string &firstExpression,
109 const std::string &lineEnd,
111 std::string *errorInfos=
nullptr);
140 const std::vector<SubImage> &frameSubImgs,
141 MLint zTranslate = 0,
143 bool orValue =
false);
179 double &avrOfSumOfSquaredDiffs);
185 template <
typename DT1,
typename DT2>
190 double avrOfSumOfSquaredDifferences = -1.;
193 avrOfSumOfSquaredDifferences = 0.;
195 for (p.
u = box.
v1.
u; p.
u <= box.
v2.
u; ++p.
u){
196 for (p.
t = box.
v1.
t; p.
t <= box.
v2.
t; ++p.
t){
197 for (p.
c = box.
v1.
c; p.
c <= box.
v2.
c; ++p.
c){
198 for (p.
z = box.
v1.
z; p.
z <= box.
v2.
z; ++p.
z){
199 for (p.
y = box.
v1.
y; p.
y <= box.
v2.
y; ++p.
y){
204 for (; p.
x <= box.
v2.
x; ++p.
x, ++v1, ++v2){
206 const double diff =
static_cast<double>(*v1) -
static_cast<double>(*v2);
207 avrOfSumOfSquaredDifferences += diff*diff;
215 avrOfSumOfSquaredDifferences /=
static_cast<double>(box.
getNumVoxels());
217 return avrOfSumOfSquaredDifferences;
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
const SubImageBox & getBox() const
Returns the box describing the origin/extent of the subimage.
VectorType v1
Corner v1 of the subimage region (included in region).
static TSubImageBox< intT > intersect(const TSubImageBox< intT > &box1, const TSubImageBox< intT > &box2)
Returns the overlapping region of subimage regions box1 and box2.
VectorType v2
Corner v2 of the subimage region (also included in region!).
intT getNumVoxels() const
Returns number of voxels in the subimage region, i.e., the product of all extents if this is not empt...
bool isEmpty() const
Returns true if subimage region is empty, i.e., if any of the components of v1 is greater than the co...
This template class manages/represents a rectangular 6d image region in memory which is organized lin...
const DATATYPE * getImagePointer(const ImageVector &position) const
Returns a pointer to voxel data of image voxel at 6d position position relative to the begin of the c...
ComponentType c
Color component of the vector.
ComponentType t
Time component of the vector.
ComponentType u
Unit/Modality/User component of the vector.
ComponentType z
Z component of the vector.
ComponentType x
X component of the vector.
ComponentType y
Y component of the vector.
MLint32 MLErrorCode
Type of an ML Error code.
Tool function(s) to determine translation information from one directory to another.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...