ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkRegularExpressionSeriesFileNames.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 __itkRegularExpressionSeriesFileNames_h
19 #define __itkRegularExpressionSeriesFileNames_h
20 #include "ITKIOImageBaseExport.h"
21 
22 
23 #include "itkObject.h"
24 #include "itkObjectFactory.h"
25 #include "itkMacro.h"
26 #include <vector>
27 
28 namespace itk
29 {
71 class ITKIOImageBase_EXPORT RegularExpressionSeriesFileNames:public Object
72 {
73 public:
76  typedef Object Superclass;
78 
80  itkNewMacro(Self);
81 
84 
85  /* -------- Define the API for RegularExpressionSeriesFileNames ---------- */
87  itkSetStringMacro(Directory);
88  itkGetStringMacro(Directory);
90 
92  itkSetStringMacro(RegularExpression);
93  itkGetStringMacro(RegularExpression);
95 
98  itkSetMacro(SubMatch, unsigned int);
99  itkGetConstMacro(SubMatch, unsigned int);
101 
105  itkSetMacro(NumericSort, bool);
106  itkGetConstMacro(NumericSort, bool);
107  itkBooleanMacro(NumericSort);
109 
112  const std::vector< std::string > & GetFileNames();
113 
114 protected:
116  m_Directory("."),
117  m_SubMatch(1),
118  m_NumericSort(false),
119  m_RegularExpression(".*\\.([0-9]+)")
120  {}
122  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
123 
124 private:
125  RegularExpressionSeriesFileNames(const Self &); //purposely not implemented
126  void operator=(const Self &); //purposely not implemented
127 
128  std::string m_Directory;
129  unsigned int m_SubMatch;
131  std::string m_RegularExpression;
132 
133  std::vector< std::string > m_FileNames;
134 };
135 } //namespace ITK
136 
137 #endif // __itkRegularExpressionSeriesFileNames_h
Light weight base class for most itk classes.
Portable directory/filename traversal.
Definition: itkDirectory.h:39
Generate an ordered sequence of filenames that match a regular expression.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57