ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRegularExpressionSeriesFileNames.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRegularExpressionSeriesFileNames_h
00019 #define __itkRegularExpressionSeriesFileNames_h
00020 
00021 
00022 #include "itkObject.h"
00023 #include "itkObjectFactory.h"
00024 #include "itkMacro.h"
00025 #include <vector>
00026 
00027 namespace itk
00028 {
00070 class ITK_EXPORT RegularExpressionSeriesFileNames:public Object
00071 {
00072 public:
00074   typedef RegularExpressionSeriesFileNames Self;
00075   typedef Object                           Superclass;
00076   typedef SmartPointer< Self >             Pointer;
00077 
00079   itkNewMacro(Self);
00080 
00082   itkTypeMacro(RegularExpressionSeriesFileNames, Object);
00083 
00084   /* -------- Define the API for RegularExpressionSeriesFileNames ---------- */
00086   itkSetStringMacro(Directory);
00087   itkGetStringMacro(Directory);
00089 
00091   itkSetStringMacro(RegularExpression);
00092   itkGetStringMacro(RegularExpression);
00094 
00097   itkSetMacro(SubMatch, unsigned int);
00098   itkGetConstMacro(SubMatch, unsigned int);
00100 
00104   itkSetMacro(NumericSort, bool);
00105   itkGetConstMacro(NumericSort, bool);
00106   itkBooleanMacro(NumericSort);
00108 
00111   const std::vector< std::string > & GetFileNames();
00112 
00113 protected:
00114   RegularExpressionSeriesFileNames():
00115     m_Directory("."),
00116     m_SubMatch(1),
00117     m_NumericSort(false),
00118     m_RegularExpression(".*\\.([0-9]+)")
00119   {}
00120   ~RegularExpressionSeriesFileNames() {}
00121   void PrintSelf(std::ostream & os, Indent indent) const;
00122 
00123 private:
00124   RegularExpressionSeriesFileNames(const Self &); //purposely not implemented
00125   void operator=(const Self &);                   //purposely not implemented
00126 
00127   std::string  m_Directory;
00128   unsigned int m_SubMatch;
00129   bool         m_NumericSort;
00130   std::string  m_RegularExpression;
00131 
00132   std::vector< std::string > m_FileNames;
00133 };
00134 } //namespace ITK
00135 
00136 #endif // __itkRegularExpressionSeriesFileNames_h
00137