ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGDCMSeriesFileNames.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 itkGDCMSeriesFileNames_h
19#define itkGDCMSeriesFileNames_h
20
21#include "itkProcessObject.h"
22#include "itkObjectFactory.h"
23#include "itkMacro.h"
24#include <map>
25#include <utility>
26#include <vector>
27#include "ITKIOGDCMExport.h"
28
29namespace itk
30{
55
57using FilenamesContainer = std::vector<std::string>;
58using SerieUIDContainer = std::vector<std::string>;
59
60class ITKIOGDCM_EXPORT GDCMSeriesFileNames : public ProcessObject
61{
62public:
63 ITK_DISALLOW_COPY_AND_MOVE(GDCMSeriesFileNames);
64
69
72
75
77 itkNewMacro(Self);
78
80 itkOverrideGetNameOfClassMacro(GDCMSeriesFileNames);
81
82 /* -------- Define the API for GDCMSeriesFileNames ----------- */
83
85 void
86 SetInputDirectory(const char * name);
87
89 void
90 SetInputDirectory(const std::string & name);
91
93 void
94 SetDirectory(const std::string & name)
95 {
97 }
98
102 const FileNamesContainerType &
104
106 void
107 SetOutputDirectory(const std::string & name)
108 {
109 m_OutputDirectory = name;
110 this->Modified();
111 }
112
118 const FileNamesContainerType &
120
128 GetFileNames(const std::string serie);
129
137
141 itkSetMacro(Recursive, bool);
142 itkGetConstMacro(Recursive, bool);
143 itkBooleanMacro(Recursive);
145
152 void
153 SetUseSeriesDetails(bool useSeriesDetails);
154
159 bool
161 {
162 return m_UseSeriesDetails;
163 }
164
172 void
173 AddSeriesRestriction(const std::string & tag);
174
182 itkSetMacro(FailOnAmbiguousOrdering, bool);
183 itkGetConstMacro(FailOnAmbiguousOrdering, bool);
184 itkBooleanMacro(FailOnAmbiguousOrdering);
186
192 itkSetMacro(LoadSequences, bool);
193 itkGetConstMacro(LoadSequences, bool);
194 itkBooleanMacro(LoadSequences);
196
202 itkSetMacro(LoadPrivateTags, bool);
203 itkGetConstMacro(LoadPrivateTags, bool);
204 itkBooleanMacro(LoadPrivateTags);
206protected:
209 void
210 PrintSelf(std::ostream & os, Indent indent) const override;
211
212private:
214 std::string m_InputDirectory = "";
215
217 std::string m_OutputDirectory = "";
218
222
224 void
226
229 {
231 bool Ordered{ false };
232 };
233
236 void
238
240 std::map<std::string, SeriesEntry> m_SeriesFiles{};
241
243 std::map<std::string, std::string> m_InstanceNumbers{};
244
248 std::vector<std::pair<unsigned short, unsigned short>> m_UserRefineTags{};
249
253
256
257 bool m_UseSeriesDetails = false;
259 bool m_Recursive = false;
260 bool m_LoadSequences = false;
261 bool m_LoadPrivateTags = false;
262};
263} // namespace itk
264
265#endif // itkGDCMSeriesFileNames_h
void PrintSelf(std::ostream &os, Indent indent) const override
FileNamesContainerType m_OutputFileNames
std::map< std::string, SeriesEntry > m_SeriesFiles
const FileNamesContainerType & GetOutputFileNames()
void SetInputDirectory(const std::string &name)
FilenamesContainer FileNamesContainerType
void AddSeriesRestriction(const std::string &tag)
FileNamesContainerType m_InputFileNames
std::vector< std::pair< unsigned short, unsigned short > > m_UserRefineTags
void SetDirectory(const std::string &name)
void SetInputDirectory(const char *name)
void SetUseSeriesDetails(bool useSeriesDetails)
const SeriesUIDContainerType & GetSeriesUIDs()
SerieUIDContainer SeriesUIDContainerType
~GDCMSeriesFileNames() override
const FileNamesContainerType & GetFileNames(const std::string serie)
const FileNamesContainerType & GetInputFileNames()
void SetOutputDirectory(const std::string &name)
SeriesUIDContainerType m_SeriesUIDs
std::map< std::string, std::string > m_InstanceNumbers
void OrderSeries(SeriesEntry &entry)
Control indentation during Print() invocation.
Definition itkIndent.h:51
virtual void Modified() const
Implements transparent reference counting.
Generate a unique, increasing time value.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::vector< std::string > SerieUIDContainer
std::vector< std::string > FilenamesContainer