<commit_before>/*=========================================================================
*
*  Copyright Insight Software Consortium
*
*  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.txt
*
*  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.
*
*=========================================================================*/
#ifndef __sitkTransform_h
#define __sitkTransform_h

#include "sitkCommon.h"
#include "sitkExceptionObject.h"
#include <vector>


namespace itk
{

// Forward decalaration for pointer
class TransformBase;
template< typename TScalar, unsigned int NDimension> class CompositeTransform;

namespace simple
{

class PimpleTransformBase;


enum TransformEnum { sitkIdentity,
                     sitkTranslation,
                     sitkScale,
                     sitkScaleLogarithmic,
                     sitkQuaternionRigid,
                     sitkVersor,
                     sitkAffine,
                     sitkComposite };


/** \class Tranform
 * \brief A simplified wrapper around a variety of ITK transforms.
 *
 */
class SITKCommon_EXPORT Transform
{
public:
  typedef Transform Self;

  /** \brief By default a 3-d identity transform is constructed
   */
  Transform( void );

  /** \brief Construct a SimpleITK Transform from a pointer to an ITK
   * composite transform.
   *
   */
  template<unsigned int NDimension>
  explicit Transform( itk::CompositeTransform< double, NDimension >* compositeTransform )
    {
      sitkStaticAssert( NDimension == 2 | NDimension == 3, "Only 2D and 3D transforms are supported" );
      if ( compositeTransform == NULL )
        {
        sitkExceptionMacro( "Unable to construct a null transform!" );
        }
      this->InternalInitialization<NDimension>( sitkComposite, compositeTransform );
    }

  /** \brief Construct a specific transformation
   */
  Transform( unsigned int dimensions, TransformEnum type);

  virtual ~Transform( void );

  /** \brief Copy constructor and assignment operator
   *
   * Performs a shallow copy of the internal ITK transform. A deep
   * copy will be done if the transform in modified.
   * @{
   */
  Transform &operator=( const Transform & );
  Transform( const Transform & );
  /**@}*/


  /** Get access to internal ITK data object.
   *
   * The return value should imediately be assigned to as
   * itk::SmartPointer.
   *<commit_msg>Change incorrect | to ||<commit_after>/*=========================================================================
*
*  Copyright Insight Software Consortium
*
*  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.txt
*
*  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.
*
*=========================================================================*/
#ifndef __sitkTransform_h
#define __sitkTransform_h

#include "sitkCommon.h"
#include "sitkExceptionObject.h"
#include <vector>


namespace itk
{

// Forward decalaration for pointer
class TransformBase;
template< typename TScalar, unsigned int NDimension> class CompositeTransform;

namespace simple
{

class PimpleTransformBase;


enum TransformEnum { sitkIdentity,
                     sitkTranslation,
                     sitkScale,
                     sitkScaleLogarithmic,
                     sitkQuaternionRigid,
                     sitkVersor,
                     sitkAffine,
                     sitkComposite };


/** \class Tranform
 * \brief A simplified wrapper around a variety of ITK transforms.
 *
 */
class SITKCommon_EXPORT Transform
{
public:
  typedef Transform Self;

  /** \brief By default a 3-d identity transform is constructed
   */
  Transform( void );

  /** \brief Construct a SimpleITK Transform from a pointer to an ITK
   * composite transform.
   *
   */
  template<unsigned int NDimension>
  explicit Transform( itk::CompositeTransform< double, NDimension >* compositeTransform )
    {
      sitkStaticAssert( NDimension == 2 || NDimension == 3, "Only 2D and 3D transforms are supported" );
      if ( compositeTransform == NULL )
        {
        sitkExceptionMacro( "Unable to construct a null transform!" );
        }
      this->InternalInitialization<NDimension>( sitkComposite, compositeTransform );
    }

  /** \brief Construct a specific transformation
   */
  Transform( unsigned int dimensions, TransformEnum type);

  virtual ~Transform( void );

  /** \brief Copy constructor and assignment operator
   *
   * Performs a shallow copy of the internal ITK transform. A deep
   * copy will be done if the transform in modified.
   * @{
   */
  Transform &operator=( const Transform & );
  Transform( const Transform & );
  /**@}*/


  /** Get access to internal ITK data object.
   *
   * The return value should imediately be assigned to as
   * itk::SmartPointer.
   *
{'fraction_non_alphanumeric': 0.12802275960170698, 'fraction_numerical': 0.003200568990042674, 'mean_word_length': 3.1148500365764447, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '4022173', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1412, 'n_words': 531}