CFloat32VolumeData3D& CFloat32VolumeData3D::operator-=(const CFloat32VolumeData3D& _data) { CVolumeGeometry3D * pThisGeometry = getGeometry(); int iSliceCount = pThisGeometry->getGridSliceCount(); #ifdef _DEBUG CVolumeGeometry3D * pDataGeometry = _data.getGeometry(); int iThisSlicePixelCount = pThisGeometry->getGridRowCount() * pThisGeometry->getGridColCount(); int iDataSlicePixelCount = pDataGeometry->getGridRowCount() * pDataGeometry->getGridColCount(); ASTRA_ASSERT(iSliceCount == pDataGeometry->getGridSliceCount()); ASTRA_ASSERT(iThisSlicePixelCount == iDataSlicePixelCount); #endif for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) { CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); CFloat32VolumeData2D * pDataProjection = _data.fetchSliceZ(iSliceIndex); for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) { float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; fThisValue -= fDataValue; pThisProjection->getData()[iDetectorIndex] = fThisValue; } returnSliceZ(iSliceIndex, pThisProjection); delete pThisProjection; delete pDataProjection; } return *this; }
CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32ProjectionData3D& _data) { CProjectionGeometry3D * pThisGeometry = getGeometry(); int iProjectionCount = pThisGeometry->getProjectionCount(); #ifdef _DEBUG CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); int iThisProjectionDetectorCount = pThisGeometry->getDetectorRowCount() * pThisGeometry->getDetectorColCount(); int iDataProjectionDetectorCount = pDataGeometry->getDetectorRowCount() * pDataGeometry->getDetectorColCount(); ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); ASTRA_ASSERT(iThisProjectionDetectorCount == iDataProjectionDetectorCount); #endif for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) { CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) { float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; fThisValue -= fDataValue; pThisProjection->getData()[iDetectorIndex] = fThisValue; } returnProjection(iProjectionIndex, pThisProjection); delete pThisProjection; delete pDataProjection; } return *this; }