WRAP_CLASS("itk::MultiResolutionImageRegistrationMethod")

  SET(MANAGED_TYPE_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedProcessObject_TYPE.cxx.in)
  SET(MANAGED_WRAPPER_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedProcessObject_WRAPPER.cxx.in)

  WRAP_IMAGE_FILTER_USIGN_INT(2 2+)
  WRAP_IMAGE_FILTER_SIGN_INT(2 2+)
  WRAP_IMAGE_FILTER_REAL(2 2+)

  BEGIN_MANAGED_PROPERTY("InitialTransformParameters" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the initial transformation parameters.")
    SET(MANAGED_PROPERTY_TYPE      "itkArray<double>^")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetInitialTransformParameters( itk::ManagedTypes::ToNativeArray(value) );")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedArray( m_PointerToNative->GetInitialTransformParameters() );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("LastTransformParameters" GET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get the last transformation parameters visited by the optimizer.")
    SET(MANAGED_PROPERTY_TYPE      "itkArray<double>^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedArray( m_PointerToNative->GetLastTransformParameters() );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_METHOD("StartRegistration")
    SET(MANAGED_METHOD_SUMMARY         "Method that initiates the registration. This will Initialize and ensure that all inputs the registration needs are in place, via a call to Initialize() will then start the optimization process via a call to StartOptimization().")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "try { m_PointerToNative->StartRegistration( ); } catch(itk::ExceptionObject& ex) { throw gcnew itkExceptionObject( ex.GetDescription(), ex.GetLocation(), ex.GetFile(), ex.GetLine() ); }")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->StartRegistration();")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetFixedImage")
    SET(MANAGED_METHOD_SUMMARY         "Set the fixed image.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageBase^ image")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetFixedImage( reinterpret_cast<NativeType::FixedImageType*>(image->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetFixedImage(image);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetFixedImage")
    SET(MANAGED_METHOD_SUMMARY         "Get the fixed image.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageBase^ image")
    SET(MANAGED_METHOD_TYPE_BODY       "image->NativePointer = IntPtr((NativeType::FixedImageType*)m_PointerToNative->GetFixedImage( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetFixedImage(image);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetMovingImage")
    SET(MANAGED_METHOD_SUMMARY         "Set the moving image.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageBase^ image")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetMovingImage( reinterpret_cast<NativeType::MovingImageType*>(image->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetMovingImage(image);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetMovingImage")
    SET(MANAGED_METHOD_SUMMARY         "Get the moving image.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageBase^ image")
    SET(MANAGED_METHOD_TYPE_BODY       "image->NativePointer = IntPtr((NativeType::MovingImageType*)m_PointerToNative->GetMovingImage( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetMovingImage(image);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetOutput")
    SET(MANAGED_METHOD_SUMMARY         "Returns the transform resulting from the registration process.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkTransform^ outputTransform")
    SET(MANAGED_METHOD_TYPE_BODY       "outputTransform->NativePointer = IntPtr((NativeType::TransformType*)m_PointerToNative->GetOutput()->Get());")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetOutput(outputTransform);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetOptimizer")
    SET(MANAGED_METHOD_SUMMARY         "Set the Optimizer.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkOptimizer^ optimizer")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetOptimizer( reinterpret_cast<NativeType::OptimizerType*>(optimizer->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetOptimizer(optimizer);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetOptimizer")
    SET(MANAGED_METHOD_SUMMARY         "Get the Optimizer.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkOptimizer^ optimizer")
    SET(MANAGED_METHOD_TYPE_BODY       "optimizer->NativePointer = IntPtr((NativeType::OptimizerType*)m_PointerToNative->GetOptimizer( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetOptimizer(optimizer);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetMetric")
    SET(MANAGED_METHOD_SUMMARY         "Set the Metric.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkCostFunction^ metric")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetMetric( reinterpret_cast<NativeType::MetricType*>(metric->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetMetric(metric);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetMetric")
    SET(MANAGED_METHOD_SUMMARY         "Get the Metric.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkCostFunction^ metric")
    SET(MANAGED_METHOD_TYPE_BODY       "metric->NativePointer = IntPtr((NativeType::MetricType*)m_PointerToNative->GetMetric( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetMetric(metric);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetTransform")
    SET(MANAGED_METHOD_SUMMARY         "Set the Transform.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkTransform^ transform")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetTransform( reinterpret_cast<NativeType::TransformType*>(transform->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetTransform(transform);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetTransform")
    SET(MANAGED_METHOD_SUMMARY         "Get the Transform.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkTransform^ transform")
    SET(MANAGED_METHOD_TYPE_BODY       "transform->NativePointer = IntPtr((NativeType::TransformType*)m_PointerToNative->GetTransform( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetTransform(transform);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("SetInterpolator")
    SET(MANAGED_METHOD_SUMMARY         "Set the Interpolator.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageFunction^ interpolator")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetInterpolator( reinterpret_cast<NativeType::InterpolatorType*>(interpolator->NativePointer.ToPointer()) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetInterpolator(interpolator);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetInterpolator")
    SET(MANAGED_METHOD_SUMMARY         "Get the Interpolator.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkImageFunction^ interpolator")
    SET(MANAGED_METHOD_TYPE_BODY       "interpolator->NativePointer = IntPtr((NativeType::InterpolatorType*)m_PointerToNative->GetInterpolator( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetInterpolator(interpolator);")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_PROPERTY("NumberOfLevels" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the number of multi-resolution levels.")
    SET(MANAGED_PROPERTY_TYPE      "unsigned long")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetNumberOfLevels( value );")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetNumberOfLevels();")
  END_MANAGED_PROPERTY()

  # TODO: Add wrapping for schedules

END_WRAP_CLASS()
