ITK  6.0.0
Insight Toolkit
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 <vector>
25#include "ITKIOGDCMExport.h"
26
27// forward declaration, to remove compile dependency on GDCM library
28namespace gdcm
29{
30class SerieHelper;
31}
32
33namespace itk
34{
60using FilenamesContainer = std::vector<std::string>;
61using SerieUIDContainer = std::vector<std::string>;
62
63class ITKIOGDCM_EXPORT GDCMSeriesFileNames : public ProcessObject
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(GDCMSeriesFileNames);
67
72
75
78
80 itkNewMacro(Self);
81
83 itkOverrideGetNameOfClassMacro(GDCMSeriesFileNames);
84
85 /* -------- Define the API for GDCMSeriesFileNames ----------- */
86
88 void
89 SetInputDirectory(const char * name);
90
92 void
93 SetInputDirectory(std::string const & name);
94
96 void
97 SetDirectory(std::string const & name)
98 {
99 SetInputDirectory(name);
100 }
101
105 const FileNamesContainerType &
107
109 void
110 SetOutputDirectory(std::string const & name)
111 {
112 m_OutputDirectory = name;
113 this->Modified();
114 }
122 const FileNamesContainerType &
124
132 GetFileNames(const std::string serie);
133
141
144 itkSetMacro(Recursive, bool);
145 itkGetConstMacro(Recursive, bool);
146 itkBooleanMacro(Recursive);
153 void
154 SetUseSeriesDetails(bool useSeriesDetails);
155
160 bool
162 {
163 return m_UseSeriesDetails;
164 }
165
172 void
173 AddSeriesRestriction(const std::string & tag);
174
179 itkSetMacro(LoadSequences, bool);
180 itkGetConstMacro(LoadSequences, bool);
181 itkBooleanMacro(LoadSequences);
188 itkSetMacro(LoadPrivateTags, bool);
189 itkGetConstMacro(LoadPrivateTags, bool);
190 itkBooleanMacro(LoadPrivateTags);
193protected:
196 void
197 PrintSelf(std::ostream & os, Indent indent) const override;
198
199private:
201 std::string m_InputDirectory = "";
202
204 std::string m_OutputDirectory = "";
205
207 FileNamesContainerType m_InputFileNames{};
208 FileNamesContainerType m_OutputFileNames{};
209
211 std::unique_ptr<gdcm::SerieHelper> m_SerieHelper;
212
215
216 bool m_UseSeriesDetails = true;
217 bool m_Recursive = false;
218 bool m_LoadSequences = false;
219 bool m_LoadPrivateTags = false;
220};
221} // namespace itk
222
223#endif // itkGDCMSeriesFileNames_h
Generate a sequence of filenames from a DICOM series.
void PrintSelf(std::ostream &os, Indent indent) const override
void SetOutputDirectory(std::string const &name)
std::unique_ptr< gdcm::SerieHelper > m_SerieHelper
const FileNamesContainerType & GetOutputFileNames()
FilenamesContainer FileNamesContainerType
void AddSeriesRestriction(const std::string &tag)
void SetInputDirectory(const char *name)
void SetUseSeriesDetails(bool useSeriesDetails)
const SeriesUIDContainerType & GetSeriesUIDs()
SerieUIDContainer SeriesUIDContainerType
void SetDirectory(std::string const &name)
void SetInputDirectory(std::string const &name)
~GDCMSeriesFileNames() override
const FileNamesContainerType & GetFileNames(const std::string serie)
const FileNamesContainerType & GetInputFileNames()
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::vector< std::string > FilenamesContainer
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
std::vector< std::string > SerieUIDContainer