<commit_before>/*
 * Medical Image Registration ToolKit (MIRTK)
 *
 * Copyright 2008-2015 Imperial College London
 * Copyright 2008-2013 <NAME>, <NAME>
 * Copyright 2013-2015 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <mirtkResampling.h>

#include <mirtkParallel.h>
#include <mirtkProfiling.h>
#include <mirtkInterpolateImageFunction.h>


namespace mirtk {


// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(double dx, double dy, double dz)
{
  _X     = 0;
  _Y     = 0;
  _Z     = 0;
  _XSize = dx;
  _YSize = dy;
  _ZSize = dz;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(int x, int y, int z)
{
  _X     = x;
  _Y     = y;
  _Z     = z;
  _XSize = 0;
  _YSize = 0;
  _ZSize = 0;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(int x, int y, int z, double dx, double dy, double dz)
{
  _X     = x;
  _Y     = y;
  _Z     = z;
  _XSize = dx;
  _YSize = dy;
  _ZSize = dz;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
void Resampling<VoxelType>::Initialize()
{
  // Initialize base class
  ImageToImage<VoxelType>::Initialize();

  // Set up interpolator
  if (_Interpolator == NULL) {
    cerr << "Resampling::Initialize: No interpolator found!" << endl;<commit_msg>fix: Do not initialize output in base class for Resampling [Image]<commit_after>/*
 * Medical Image Registration ToolKit (MIRTK)
 *
 * Copyright 2008-2015 Imperial College London
 * Copyright 2008-2013 <NAME>, <NAME>
 * Copyright 2013-2015 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <mirtkResampling.h>

#include <mirtkParallel.h>
#include <mirtkProfiling.h>
#include <mirtkInterpolateImageFunction.h>


namespace mirtk {


// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(double dx, double dy, double dz)
{
  _X     = 0;
  _Y     = 0;
  _Z     = 0;
  _XSize = dx;
  _YSize = dy;
  _ZSize = dz;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(int x, int y, int z)
{
  _X     = x;
  _Y     = y;
  _Z     = z;
  _XSize = 0;
  _YSize = 0;
  _ZSize = 0;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
Resampling<VoxelType>::Resampling(int x, int y, int z, double dx, double dy, double dz)
{
  _X     = x;
  _Y     = y;
  _Z     = z;
  _XSize = dx;
  _YSize = dy;
  _ZSize = dz;
  _Interpolator = NULL;
}

// ---------------------------------------------------------------------------
template <class VoxelType>
void Resampling<VoxelType>::Initialize()
{
  // Initialize base class
  ImageToImage<VoxelType>::Initialize(false);

  // Set up interpolator
  if (_Interpolator == NULL) {
    cerr << "Resampling::Initialize: No interpolator found!" << endl;
{'fraction_non_alphanumeric': 0.23396840148698886, 'fraction_numerical': 0.015799256505576207, 'mean_word_length': 1.9792387543252594, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1768773', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1285, 'n_words': 413}