OTB  9.0.0
Orfeo Toolbox
otbSarConcatenateBurstsImageFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbSarConcatenateBurstsImageFilter_hxx
22 #define otbSarConcatenateBurstsImageFilter_hxx
23 
25 #include "itkImageRegionIterator.h"
26 #include "otbSarSensorModel.h"
27 
28 namespace otb
29 {
30 template <class TImage>
32 {
33  m_SLCImd = sarImd;
34 }
35 
36 template <class TImage>
38  unsigned int first_burstInd, bool inputWithInvalidPixels)
39 {
40  // Try to create a SarSensorModel
41  SarSensorModel sarSensorModel(m_SLCImd);
42 
44 
45  // Try to call the deburstAndConcatenate function
46  bool deburstAndConcatenateOk = sarSensorModel.DeburstAndConcatenate(linesRecord, samplesRecord, m_Offset_OriginL, first_burstInd, inputWithInvalidPixels);
47 
48  if (!deburstAndConcatenateOk)
49  itkExceptionMacro(<< "Could not deburst or concatenate from input bursts");
50 
51  sarSensorModel.UpdateImageMetadata(m_SLCImd);
52 
53  return true;
54 }
55 
56 template <class TImage>
58 {
59  // First, call superclass implementation
60  Superclass::GenerateOutputInformation();
61 
62  auto outputPtr = this->GetOutput();
63 
64  // Origin to (0.5, 0.5) : Metadata are already adjusted
65  PointType origin;
66  origin[0] = 0.5;
67  origin[1] = 0.5 + m_Offset_OriginL;
68 
69  outputPtr->SetOrigin(origin);
70 
71  m_SLCImd.Add(MDNum::NumberOfLines, this->GetOutput()->GetLargestPossibleRegion().GetSize()[0]);
72  m_SLCImd.Add(MDNum::NumberOfColumns, this->GetOutput()->GetLargestPossibleRegion().GetSize()[1]);
73 
74  outputPtr->SetImageMetadata(m_SLCImd);
75 }
76 
77 
78 } // end namespace otb
79 
80 #endif
otb::SarConcatenateBurstsImageFilter::LinesRecordVectorType
std::vector< RecordType > LinesRecordVectorType
Definition: otbSarConcatenateBurstsImageFilter.h:74
otb::SarConcatenateBurstsImageFilter::getDeburstLinesAndSamples
bool getDeburstLinesAndSamples(LinesRecordVectorType &linesRecord, LinesRecordVectorType &samplesRecord, unsigned int first_burstInd, bool inputWithInvalidPixels)
Definition: otbSarConcatenateBurstsImageFilter.hxx:37
otb::SarSensorModel
Definition: otbSarSensorModel.h:36
otbSarSensorModel.h
otb::SarConcatenateBurstsImageFilter::SetSLCImageMetadata
void SetSLCImageMetadata(ImageMetadata sarImd)
Definition: otbSarConcatenateBurstsImageFilter.hxx:31
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbSarConcatenateBurstsImageFilter.h
otb::MDNum::NumberOfColumns
@ NumberOfColumns
otb::SarConcatenateBurstsImageFilter::GenerateOutputInformation
void GenerateOutputInformation() override
Definition: otbSarConcatenateBurstsImageFilter.hxx:57
otb::SarConcatenateBurstsImageFilter::PointType
ImageType::PointType PointType
Definition: otbSarConcatenateBurstsImageFilter.h:71
otb::SarSensorModel::UpdateImageMetadata
void UpdateImageMetadata(ImageMetadata &imd)
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otb::SarSensorModel::DeburstAndConcatenate
bool DeburstAndConcatenate(std::vector< std::pair< unsigned long, unsigned long > > &linesBursts, std::vector< std::pair< unsigned long, unsigned long > > &samplesBursts, unsigned int &linesOffset, unsigned int first_burstInd, bool inputWithInvalidPixels=false)
otb::MDNum::NumberOfLines
@ NumberOfLines