ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkCropImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkCropImageFilter_h
19 #define itkCropImageFilter_h
20 
21 #include "itkExtractImageFilter.h"
22 
23 namespace itk
24 {
42 template< typename TInputImage, typename TOutputImage >
44  public ExtractImageFilter< TInputImage, TOutputImage >
45 {
46 public:
52 
54  itkNewMacro(Self);
55 
58 
62 
66 
73 
75  itkStaticConstMacro(InputImageDimension, unsigned int,
77  itkStaticConstMacro(OutputImageDimension, unsigned int,
80 
82  itkSetMacro(UpperBoundaryCropSize, SizeType);
83  itkGetConstMacro(UpperBoundaryCropSize, SizeType);
84  itkSetMacro(LowerBoundaryCropSize, SizeType);
85  itkGetConstMacro(LowerBoundaryCropSize, SizeType);
87 
88  void SetBoundaryCropSize(const SizeType & s)
89  {
90  this->SetUpperBoundaryCropSize(s);
91  this->SetLowerBoundaryCropSize(s);
92  }
93 
94 #ifdef ITK_USE_CONCEPT_CHECKING
95  // Begin concept checking
96  itkConceptMacro( InputConvertibleToOutputCheck,
98  itkConceptMacro( SameDimensionCheck,
100  // End concept checking
101 #endif
102 
103 protected:
105  {
107  m_UpperBoundaryCropSize.Fill(0);
108  m_LowerBoundaryCropSize.Fill(0);
109  }
110 
112  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
113 
114  void GenerateOutputInformation() ITK_OVERRIDE;
115 
116 private:
117  CropImageFilter(const Self &) ITK_DELETE_FUNCTION;
118  void operator=(const Self &) ITK_DELETE_FUNCTION;
119 
122 };
123 } // end namespace itk
124 
125 #ifndef ITK_MANUAL_INSTANTIATION
126 #include "itkCropImageFilter.hxx"
127 #endif
128 
129 #endif
SmartPointer< Self > Pointer
static const unsigned int InputImageDimension
Superclass::OutputImagePixelType OutputImagePixelType
ExtractImageFilter< TInputImage, TOutputImage > Superclass
TOutputImage::SizeType OutputImageSizeType
static const unsigned int OutputImageDimension
Decrease the image size by cropping the image to the selected region bounds.
Superclass::OutputImagePixelType OutputImagePixelType
TInputImage::IndexType InputImageIndexType
virtual void SetUpperBoundaryCropSize(SizeType _arg)
static const unsigned int OutputImageDimension
Superclass::OutputImageRegionType OutputImageRegionType
void PrintSelf(std::ostream &os, Indent indent) const override
SmartPointer< const Self > ConstPointer
Superclass::InputImageIndexType InputImageIndexType
Superclass::InputImageRegionType InputImageRegionType
void GenerateOutputInformation() override
TOutputImage::IndexType OutputImageIndexType
virtual void SetLowerBoundaryCropSize(SizeType _arg)
Superclass::OutputImageIndexType OutputImageIndexType
Superclass::OutputImageSizeType OutputImageSizeType
Decrease the image size by cropping the image by an itk::Size at both the upper and lower bounds of t...
Superclass::InputImagePixelType InputImagePixelType
void SetBoundaryCropSize(const SizeType &s)
InputImageSizeType SizeType
InputImageType::RegionType InputImageRegionType
Superclass::OutputImageRegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TInputImage::SizeType InputImageSizeType
#define itkConceptMacro(name, concept)
Superclass::InputImageSizeType InputImageSizeType
InputImageType::PixelType InputImagePixelType
static const unsigned int InputImageDimension