23 #ifndef otbImageSeriesFileReader_hxx
24 #define otbImageSeriesFileReader_hxx
30 template <
class TImage,
class TInternalImage>
33 m_ExtractorList = ExtractSelectionListType::New();
36 template <
class TImage,
class TInternalImage>
39 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i)
41 this->m_ImageFileReaderList->PushBack(ReaderType::New());
42 this->m_OutputList->PushBack(OutputImageType::New());
43 m_ExtractorList->PushBack(ExtractSelectionListType::New());
47 template <
class TImage,
class TInternalImage>
50 std::ostringstream msg;
51 msg <<
"Something wrong... Check the template definition of this class in the program...\n";
52 msg <<
"\"ENVI META FILE\" FileName: " << this->m_FileName <<
"\n";
62 template <
class TPixel,
class TInternalPixel>
65 m_ExtractorList = ExtractSelectionListType::New();
71 template <
class TPixel,
class TInternalPixel>
74 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i)
76 this->m_ImageFileReaderList->PushBack(ReaderType::New());
77 this->m_OutputList->PushBack(OutputImageType::New());
78 m_ExtractorList->PushBack(ExtractSelectionType::New());
87 template <
class TPixel,
class TInternalPixel>
90 if (
bands.size() != 1)
92 std::ostringstream msg;
93 msg <<
"Unable to handle multicomponent file from Image<> class\n";
94 msg <<
"\"ENVI META FILE\" FileName: " << this->m_FileName <<
"\n";
102 std::ostringstream msg;
103 msg <<
"Unable to handle given band reading from multicomponent file with Image<> class\n";
104 msg <<
"\"ENVI META FILE\" FileName: " << this->m_FileName <<
"\n";
114 template <
class TPixel,
class TInternalPixel>
117 otbMsgDebugMacro(<<
"Reading " << idx <<
"th image: " << this->m_ListOfFileNames[idx]);
127 selection->SetInput(reader->GetOutput());
128 selection->GraftOutput(this->m_OutputList->GetNthElement(idx));
131 this->m_OutputList->GetNthElement(idx)->Graft(selection->GetOutput());
143 template <
class TPixel,
class TInternalPixel>
148 m_ExtractorList = ExtractSelectionListType::New();
155 template <
class TPixel,
class TInternalPixel>
158 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i)
160 this->m_ImageFileReaderList->PushBack(ReaderType::New());
161 this->m_OutputList->PushBack(OutputImageType::New());
162 m_ExtractorList->PushBack(ExtractSelectionType::New());
171 template <
class TPixel,
class TInternalPixel>
174 if (
bands.size() != 1)
176 std::ostringstream msg;
177 msg <<
"Unable to handle multicomponent file from Image<> class as output\n";
178 msg <<
"\"ENVI META FILE\" FileName: " << this->m_FileName <<
"\n";
189 template <
class TPixel,
class TInternalPixel>
192 otbMsgDebugMacro(<<
"Reading " << idx <<
"th image: " << this->m_ListOfFileNames[idx]);
201 selection->
SetChannel(this->m_ListOfBandSelection[idx][0]);
203 selection->SetInput(reader->GetOutput());
204 selection->GraftOutput(this->m_OutputList->GetNthElement(idx));
207 this->m_OutputList->GetNthElement(idx)->Graft(selection->GetOutput());
218 template <
class TPixel,
class TInternalPixel>
223 m_ExtractorList = ExtractSelectionListType::New();
230 template <
class TPixel,
class TInternalPixel>
233 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i)
235 this->m_ImageFileReaderList->PushBack(ReaderType::New());
236 this->m_OutputList->PushBack(OutputImageType::New());
237 m_ExtractorList->PushBack(ExtractSelectionType::New());
245 template <
class TPixel,
class TInternalPixel>
248 otbMsgDebugMacro(<<
"Reading " << idx <<
"th image: " << this->m_ListOfFileNames[idx]);
258 for (std::vector<unsigned int>::iterator band = this->m_ListOfBandSelection[idx].begin(); band != this->m_ListOfBandSelection[idx].end(); ++band)
263 selection->SetInput(reader->GetOutput());
264 selection->GraftOutput(this->m_OutputList->GetNthElement(idx));
267 this->m_OutputList->GetNthElement(idx)->Graft(selection->GetOutput());