diff options
author | Willem Jan Palenstijn <WillemJan.Palenstijn@uantwerpen.be> | 2014-04-16 11:13:40 +0000 |
---|---|---|
committer | wpalenst <WillemJan.Palenstijn@uantwerpen.be> | 2014-04-16 11:13:40 +0000 |
commit | c72bc7cd47ecb5665a287fb88e101f88118f5232 (patch) | |
tree | 367c19f29647f4256783acfce9db4e8431bd0039 /src | |
parent | bcff7884bb89dbecd394c75a8f57b0a54a743b52 (diff) | |
download | astra-c72bc7cd47ecb5665a287fb88e101f88118f5232.tar.gz astra-c72bc7cd47ecb5665a287fb88e101f88118f5232.tar.bz2 astra-c72bc7cd47ecb5665a287fb88e101f88118f5232.tar.xz astra-c72bc7cd47ecb5665a287fb88e101f88118f5232.zip |
Split up processVol in Vol/Sino cases
Diffstat (limited to 'src')
-rw-r--r-- | src/CudaDataOperationAlgorithm.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/CudaDataOperationAlgorithm.cpp b/src/CudaDataOperationAlgorithm.cpp index 50b2faa..dcb6c3c 100644 --- a/src/CudaDataOperationAlgorithm.cpp +++ b/src/CudaDataOperationAlgorithm.cpp @@ -130,47 +130,40 @@ void CCudaDataOperationAlgorithm::run(int _iNrIterations) astraCUDA::setGPUIndex(m_iGPUIndex); + astraCUDA::SDimensions dims; + // We slightly abuse dims here: width/height is not necessarily a volume + dims.iVolWidth = m_pData[0]->getWidth(); + dims.iVolHeight = m_pData[0]->getHeight(); + if (m_sOperation == "$1*s1" || m_sOperation == "$1.*s1") // data * scalar { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); if (m_pMask == NULL) - astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), m_fScalar[0], dims); else - astraCUDA::processVolCopy<astraCUDA::opMulMask>(m_pData[0]->getData(), m_pMask->getDataConst(), m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opMulMask>(m_pData[0]->getData(), m_pMask->getDataConst(), m_fScalar[0], dims); } else if (m_sOperation == "$1/s1" || m_sOperation == "$1./s1") // data / scalar { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); if (m_pMask == NULL) - astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), 1.0f/m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), 1.0f/m_fScalar[0], dims); else - astraCUDA::processVolCopy<astraCUDA::opMulMask>(m_pData[0]->getData(), m_pMask->getDataConst(), 1.0f/m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opMulMask>(m_pData[0]->getData(), m_pMask->getDataConst(), 1.0f/m_fScalar[0], dims); } else if (m_sOperation == "$1+s1") // data + scalar { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); - astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), m_fScalar[0], dims); } else if (m_sOperation == "$1-s1") // data - scalar { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); - astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), -m_fScalar[0], width, height); + astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), -m_fScalar[0], dims); } else if (m_sOperation == "$1.*$2") // data .* data { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); - astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), m_pData[1]->getDataConst(), width, height); + astraCUDA::processVolCopy<astraCUDA::opMul>(m_pData[0]->getData(), m_pData[1]->getDataConst(), dims); } else if (m_sOperation == "$1+$2") // data + data { - unsigned int width = m_pData[0]->getWidth(); - unsigned int height = m_pData[0]->getHeight(); - astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), m_pData[1]->getDataConst(), width, height); + astraCUDA::processVolCopy<astraCUDA::opAdd>(m_pData[0]->getData(), m_pData[1]->getDataConst(), dims); } } |