ITK  6.0.0
Insight Toolkit
itkRegularExpressionSeriesFileNames.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 * https://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
28namespace itk
29{
71class ITKIOImageBase_EXPORT RegularExpressionSeriesFileNames : public Object
72{
73public:
74 ITK_DISALLOW_COPY_AND_MOVE(RegularExpressionSeriesFileNames);
75
80
82 itkNewMacro(Self);
83
85 itkOverrideGetNameOfClassMacro(RegularExpressionSeriesFileNames);
86
87 /* -------- Define the API for RegularExpressionSeriesFileNames ---------- */
89 itkSetStringMacro(Directory);
90 itkGetStringMacro(Directory);
94 itkSetStringMacro(RegularExpression);
95 itkGetStringMacro(RegularExpression);
100 itkSetMacro(SubMatch, unsigned int);
101 itkGetConstMacro(SubMatch, unsigned int);
107 itkSetMacro(NumericSort, bool);
108 itkGetConstMacro(NumericSort, bool);
109 itkBooleanMacro(NumericSort);
114 const std::vector<std::string> &
116
117protected:
119 : m_Directory(".")
120 , m_RegularExpression(".*\\.([0-9]+)")
121 {}
123 void
124 PrintSelf(std::ostream & os, Indent indent) const override;
125
126private:
127 std::string m_Directory{};
128 unsigned int m_SubMatch{ 1 };
129 bool m_NumericSort{ false };
130 std::string m_RegularExpression{};
131
132 std::vector<std::string> m_FileNames{};
133};
134} // namespace itk
135
136#endif // itkRegularExpressionSeriesFileNames_h
Portable directory/filename traversal.
Definition: itkDirectory.h:40
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Generate an ordered sequence of filenames that match a regular expression.
void PrintSelf(std::ostream &os, Indent indent) const override
const std::vector< std::string > & GetFileNames()
~RegularExpressionSeriesFileNames() override=default
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....