ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGDCMSeriesFileNames.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 "gdcmSerieHelper.h"
26 #include "ITKIOGDCMExport.h"
27 
28 namespace itk
29 {
53 using FilenamesContainer = std::vector< std::string >;
54 using SerieUIDContainer = std::vector< std::string >;
55 
56 class ITKIOGDCM_EXPORT GDCMSeriesFileNames:public ProcessObject
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_ASSIGN(GDCMSeriesFileNames);
60 
65 
68 
71 
73  itkNewMacro(Self);
74 
76  itkTypeMacro(GDCMSeriesFileNames, ProcessObject);
77 
78  /* -------- Define the API for GDCMSeriesFileNames ----------- */
79 
81  void SetInputDirectory(const char *name);
82 
84  void SetInputDirectory(std::string const & name);
85 
87  void SetDirectory(std::string const & name)
88  {
89  SetInputDirectory(name);
90  }
91 
95  const FileNamesContainerType & GetInputFileNames();
96 
98  void SetOutputDirectory(std::string const & name)
99  {
100  m_OutputDirectory = name;
101  this->Modified();
102  }
104 
110  const FileNamesContainerType & GetOutputFileNames();
111 
118  const FileNamesContainerType & GetFileNames(const std::string serie);
119 
125  const SeriesUIDContainerType & GetSeriesUIDs();
126 
129  itkSetMacro(Recursive, bool);
130  itkGetConstMacro(Recursive, bool);
131  itkBooleanMacro(Recursive);
133 
138  void SetUseSeriesDetails(bool useSeriesDetails);
139 
145  {
146  return m_UseSeriesDetails;
147  }
148 
155  void AddSeriesRestriction(const std::string & tag)
156  {
157  m_SerieHelper->AddRestriction(tag);
158  }
159 
164  itkSetMacro(LoadSequences, bool);
165  itkGetConstMacro(LoadSequences, bool);
166  itkBooleanMacro(LoadSequences);
168 
173  itkSetMacro(LoadPrivateTags, bool);
174  itkGetConstMacro(LoadPrivateTags, bool);
175  itkBooleanMacro(LoadPrivateTags);
177 
178 protected:
180  ~GDCMSeriesFileNames() override;
181  void PrintSelf(std::ostream & os, Indent indent) const override;
182 
183 private:
185  std::string m_InputDirectory;
186 
188  std::string m_OutputDirectory;
189 
193 
195  gdcm::SerieHelper *m_SerieHelper;
196 
199 
204 };
205 } //namespace ITK
206 
207 #endif // itkGDCMSeriesFileNames_h
gdcm::SerieHelper * m_SerieHelper
std::vector< std::string > FilenamesContainer
Light weight base class for most itk classes.
void SetDirectory(std::string const &name)
FileNamesContainerType m_OutputFileNames
void AddSeriesRestriction(const std::string &tag)
SeriesUIDContainerType m_SeriesUIDs
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
FileNamesContainerType m_InputFileNames
SerieUIDContainer SeriesUIDContainerType
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
void SetOutputDirectory(std::string const &name)
std::vector< std::string > SerieUIDContainer
FilenamesContainer FileNamesContainerType
Generate a sequence of filenames from a DICOM series.
Control indentation during Print() invocation.
Definition: itkIndent.h:49