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

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkRayCasterBase.txx
	Version:		$Revision: 2478 $
	Date:			$Date: 2012-01-25 11:58:00 +0100 (Mi, 25 Jan 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

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


#include "ritkRayCasterBase.h"

namespace ritk
{

//----------------------------------------------------------------------------
template<class TInputVolume, class TOutputImage>
RayCasterBase<TInputVolume, TOutputImage>
::RayCasterBase()
{
	// Default size
	m_OutputSize[0] = 512;
	m_OutputSize[1] = 512;
}


//----------------------------------------------------------------------------
template<class TInputVolume, class TOutputImage>
RayCasterBase<TInputVolume,TOutputImage>
::~RayCasterBase()
{
}


//----------------------------------------------------------------------------
template<class TInputVolume, class TOutputImage>
void
RayCasterBase<TInputVolume,TOutputImage>
::GenerateInputRequestedRegion()
{
	// Do not use our superclass' method but from itk::ProcessObject
	// This will set the requested region of our input to the largest possible region
	itk::ProcessObject::GenerateInputRequestedRegion();  
}


//----------------------------------------------------------------------------
template<class TInputVolume, class TOutputImage>
void
RayCasterBase<TInputVolume,TOutputImage>
::GenerateOutputInformation()
{
	// We can't use the default implementation as the input and output have different dims.
	OutputImageRegionType OutputRegion;
	OutputRegion.SetSize(m_OutputSize);
	this->GetOutput()->SetRegions(OutputRegion);
	OutputImagePointType OutputOrigin;
	OutputOrigin.Fill(0);
	this->GetOutput()->SetOrigin(OutputOrigin);
	OutputImageSpacingType OutputSpacing;
	OutputSpacing.Fill(1);
	this->GetOutput()->SetSpacing(OutputSpacing);
}


} // namespace ritk
