OTB  10.0.0
Orfeo Toolbox
otbTileImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbTileImageFilter_h
22 #define otbTileImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 
26 namespace otb
27 {
52 template <class TImage>
53 class ITK_EXPORT TileImageFilter : public itk::ImageToImageFilter<TImage, TImage>
54 {
55 public:
58  typedef itk::ImageToImageFilter<TImage, TImage> Superclass;
59  typedef itk::SmartPointer<Self> Pointer;
60  typedef itk::SmartPointer<const Self> ConstPointer;
61 
63  typedef TImage ImageType;
64  typedef typename ImageType::Pointer ImagePointerType;
65  typedef typename ImageType::SizeType SizeType;
66  typedef typename ImageType::RegionType RegionType;
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(TileImageFilter, ImageToImageFilter);
73 
74  itkSetMacro(Layout, SizeType);
75  itkGetConstReferenceMacro(Layout, SizeType);
76 
77 protected:
80 
82  ~TileImageFilter() override;
83 
85  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
86 
88  void DynamicThreadedGenerateData(const RegionType& outputRegionForThread) override;
89 
91  void GenerateInputRequestedRegion() override;
92 
94  void GenerateOutputInformation() override;
95 
96 
97 private:
98  TileImageFilter(const Self&) = delete;
99  void operator=(const Self&) = delete;
100 
101  // Compute the overlapping region between the output requested
102  // region and the nth input tile largest region
103  RegionType OutputRegionToInputRegion(unsigned int tileIndex, const RegionType& requestedRegion);
104 
105  RegionType InputRegionToOutputRegion(unsigned int tileIndex, const RegionType& requestedRegion);
106 
107  // Layout of the images
109 
110  // Columns sizes
111  std::vector<unsigned int> m_ColumnsSizes;
112 
113  // Row sizes
114  std::vector<unsigned int> m_RowsSizes;
115 };
116 
117 } // end namespace itk
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
120 #include "otbTileImageFilter.hxx"
121 #endif
122 
123 #endif
This filter allows making a spatial mosaic from a set of images.
std::vector< unsigned int > m_ColumnsSizes
ImageType::SizeType SizeType
itk::SmartPointer< Self > Pointer
void operator=(const Self &)=delete
ImageType::RegionType RegionType
TileImageFilter(const Self &)=delete
itk::SmartPointer< const Self > ConstPointer
std::vector< unsigned int > m_RowsSizes
ImageType::Pointer ImagePointerType
itk::ImageToImageFilter< TImage, TImage > Superclass
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.