//--------------------------------------------------------------------
template <class InputImageType, class OutputImageType>
clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType>::
-ResampleImageWithOptionsFilter():itk::ImageToImageFilter<InputImageType, OutputImageType>()
+ResampleImageWithOptionsFilter():itk::ImageToImageFilter<InputImageType, OutputImageType>()
{
static const unsigned int dim = InputImageType::ImageDimension;
this->SetNumberOfRequiredInputs(1);
template <class InputImageType, class OutputImageType>
void
clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType>::
-SetInput(const InputImageType * image)
+SetInput(const InputImageType * image)
{
// Process object is not const-correct so the const casting is required.
this->SetNthInput(0, const_cast<InputImageType *>(image));
template <class InputImageType, class OutputImageType>
void
clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType>::
-GenerateInputRequestedRegion()
+GenerateInputRequestedRegion()
{
// call the superclass's implementation of this method
Superclass::GenerateInputRequestedRegion();
template <class InputImageType, class OutputImageType>
void
clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType>::
-GenerateOutputInformation()
+GenerateOutputInformation()
{
static const unsigned int dim = InputImageType::ImageDimension;
if (m_OutputIsoSpacing != -1) { // apply isoSpacing
for(unsigned int i=0; i<dim; i++) {
m_OutputSpacing[i] = m_OutputIsoSpacing;
- // floor() is used to intentionally reduce the number of slices
- // because, from a clinical point of view, it's better to
+ // floor() is used to intentionally reduce the number of slices
+ // because, from a clinical point of view, it's better to
// remove data than to add data that privously didn't exist.
if(inputSpacing[i]*m_OutputSpacing[i]<0)
itkExceptionMacro( << "Input and output spacings don't have the same signs, can't cope with that" );
//--------------------------------------------------------------------
template <class InputImageType, class OutputImageType>
-void
+void
clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType>::
-GenerateData()
+GenerateData()
{
-
+
// Get input pointer
InputImagePointer input = dynamic_cast<InputImageType*>(itk::ProcessObject::GetInput(0));
static const unsigned int dim = InputImageType::ImageDimension;
filter->SetTransform(m_Transform);
filter->SetSize(m_OutputSize);
filter->SetOutputSpacing(m_OutputSpacing);
- filter->SetOutputOrigin(m_OutputOrigin);
+ filter->SetOutputOrigin(origin);
filter->SetDefaultPixelValue(m_DefaultPixelValue);
- filter->SetNumberOfThreads(this->GetNumberOfThreads());
+ filter->SetNumberOfThreads(this->GetNumberOfThreads());
filter->SetOutputDirection(m_OutputDirection); // <-- NEEDED if we want to keep orientation (in case of PermutAxes for example)
// Select interpolator
//--------------------------------------------------------------------
template<class InputImageType>
-typename InputImageType::Pointer
-clitk::ResampleImageSpacing(typename InputImageType::Pointer input,
- typename InputImageType::SpacingType spacing,
+typename InputImageType::Pointer
+clitk::ResampleImageSpacing(typename InputImageType::Pointer input,
+ typename InputImageType::SpacingType spacing,
int interpolationType)
{
typedef clitk::ResampleImageWithOptionsFilter<InputImageType> ResampleFilterType;