Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
Medical Imaging Interaction Toolkit
PhotoacousticsAlgorithms/ITKFilter/ITKUltrasound/itkRegionFromReferenceImageFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 /*=========================================================================
13  *
14  * Copyright Insight Software Consortium
15  *
16  * Licensed under the Apache License, Version 2.0 (the "License");
17  * you may not use this file except in compliance with the License.
18  * You may obtain a copy of the License at
19  *
20  * http://www.apache.org/licenses/LICENSE-2.0.txt
21  *
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an "AS IS" BASIS,
24  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25  * See the License for the specific language governing permissions and
26  * limitations under the License.
27  *
28  *=========================================================================*/
29 #ifndef itkRegionFromReferenceImageFilter_h
30 #define itkRegionFromReferenceImageFilter_h
31 
32 #include "itkExtractImageFilter.h"
33 
34 namespace itk
35 {
36 
50 template< typename TInputImage, typename TOutputImage=TInputImage >
52  public ExtractImageFilter<TInputImage,TOutputImage>
53 {
54 public:
57  typedef ExtractImageFilter<TInputImage,TOutputImage> Superclass;
60 
62  itkNewMacro(Self);
63 
65  itkTypeMacro(RegionFromReferenceImageFilter, ExtractImageFilter);
66 
68  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
69  typedef typename Superclass::InputImageRegionType InputImageRegionType;
70 
72  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
73  typedef typename Superclass::InputImagePixelType InputImagePixelType;
74 
76  typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
77  typedef typename Superclass::InputImageIndexType InputImageIndexType;
78  typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
79  typedef typename Superclass::InputImageSizeType InputImageSizeType;
80  typedef InputImageSizeType SizeType;
81 
83  itkStaticConstMacro(InputImageDimension, unsigned int,
84  Superclass::InputImageDimension);
85  itkStaticConstMacro(OutputImageDimension, unsigned int,
86  Superclass::OutputImageDimension);
87  itkStaticConstMacro(ImageDimension, unsigned int,
88  Superclass::OutputImageDimension);
89 
90  typedef ImageBase< itkGetStaticConstMacro( ImageDimension ) > ReferenceImageType;
91 
93  void SetReferenceImage ( const ReferenceImageType *image );
94 
95  const ReferenceImageType * GetReferenceImage() const;
96 
98  void SetInput1(const TInputImage *input)
99  {
100  this->SetInput( input );
101  }
102 
104  void SetInput2(const ReferenceImageType *input)
105  {
106  this->SetReferenceImage( input );
107  }
108 
109 
110 #ifdef ITK_USE_CONCEPT_CHECKING
111 
112  itkConceptMacro(InputConvertibleToOutputCheck,
113  (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
114  itkConceptMacro(SameDimensionCheck,
115  (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
117 #endif
118 
119 protected:
121  {
122  this->SetNumberOfRequiredInputs(2);
123  }
125 
126  void GenerateOutputInformation() ITK_OVERRIDE;
127 
128 private:
129  RegionFromReferenceImageFilter(const Self&); //purposely not implemented
130  void operator=(const Self&); //purposely not implemented
131 };
132 
133 } // end namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkRegionFromReferenceImageFilter.hxx"
137 #endif
138 
139 #endif
const ReferenceImageType * GetReferenceImage() const
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
mitk::Image::Pointer image
Decrease the image size by cropping the image by an itk::Size at both the upper and lower bounds of t...
void SetReferenceImage(const ReferenceImageType *image)
void GenerateOutputInformation() ITK_OVERRIDE