ITK  5.3.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  * http://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
28 namespace gdcm
29 {
30 class SerieHelper;
31 }
32 
33 namespace itk
34 {
60 using FilenamesContainer = std::vector<std::string>;
61 using SerieUIDContainer = std::vector<std::string>;
62 
63 class ITKIOGDCM_EXPORT GDCMSeriesFileNames : public ProcessObject
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_MOVE(GDCMSeriesFileNames);
67 
72 
75 
78 
80  itkNewMacro(Self);
81 
83  itkTypeMacro(GDCMSeriesFileNames, ProcessObject);
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 &
106  GetInputFileNames();
107 
109  void
110  SetOutputDirectory(std::string const & name)
111  {
112  m_OutputDirectory = name;
113  this->Modified();
114  }
116 
122  const FileNamesContainerType &
123  GetOutputFileNames();
124 
131  const FileNamesContainerType &
132  GetFileNames(const std::string serie);
133 
139  const SeriesUIDContainerType &
140  GetSeriesUIDs();
141 
144  itkSetMacro(Recursive, bool);
145  itkGetConstMacro(Recursive, bool);
146  itkBooleanMacro(Recursive);
148 
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);
183 
188  itkSetMacro(LoadPrivateTags, bool);
189  itkGetConstMacro(LoadPrivateTags, bool);
190  itkBooleanMacro(LoadPrivateTags);
192 
193 protected:
195  ~GDCMSeriesFileNames() override;
196  void
197  PrintSelf(std::ostream & os, Indent indent) const override;
198 
199 private:
201  std::string m_InputDirectory = "";
202 
204  std::string m_OutputDirectory = "";
205 
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
itkObjectFactory.h
itk::GDCMSeriesFileNames::SetDirectory
void SetDirectory(std::string const &name)
Definition: itkGDCMSeriesFileNames.h:97
itk::GDCMSeriesFileNames::m_OutputFileNames
FileNamesContainerType m_OutputFileNames
Definition: itkGDCMSeriesFileNames.h:208
itk::SerieUIDContainer
std::vector< std::string > SerieUIDContainer
Definition: itkGDCMSeriesFileNames.h:61
itk::GDCMSeriesFileNames::m_SerieHelper
std::unique_ptr< gdcm::SerieHelper > m_SerieHelper
Definition: itkGDCMSeriesFileNames.h:211
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
gdcm
Definition: itkGDCMSeriesFileNames.h:28
itk::GDCMSeriesFileNames::m_SeriesUIDs
SeriesUIDContainerType m_SeriesUIDs
Definition: itkGDCMSeriesFileNames.h:214
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GDCMSeriesFileNames::SetOutputDirectory
void SetOutputDirectory(std::string const &name)
Definition: itkGDCMSeriesFileNames.h:110
itkMacro.h
itkProcessObject.h
itk::GDCMSeriesFileNames::SeriesUIDContainerType
SerieUIDContainer SeriesUIDContainerType
Definition: itkGDCMSeriesFileNames.h:77
itk::FilenamesContainer
std::vector< std::string > FilenamesContainer
Definition: itkGDCMSeriesFileNames.h:60
itk::GDCMSeriesFileNames
Generate a sequence of filenames from a DICOM series.
Definition: itkGDCMSeriesFileNames.h:63
itk::GDCMSeriesFileNames::FileNamesContainerType
FilenamesContainer FileNamesContainerType
Definition: itkGDCMSeriesFileNames.h:74
itk::GDCMSeriesFileNames::GetUseSeriesDetails
bool GetUseSeriesDetails() const
Definition: itkGDCMSeriesFileNames.h:161
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::GDCMSeriesFileNames::m_InputFileNames
FileNamesContainerType m_InputFileNames
Definition: itkGDCMSeriesFileNames.h:207