/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkCudaRayCaster.h
	Version:		$Revision: 2745 $
	Date:			$Date: 2012-03-09 16:16:26 +0100 (Fr, 09 Mrz 2012) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
	See RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/


#ifndef RITKCUDARAYCASTER_H__
#define RITKCUDARAYCASTER_H__

#include "ritkRayCasterBase.h"

using namespace itk;

namespace ritk
{

/**	@ingroup	Cuda
 *	@class		CudaRayCaster
 *	@author		Jakob Wasza
 *	@brief		Volume ray casting using CUDA
 *
 *	@details
 */
template<class TInputVolume, class TOutputImage>
class CudaRayCaster : public RayCasterBase<TInputVolume, TOutputImage>
{
public:
	/** @name Typedefs */
	//@{

	/** @name Standard typedefs */
	//@{
	typedef CudaRayCaster											Self;
    typedef RayCasterBase<TInputVolume, TOutputImage>				Superclass;
    typedef itk::SmartPointer<Self>									Pointer;
    typedef itk::SmartPointer<const Self>							ConstPointer;
	//@}

	/** @name Input typedefs */
	//@{
	typedef typename Superclass::InputVolumeType					InputVolumeType;
	typedef typename InputVolumeType::Pointer						InputVolumePointer;
	typedef typename InputVolumeType::ConstPointer					InputVolumeConstPointer;
	typedef typename InputVolumeType::PixelType						InputVolumePixelType;
	typedef typename InputVolumeType::RegionType					InputVolumeRegionType;
	//@}
	
	/** @name Output image typedefs */
	//@{
	typedef typename Superclass::OutputImageType					OutputImageType;
	typedef typename OutputImageType::Pointer						OutputImagePointer;
	typedef typename OutputImageType::ConstPointer					OutputImageConstPointer;
	typedef typename OutputImageType::PixelType						OutputImagePixelType;
	typedef typename OutputImageType::RegionType					OutputImageRegionType;
	typedef typename OutputImageType::SpacingType					OutputImageSpacingType;
	typedef typename OutputImageType::PointType						OutputImagePointType;
	//@}


	/** @name Projection matrix typedefs */
	//@{
	typedef typename Superclass::ProjectionMatrixType				ProjectionMatrixType;
	typedef typename Superclass::ProjectionMatrixInverseType		ProjectionMatrixInverseType;
	//@}

	//@}

	/// Object creation
	itkNewMacro(Self);

	/// RTTI
	itkTypeMacro(CudaRayCaster,RayCasterBase);

	/** @name Dimensions macros */
	//@{
	itkStaticConstMacro(InputImageDimension,  unsigned int, InputVolumeType::ImageDimension);
	itkStaticConstMacro(OutputImageDimension, unsigned int, OutputImageType::ImageDimension);
	//@}

	/**	@name Overloaded to support Cuda containers at the output */
	//{
	virtual void GenerateOutputInformation();
	//@}

protected:
	/// Constructor
	CudaRayCaster();
	/// Destructor
	virtual ~CudaRayCaster();

	/// Data generation
	virtual void GenerateData();
	
private:
	/// purposely not implemented
	CudaRayCaster(Self&);
	/// purposely not implemented
	void operator=(const Self&);
};


} // namespace ritk

#endif // RITKCUDARAYCASTER_H__
