ITK  4.2.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 
21 
22 #include "itkObject.h"
23 #include "itkObjectFactory.h"
24 #include "itkMacro.h"
25 #include <vector>
26 
27 namespace itk
28 {
71 {
72 public:
75  typedef Object Superclass;
77 
79  itkNewMacro(Self);
80 
83 
84  /* -------- Define the API for RegularExpressionSeriesFileNames ---------- */
86  itkSetStringMacro(Directory);
87  itkGetStringMacro(Directory);
89 
91  itkSetStringMacro(RegularExpression);
92  itkGetStringMacro(RegularExpression);
94 
97  itkSetMacro(SubMatch, unsigned int);
98  itkGetConstMacro(SubMatch, unsigned int);
100 
104  itkSetMacro(NumericSort, bool);
105  itkGetConstMacro(NumericSort, bool);
106  itkBooleanMacro(NumericSort);
108 
111  const std::vector< std::string > & GetFileNames();
112 
113 protected:
115  m_Directory("."),
116  m_SubMatch(1),
117  m_NumericSort(false),
118  m_RegularExpression(".*\\.([0-9]+)")
119  {}
121  void PrintSelf(std::ostream & os, Indent indent) const;
122 
123 private:
124  RegularExpressionSeriesFileNames(const Self &); //purposely not implemented
125  void operator=(const Self &); //purposely not implemented
126 
127  std::string m_Directory;
128  unsigned int m_SubMatch;
130  std::string m_RegularExpression;
131 
132  std::vector< std::string > m_FileNames;
133 };
134 } //namespace ITK
135 
136 #endif // __itkRegularExpressionSeriesFileNames_h
137