ITK  6.0.0
Insight Toolkit
itkImageSeriesReader.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkImageSeriesReader_h
19#define itkImageSeriesReader_h
20#include "ITKIOImageBaseExport.h"
21
22#include "itkSize.h"
23#include <vector>
24#include <string>
26#include "itkImageFileReader.h"
27
28namespace itk
29{
44template <typename TOutputImage>
45class ITK_TEMPLATE_EXPORT ImageSeriesReader : public ImageSource<TOutputImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(ImageSeriesReader);
49
54
56 itkNewMacro(Self);
57
59 itkOverrideGetNameOfClassMacro(ImageSeriesReader);
60
63
66
69
71 using OutputImagePixelType = typename TOutputImage::PixelType;
72
76 using DictionaryArrayType = std::vector<DictionaryRawPointer>;
78
79 using FileNamesContainer = std::vector<std::string>;
80
83 void
85 {
86 if (m_FileNames != name)
87 {
88 m_FileNames = name;
89 this->Modified();
90 }
91 }
94 const FileNamesContainer &
96 {
97 return m_FileNames;
98 }
99
102 void
103 SetFileName(std::string const & name)
104 {
105 m_FileNames.clear();
106 m_FileNames.push_back(name);
107 this->Modified();
108 }
112 void
113 AddFileName(std::string const & name)
114 {
115 m_FileNames.push_back(name);
116 this->Modified();
117 }
122 itkSetMacro(ReverseOrder, bool);
123 itkGetConstMacro(ReverseOrder, bool);
124 itkBooleanMacro(ReverseOrder);
129 itkSetMacro(ForceOrthogonalDirection, bool);
130 itkGetConstMacro(ForceOrthogonalDirection, bool);
131 itkBooleanMacro(ForceOrthogonalDirection);
138 itkSetObjectMacro(ImageIO, ImageIOBase);
139 itkGetModifiableObjectMacro(ImageIO, ImageIOBase);
151 itkSetMacro(MetaDataDictionaryArrayUpdate, bool);
152 itkGetConstMacro(MetaDataDictionaryArrayUpdate, bool);
153 itkBooleanMacro(MetaDataDictionaryArrayUpdate);
154
157 void
159
165 void
167
172
174 itkSetMacro(UseStreaming, bool);
175 itkGetConstReferenceMacro(UseStreaming, bool);
176 itkBooleanMacro(UseStreaming);
180 itkSetMacro(SpacingWarningRelThreshold, double);
181 itkGetConstMacro(SpacingWarningRelThreshold, double);
184protected:
186 : m_ImageIO(nullptr)
187
188 {}
190 void
191 PrintSelf(std::ostream & os, Indent indent) const override;
192
194 void
195 GenerateData() override;
196
199
201 bool m_ReverseOrder{ false };
202
204 bool m_ForceOrthogonalDirection{ true };
205
207 FileNamesContainer m_FileNames{};
208
214 unsigned int m_NumberOfDimensionsInImage{ 0 };
215
218 DictionaryArrayType m_MetaDataDictionaryArray{};
219
220 bool m_UseStreaming{ true };
221
222 bool m_SpacingDefined{ false };
223
224 double m_SpacingWarningRelThreshold{ 1e-4 };
225
226private:
228
229 int
231
233 TimeStamp m_MetaDataDictionaryArrayMTime{};
234
236 bool m_MetaDataDictionaryArrayUpdate{ true };
237};
238} // namespace itk
239
240#ifndef ITK_MANUAL_INSTANTIATION
241# include "itkImageSeriesReader.hxx"
242#endif
243
244#endif // itkImageSeriesReader_h
Base class for all data objects in ITK.
Data source that reads image data from a single file.
Abstract superclass defines image IO interface.
Data source that reads image data from a series of disk files.
std::vector< std::string > FileNamesContainer
void AddFileName(std::string const &name)
std::vector< DictionaryRawPointer > DictionaryArrayType
void GenerateData() override
typename TOutputImage::RegionType ImageRegionType
const DictionaryArrayType * DictionaryArrayRawPointer
void GenerateOutputInformation() override
typename TOutputImage::SizeType SizeType
void SetFileName(std::string const &name)
typename TOutputImage::IndexType IndexType
DictionaryArrayRawPointer GetMetaDataDictionaryArray() const
~ImageSeriesReader() override
void PrintSelf(std::ostream &os, Indent indent) const override
int ComputeMovingDimensionIndex(ReaderType *reader)
void SetFileNames(const FileNamesContainer &name)
void EnlargeOutputRequestedRegion(DataObject *output) override
const FileNamesContainer & GetFileNames() const
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Provides a mechanism for storing a collection of arbitrary data types.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Generate a unique, increasing time value.
Definition: itkTimeStamp.h:61
static constexpr double e
Definition: itkMath.h:56
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....