selxItkImageSourceFixed.h 3 KB
Newer Older
Floris Berendsen's avatar
Floris Berendsen committed
1
2
/*=========================================================================
 *
3
 *  Copyright Leiden University Medical Center, Erasmus University Medical
Floris Berendsen's avatar
Floris Berendsen committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *  Center and contributors
 *
 *  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.
 *
 *=========================================================================*/

20
21
22
#ifndef selxItkImageSourceFixed_h
#define selxItkImageSourceFixed_h

23
#include "selxSuperElastixComponent.h"
24
#include "selxSinksAndSourcesInterfaces.h"
25
#include <string.h>
26
#include "selxMacro.h"
27
28
29
#include "itkImageFileReader.h"
#include "selxAnyFileReader.h"
#include "selxFileReaderDecorator.h"
30
31
namespace selx
{
32
33
34
35
36
37
template< int Dimensionality, class TPixel >
class ItkImageSourceFixedComponent :
  public SuperElastixComponent<
  Accepting< >,
  Providing< SourceInterface,
  itkImageFixedInterface< Dimensionality, TPixel >,
38
  itkImageDomainFixedInterface< Dimensionality > >
39
40
41
  >
{
public:
42

43
  selxNewMacro( ItkImageSourceFixedComponent, ComponentBase );
44

45
  //itkStaticConstMacro(Dimensionality, unsigned int, Dimensionality);
46

47
48
  ItkImageSourceFixedComponent();
  virtual ~ItkImageSourceFixedComponent();
49

50
51
  typedef typename itkImageFixedInterface< Dimensionality, TPixel >::ItkImageType     ItkImageType;
  typedef typename itkImageDomainFixedInterface< Dimensionality >::ItkImageDomainType ItkImageDomainType;
52

53
54
  typedef typename itk::ImageFileReader< ItkImageType > ItkImageReaderType;
  typedef FileReaderDecorator< ItkImageReaderType >     DecoratedReaderType;
55

56
57
  // providing interfaces
  virtual typename ItkImageType::Pointer GetItkImageFixed() override;
58

59
60
  virtual void SetMiniPipelineInput( itk::DataObject::Pointer ) override;
  virtual AnyFileReader::Pointer GetInputFileReader( void ) override;
61

62
  virtual typename ItkImageDomainType::Pointer GetItkImageDomainFixed() override;
63

64
  virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
65

66
  static const char * GetDescription() { return "ItkImageSourceFixed Component"; }
67

68
private:
69

70
  typename ItkImageType::Pointer m_Image;
71

72
protected:
Floris Berendsen's avatar
Floris Berendsen committed
73

74
  // return the class name and the template arguments to uniquely identify this component.
Floris Berendsen's avatar
Floris Berendsen committed
75
  static inline const std::map< std::string, std::string > TemplateProperties()
76
  {
Floris Berendsen's avatar
Floris Berendsen committed
77
    return { { keys::NameOfClass, "ItkImageSourceFixedComponent" }, { keys::PixelType, PodString< TPixel >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
78
  }
79
};
80
} //end namespace selx
81
82
83
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkImageSourceFixed.hxx"
#endif
84
#endif // #define selxItkImageSourceFixed_h