ITK  4.13.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 typedef std::vector< std::string > FilenamesContainer;
54 typedef std::vector< std::string > SerieUIDContainer;
55 
56 class ITKIOGDCM_EXPORT GDCMSeriesFileNames:public ProcessObject
57 {
58 public:
63 
66 
69 
71  itkNewMacro(Self);
72 
74  itkTypeMacro(GDCMSeriesFileNames, ProcessObject);
75 
76  /* -------- Define the API for GDCMSeriesFileNames ----------- */
77 
79  void SetInputDirectory(const char *name);
80 
82  void SetInputDirectory(std::string const & name);
83 
85  void SetDirectory(std::string const & name)
86  {
87  SetInputDirectory(name);
88  }
89 
93  const FileNamesContainerType & GetInputFileNames();
94 
96  void SetOutputDirectory(std::string const & name)
97  {
98  m_OutputDirectory = name;
99  this->Modified();
100  }
102 
108  const FileNamesContainerType & GetOutputFileNames();
109 
116  const FileNamesContainerType & GetFileNames(const std::string serie);
117 
123  const SeriesUIDContainerType & GetSeriesUIDs();
124 
126  itkSetMacro(Recursive, bool);
127  itkGetConstMacro(Recursive, bool);
128  itkBooleanMacro(Recursive);
130 
135  void SetUseSeriesDetails(bool useSeriesDetails);
136 
142  {
143  return m_UseSeriesDetails;
144  }
145 
153  itkLegacyMacro(gdcm::SerieHelper * GetSeriesHelper(void));
154 
161  void AddSeriesRestriction(const std::string & tag)
162  {
163  m_SerieHelper->AddRestriction(tag);
164  }
165 
170  itkSetMacro(LoadSequences, bool);
171  itkGetConstMacro(LoadSequences, bool);
172  itkBooleanMacro(LoadSequences);
174 
179  itkSetMacro(LoadPrivateTags, bool);
180  itkGetConstMacro(LoadPrivateTags, bool);
181  itkBooleanMacro(LoadPrivateTags);
183 
184 protected:
186  ~GDCMSeriesFileNames() ITK_OVERRIDE;
187  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
188 
189 private:
190  ITK_DISALLOW_COPY_AND_ASSIGN(GDCMSeriesFileNames);
191 
193  std::string m_InputDirectory;
194 
196  std::string m_OutputDirectory;
197 
199  FileNamesContainerType m_InputFileNames;
200  FileNamesContainerType m_OutputFileNames;
201 
203  gdcm::SerieHelper *m_SerieHelper;
204 
207 
208  bool m_UseSeriesDetails;
209  bool m_Recursive;
210  bool m_LoadSequences;
211  bool m_LoadPrivateTags;
212 };
213 } //namespace ITK
214 
215 #endif // itkGDCMSeriesFileNames_h
std::vector< std::string > FilenamesContainer
Light weight base class for most itk classes.
void SetDirectory(std::string const &name)
void AddSeriesRestriction(const std::string &tag)
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
std::vector< std::string > SerieUIDContainer
void SetOutputDirectory(std::string const &name)
SerieUIDContainer SeriesUIDContainerType
FilenamesContainer FileNamesContainerType
Generate a sequence of filenames from a DICOM series.
Control indentation during Print() invocation.
Definition: itkIndent.h:49