summaryrefslogtreecommitdiffstats
path: root/src/Float32ProjectionData3D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-10-09 15:55:11 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-10-09 15:55:11 +0200
commitf7e01f5a3ca7780a29d1fbc3790e527c310cc7f8 (patch)
tree9030e4df7330acf9f12911316ec433c4e38f6643 /src/Float32ProjectionData3D.cpp
parent11717f66b49fbe41faf923f267c6893ce9af46ad (diff)
downloadastra-f7e01f5a3ca7780a29d1fbc3790e527c310cc7f8.tar.gz
astra-f7e01f5a3ca7780a29d1fbc3790e527c310cc7f8.tar.bz2
astra-f7e01f5a3ca7780a29d1fbc3790e527c310cc7f8.tar.xz
astra-f7e01f5a3ca7780a29d1fbc3790e527c310cc7f8.zip
Fix loop bounds in (unused) Float32ProjectionData3D arithmetic functions
Diffstat (limited to 'src/Float32ProjectionData3D.cpp')
-rw-r--r--src/Float32ProjectionData3D.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/Float32ProjectionData3D.cpp b/src/Float32ProjectionData3D.cpp
index 2bd0447..680ad55 100644
--- a/src/Float32ProjectionData3D.cpp
+++ b/src/Float32ProjectionData3D.cpp
@@ -53,13 +53,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -67,7 +67,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -91,13 +91,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -105,7 +105,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -129,13 +129,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
#ifdef _DEBUG
CProjectionGeometry3D * pDataGeometry = _data.getGeometry();
- int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount();
- int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount();
+ int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount();
ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount());
- ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount);
+ ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount);
#endif
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
@@ -143,7 +143,7 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32Pro
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex];
@@ -167,12 +167,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -194,12 +195,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator/=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -221,12 +223,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];
@@ -248,12 +251,13 @@ CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const float32& _f
CProjectionGeometry3D * pThisGeometry = getGeometry();
int iProjectionCount = pThisGeometry->getProjectionCount();
+ int iDetectorCount = pThisGeometry->getDetectorTotCount();
for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++)
{
CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex);
- for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++)
+ for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++)
{
float32 fThisValue = pThisProjection->getData()[iDetectorIndex];