OTB  10.0.0
Orfeo Toolbox
otbImageSeriesFileReader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #ifndef otbImageSeriesFileReader_h
24 #define otbImageSeriesFileReader_h
25 
27 
28 #include "otbObjectList.h"
29 
30 #include "otbExtractROI.h"
33 #include "OTBImageIOExport.h"
34 
35 namespace otb
36 {
37 
51 template <class TImage, class TInternalImage = TImage>
52 class OTBImageIO_EXPORT_TEMPLATE ImageSeriesFileReader : public ImageSeriesFileReaderBase<TImage, TInternalImage>
53 {
54 public:
55 
59  typedef itk::SmartPointer<Self> Pointer;
60  typedef itk::SmartPointer<const Self> ConstPointer;
61 
63  itkNewMacro(Self);
64 
67 
70  typedef typename Superclass::PixelType PixelType;
71  typedef typename Superclass::ValueType ValueType;
72  typedef typename Superclass::IndexType IndexType;
73  typedef typename Superclass::SizeType SizeType;
75 
79 
87 
90 
93 
100  // typedef MultiChannelExtractROI< InternalPixelType, PixelType > ExtractSelectionType;
101  // typedef MultiToMonoChannelExtractROI< InternalPixelType, PixelType > ExtractSelectionType;
102  // typedef ExtractROI< InternalPixelType, PixelType > ExtractSelectionType;
103  typedef itk::ImageToImageFilter<InternalImageType, OutputImageType> ExtractSelectionType;
104  typedef typename ExtractSelectionType::Pointer ExtractSelectionPointerType;
105 
108 
109  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
110 
111 protected:
113  ~ImageSeriesFileReader() override = default;
114 
118  virtual void TestBandSelection(std::vector<unsigned int>& itkNotUsed(bands))
119  {
120  }
121 
128  virtual void GenerateData(DataObjectPointerArraySizeType idx);
129  using Superclass::GenerateData;
130 
136  virtual void AllocateListOfComponents(void);
137 
139  void PrintSelf(std::ostream& os, itk::Indent indent) const
140  {
141  return Superclass::PrintSelf(os, indent);
142  }
143 
148 
149 private:
151  void operator=(const Self&);
152 }; // end of class
153 
167 template <class TPixel, class TInternalPixel>
168 class ITK_EXPORT ImageSeriesFileReader<Image<TPixel, 2>, Image<TInternalPixel, 2>>
169  : public ImageSeriesFileReaderBase<Image<TPixel, 2>, Image<TInternalPixel, 2>>
170 {
171 public:
172 
176  typedef itk::SmartPointer<Self> Pointer;
177  typedef itk::SmartPointer<const Self> ConstPointer;
178 
180  itkNewMacro(Self);
181 
184 
185  typedef typename Superclass::OutputImageType OutputImageType;
186  typedef typename Superclass::OutputImagePointerType OutputImagePointerType;
187  typedef typename Superclass::PixelType PixelType;
188  typedef typename Superclass::ValueType ValueType;
189  typedef typename Superclass::IndexType IndexType;
190  typedef typename Superclass::SizeType SizeType;
191  typedef typename Superclass::RegionType RegionType;
192 
193  typedef typename Superclass::OutputImageListType OutputImageListType;
194  typedef typename Superclass::OutputImageListPointerType OutputImageListPointerType;
195  typedef typename Superclass::OutputImageListConstPointerType OutputImageListConstPointerType;
196 
197  typedef typename Superclass::InternalImageType InternalImageType;
198  typedef typename Superclass::InternalImagePointerType InternalImagePointerType;
199  typedef typename Superclass::InternalPixelType InternalPixelType;
200  typedef typename Superclass::InternalValueType InternalValueType;
201  typedef typename Superclass::InternalIndexType InternalIndexType;
202  typedef typename Superclass::InternalSizeType InternalSizeType;
203  typedef typename Superclass::InternalRegionType InternalRegionType;
204 
205  typedef typename Superclass::ReaderType ReaderType;
206  typedef typename Superclass::ReaderType ReaderPointerType;
207 
208  typedef typename Superclass::ReaderListType ReaderListType;
209  typedef typename Superclass::ReaderListPointerType ReaderListPointerType;
210 
216 
219 
220  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
221 
222 protected:
225  {
226  }
227 
231  virtual void TestBandSelection(std::vector<unsigned int>& bands);
232 
239  virtual void GenerateData(DataObjectPointerArraySizeType idx);
240  using Superclass::GenerateData;
241 
247  virtual void AllocateListOfComponents(void);
248 
250  void PrintSelf(std::ostream& os, itk::Indent indent) const
251  {
252  return Superclass::PrintSelf(os, indent);
253  }
254 
259 
260 private:
262  void operator=(const Self&);
263 }; // end of class specialized for image
264 
277 template <class TPixel, class TInternalPixel>
278 class ITK_EXPORT ImageSeriesFileReader<Image<TPixel, 2>, VectorImage<TInternalPixel, 2>>
279  : public ImageSeriesFileReaderBase<Image<TPixel, 2>, VectorImage<TInternalPixel, 2>>
280 {
281 public:
285  typedef itk::SmartPointer<Self> Pointer;
286  typedef itk::SmartPointer<const Self> ConstPointer;
287 
289  itkNewMacro(Self);
290 
293 
294  typedef typename Superclass::OutputImageType OutputImageType;
295  typedef typename Superclass::OutputImagePointerType OutputImagePointerType;
296  typedef typename Superclass::PixelType PixelType;
297  typedef typename Superclass::ValueType ValueType;
298  typedef typename Superclass::IndexType IndexType;
299  typedef typename Superclass::SizeType SizeType;
300  typedef typename Superclass::RegionType RegionType;
301 
302  typedef typename Superclass::OutputImageListType OutputImageListType;
303  typedef typename Superclass::OutputImageListPointerType OutputImageListPointerType;
304  typedef typename Superclass::OutputImageListConstPointerType OutputImageListConstPointerType;
305 
306  typedef typename Superclass::InternalImageType InternalImageType;
307  typedef typename Superclass::InternalImagePointerType InternalImagePointerType;
308  typedef typename Superclass::InternalPixelType InternalPixelType;
309  typedef typename Superclass::InternalValueType InternalValueType;
310  typedef typename Superclass::InternalIndexType InternalIndexType;
311  typedef typename Superclass::InternalSizeType InternalSizeType;
312  typedef typename Superclass::InternalRegionType InternalRegionType;
313 
314  typedef typename Superclass::ReaderType ReaderType;
315  typedef typename Superclass::ReaderType ReaderPointerType;
316 
317  typedef typename Superclass::ReaderListType ReaderListType;
318  typedef typename Superclass::ReaderListPointerType ReaderListPointerType;
319 
325 
328 
329  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
330 
331 protected:
334  {
335  }
336 
340  virtual void TestBandSelection(std::vector<unsigned int>& bands);
341 
348  virtual void GenerateData(DataObjectPointerArraySizeType idx);
349  using Superclass::GenerateData;
350 
356  virtual void AllocateListOfComponents(void);
357 
359  void PrintSelf(std::ostream& os, itk::Indent indent) const
360  {
361  return Superclass::PrintSelf(os, indent);
362  }
363 
368 
369 private:
371  void operator=(const Self&);
372 
373 }; // end of class specialized for Image and VectorImage
374 
387 template <class TPixel, class TInternalPixel>
388 class ITK_EXPORT ImageSeriesFileReader<VectorImage<TPixel, 2>, VectorImage<TInternalPixel, 2>>
389  : public ImageSeriesFileReaderBase<VectorImage<TPixel, 2>, VectorImage<TInternalPixel, 2>>
390 {
391 public:
395  typedef itk::SmartPointer<Self> Pointer;
396  typedef itk::SmartPointer<const Self> ConstPointer;
397 
399  itkNewMacro(Self);
400 
403 
404  typedef typename Superclass::OutputImageType OutputImageType;
405  typedef typename Superclass::OutputImagePointerType OutputImagePointerType;
406  typedef typename Superclass::PixelType PixelType;
407  typedef typename Superclass::ValueType ValueType;
408  typedef typename Superclass::IndexType IndexType;
409  typedef typename Superclass::SizeType SizeType;
410  typedef typename Superclass::RegionType RegionType;
411 
412  typedef typename Superclass::OutputImageListType OutputImageListType;
413  typedef typename Superclass::OutputImageListPointerType OutputImageListPointerType;
414  typedef typename Superclass::OutputImageListConstPointerType OutputImageListConstPointerType;
415 
416  typedef typename Superclass::InternalImageType InternalImageType;
417  typedef typename Superclass::InternalImagePointerType InternalImagePointerType;
418  typedef typename Superclass::InternalPixelType InternalPixelType;
419  typedef typename Superclass::InternalValueType InternalValueType;
420  typedef typename Superclass::InternalIndexType InternalIndexType;
421  typedef typename Superclass::InternalSizeType InternalSizeType;
422  typedef typename Superclass::InternalRegionType InternalRegionType;
423 
424  typedef typename Superclass::ReaderType ReaderType;
425  typedef typename Superclass::ReaderType ReaderPointerType;
426 
427  typedef typename Superclass::ReaderListType ReaderListType;
428  typedef typename Superclass::ReaderListPointerType ReaderListPointerType;
429 
436 
439 
440  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
441 
442 protected:
445  {
446  }
447 
451  void TestBandSelection(std::vector<unsigned int>& itkNotUsed(bands)) override
452  {
453  }
454 
461  void GenerateData(DataObjectPointerArraySizeType idx) override;
462  using Superclass::GenerateData;
463 
469  void AllocateListOfComponents(void) override;
470 
472  void PrintSelf(std::ostream& os, itk::Indent indent) const override
473  {
474  return Superclass::PrintSelf(os, indent);
475  }
476 
481 
482 private:
484  void operator=(const Self&);
485 }; // end of class specialized for VectorImage
486 
487 } // end of namespace otb
488 
489 #ifndef OTB_MANUAL_INSTANTIATION
491 #endif
492 
493 #endif
Extract a subset of a mono-channel image.
Definition: otbExtractROI.h:44
itk::SmartPointer< Self > Pointer
Definition: otbExtractROI.h:49
Reads image data.
Base class for all the filters producing an otbImageList.
This class represent a list of images.
Definition: otbImageList.h:40
OutputImageType::InternalPixelType PixelType
OutputImageType::Pointer OutputImagePointerType
InternalImageType::Pointer InternalImagePointerType
InternalImageType::ValueType InternalValueType
OutputImageType::RegionType RegionType
OutputImageListType::ConstPointer OutputImageListConstPointerType
InternalImageType::RegionType InternalRegionType
InternalImageType::IndexType InternalIndexType
OutputImageListType::Pointer OutputImageListPointerType
InternalImageType::InternalPixelType InternalPixelType
InternalImageType::SizeType InternalSizeType
ImageSeriesFileReaderBase< Image< TPixel, 2 >, Image< TInternalPixel, 2 > > Superclass
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
MultiToMonoChannelExtractROI< InternalPixelType, PixelType > ExtractSelectionType
ImageSeriesFileReaderBase< Image< TPixel, 2 >, VectorImage< TInternalPixel, 2 > > Superclass
ImageSeriesFileReaderBase< VectorImage< TPixel, 2 >, VectorImage< TInternalPixel, 2 > > Superclass
Reader class dedicated to image series reading.
Superclass::InternalRegionType InternalRegionType
ImageSeriesFileReader(const Self &)
Superclass::OutputImageListPointerType OutputImageListPointerType
~ImageSeriesFileReader() override=default
Superclass::InternalIndexType InternalIndexType
void operator=(const Self &)
ObjectList< ExtractSelectionType > ExtractSelectionListType
ExtractSelectionListPointerType m_ExtractorList
Superclass::ReaderType ReaderType
Superclass::InternalImageType InternalImageType
Superclass::OutputImageListConstPointerType OutputImageListConstPointerType
itk::SmartPointer< Self > Pointer
ExtractSelectionType::Pointer ExtractSelectionPointerType
itk::SmartPointer< const Self > ConstPointer
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Superclass::ReaderType ReaderPointerType
void PrintSelf(std::ostream &os, itk::Indent indent) const
Superclass::ReaderListPointerType ReaderListPointerType
ImageSeriesFileReaderBase< TImage, TInternalImage > Superclass
Superclass::InternalPixelType InternalPixelType
Superclass::OutputImagePointerType OutputImagePointerType
Superclass::OutputImageType OutputImageType
Superclass::InternalImagePointerType InternalImagePointerType
Superclass::OutputImageListType OutputImageListType
Superclass::InternalSizeType InternalSizeType
Superclass::InternalValueType InternalValueType
Superclass::ReaderListType ReaderListType
Superclass::RegionType RegionType
virtual void TestBandSelection(std::vector< unsigned int > &)
itk::ImageToImageFilter< InternalImageType, OutputImageType > ExtractSelectionType
ExtractSelectionListType::Pointer ExtractSelectionListPointerType
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
Extract a spatial or spectral subset of a multi-channel image.
itk::SmartPointer< Self > Pointer
Extract a mono channel part of a multi-channel image.
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
Creation of an "otb" vector image which contains metadata.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.