Commit 910a2fc8 authored by Vladimír Ulman's avatar Vladimír Ulman
Browse files

CHG: Texture methods' names start lowercase (like the most of the rest)

parent 4d53acb8
......@@ -9,19 +9,19 @@
decreasing photon budget, or just always returns 1.0 iff photobleaching
shall be ignored (photobleaching feature is disabled */
#ifdef ENABLED_PHOTOBLEACHING
inline float GetBleachFactor(const short cntOfExcitations)
inline float getBleachFactor(const short cntOfExcitations)
{
return std::exp((float)-cntOfExcitations);
}
#else
inline float GetBleachFactor(const short)
inline float getBleachFactor(const short)
{
return 1.0f;
}
#endif
void Texture::RenderIntoPhantom(i3d::Image3d<float> &phantoms, const float quantization)
void Texture::renderIntoPhantom(i3d::Image3d<float> &phantoms, const float quantization)
{
DEBUG_REPORT("going to render " << dots.size() << " dots");
......@@ -58,7 +58,7 @@ void Texture::RenderIntoPhantom(i3d::Image3d<float> &phantoms, const float quant
//plus upper bound (tests also underflows... "negative" coordinates)
if (imgPos.elemIsLessThan(imgSize))
{
const float fval = quantization * GetBleachFactor(dot.cntOfExcitations);
const float fval = quantization * getBleachFactor(dot.cntOfExcitations);
#ifdef DEBUG
meanIntContribution += fval;
++meanIntContCounter;
......@@ -80,7 +80,7 @@ void Texture::RenderIntoPhantom(i3d::Image3d<float> &phantoms, const float quant
}
void TextureQuantized::RenderIntoPhantom(i3d::Image3d<float> &phantoms)
void TextureQuantized::renderIntoPhantom(i3d::Image3d<float> &phantoms)
{
DEBUG_REPORT("going to render " << dots.size() << " quantum dots");
......@@ -128,7 +128,7 @@ void TextureQuantized::RenderIntoPhantom(i3d::Image3d<float> &phantoms)
if (imgPos.elemIsGreaterOrEqualThan(halfBoxSize)
&& imgPos.elemIsLessThan(imgSize))
{
const float fval = GetBleachFactor(dot.cntOfExcitations);
const float fval = getBleachFactor(dot.cntOfExcitations);
#ifdef DEBUG
meanIntContribution += quantumElems * fval;
++meanIntContCounter;
......
......@@ -64,7 +64,7 @@ public:
/** setup the output image to wrap around the given geometry, respecting
the given outer frame (in pixels) and the wanted resolution of the image */
template <typename VT>
void SetupImageForRasterizingTexture( i3d::Image3d<VT>& img,
void setupImageForRasterizingTexture( i3d::Image3d<VT>& img,
const Vector3d<float>& imgRes,
const Geometry& geom,
const Vector3d<short>& pxFrameWidth = Vector3d<short>(2) )
......@@ -77,7 +77,7 @@ public:
texture (stored in 'img') respecting the actual shape of the agent ('geom'),
and considering given 'quantization' */
template <typename VT>
void SampleDotsFromImage(const i3d::Image3d<VT>& img,
void sampleDotsFromImage(const i3d::Image3d<VT>& img,
const Spheres& geom,
const VT quantization = 1)
{
......@@ -149,7 +149,7 @@ public:
is only shifting the range into [textureAverageIntensity-0.5,textureAverageIntensity+0.5].
Hence, with the higher value of the 'textureAverageIntensity', the contrast (ratio of
the highest over smallest intensity value) of the texture is essentially worsened. */
void CreatePerlinTexture(const Spheres& geom,
void createPerlinTexture(const Spheres& geom,
const Vector3d<FLOAT> textureResolution,
const double var,
const double alpha = 8,
......@@ -161,7 +161,7 @@ public:
{
//setup the aux texture image
i3d::Image3d<float> img;
SetupImageForRasterizingTexture(img,textureResolution, geom);
setupImageForRasterizingTexture(img,textureResolution, geom);
//sanity check... if the 'geom' is "empty", no texture image is "wrapped" around it,
//we do no creation of the texture then...
......@@ -187,13 +187,13 @@ public:
*i += textureIntShift;
//*i = std::max( *i, 0.f );
}
SampleDotsFromImage(img,geom, quantization);
sampleDotsFromImage(img,geom, quantization);
//NB: the function ignores any negative-valued texture image voxels,
// no dots are created for such voxels
if (shouldCollectOutlyingDots)
{
const int dotOutliers = CollectOutlyingDots(geom);
const int dotOutliers = collectOutlyingDots(geom);
DEBUG_REPORT(dotOutliers << " (" << 100.f*dotOutliers/dots.size()
<< " %) dots had to be moved inside the initial geometry");
}
......@@ -205,7 +205,7 @@ public:
/** find dots that are outside the given geometry and "put them back",
which is randomly close to the centre of the closest sphere,
returns the number of such processed dots (for statistics purposes) */
int CollectOutlyingDots(const Spheres& geom)
int collectOutlyingDots(const Spheres& geom)
{
int count = 0;
#ifdef DEBUG
......@@ -292,7 +292,7 @@ public:
// rendering
/** renders the current content of the this->dots list into the given phantom image */
void RenderIntoPhantom(i3d::Image3d<float> &phantoms, const float quantization = 1);
void renderIntoPhantom(i3d::Image3d<float> &phantoms, const float quantization = 1);
};
/**
......@@ -368,8 +368,8 @@ public:
/** renders (quantum-wise) the current content of the this->dots list into the given phantom image,
the contributed intensity to the image should be 'quantum'-times greater than what would provide
the upstream, non-quantum Texture::RenderIntoPhantom(phantoms,1.0) */
void RenderIntoPhantom(i3d::Image3d<float> &phantoms);
the upstream, non-quantum Texture::renderIntoPhantom(phantoms,1.0) */
void renderIntoPhantom(i3d::Image3d<float> &phantoms);
};
......
......@@ -17,7 +17,7 @@ public:
//TextureQuantized(60000, Vector3d<float>(2.0f,2.0f,2.0f), 8)
{
//texture img: resolution -- makes sense to match it with the phantom img resolution
CreatePerlinTexture(futureGeometry, Vector3d<float>(2.0f),
createPerlinTexture(futureGeometry, Vector3d<float>(2.0f),
5.0,8,4,6, //Perlin
1.0f, //texture intensity range centre
0.1f, true); //quantization and shouldCollectOutlyingDots
......@@ -25,7 +25,7 @@ public:
void drawTexture(i3d::Image3d<float>& phantom, i3d::Image3d<float>&) override
{
if (Officer->isProducingOutput(phantom)) RenderIntoPhantom(phantom);
if (Officer->isProducingOutput(phantom)) renderIntoPhantom(phantom);
}
};
......
......@@ -4,7 +4,6 @@
#include "../Simulation.h"
#include "../Agents/Nucleus4SAgent.h"
#include "../Agents/util/Texture.h"
#include "../util/texture/texture.h"
#include "Scenarios.h"
class myDragAndTextureNucleus: public Nucleus4SAgent, TextureQuantized, TextureUpdater4S
......@@ -21,7 +20,7 @@ public:
cytoplasmWidth = 0.0f;
//texture img: resolution -- makes sense to match it with the phantom img resolution
CreatePerlinTexture(futureGeometry, Vector3d<float>(2.0f),
createPerlinTexture(futureGeometry, Vector3d<float>(2.0f),
5.0,8,4,6, //Perlin
1.0f, //texture intensity range centre
0.1f, true); //quantization and shouldCollectOutlyingDots
......@@ -61,7 +60,7 @@ public:
updateTextureCoords(dots, futureGeometry);
//correct for outlying texture particles
const int dotOutliers = CollectOutlyingDots(futureGeometry);
const int dotOutliers = collectOutlyingDots(futureGeometry);
DEBUG_REPORT(dotOutliers << " (" << 100.f*dotOutliers/dots.size()
<< " %) dots had to be moved inside the initial geometry");
}
......@@ -70,7 +69,7 @@ public:
void drawTexture(i3d::Image3d<float>& phantom, i3d::Image3d<float>&) override
{
if (Officer->isProducingOutput(phantom)) RenderIntoPhantom(phantom);
if (Officer->isProducingOutput(phantom)) renderIntoPhantom(phantom);
}
void drawMask(DisplayUnit& du) override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment