ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGDCMSeriesFileNames.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 __itkGDCMSeriesFileNames_h
00019 #define __itkGDCMSeriesFileNames_h
00020 
00021 #include "itkProcessObject.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkMacro.h"
00024 #include <vector>
00025 #include "gdcmSerieHelper.h"
00026 
00027 namespace itk
00028 {
00051 typedef std::vector< std::string > FilenamesContainer;
00052 typedef std::vector< std::string > SerieUIDContainer;
00053 class ITK_EXPORT GDCMSeriesFileNames:public ProcessObject
00054 {
00055 public:
00057   typedef GDCMSeriesFileNames  Self;
00058   typedef ProcessObject        Superclass;
00059   typedef SmartPointer< Self > Pointer;
00060 
00062   itkNewMacro(Self);
00063 
00065   itkTypeMacro(GDCMSeriesFileNames, ProcessObject);
00066 
00067   /* -------- Define the API for GDCMSeriesFileNames ----------- */
00068 
00070   void SetInputDirectory(const char *name);
00071 
00073   void SetInputDirectory(std::string const & name);
00074 
00076   void SetDirectory(std::string const & name)
00077   {
00078     SetInputDirectory(name);
00079   }
00080 
00084   const FilenamesContainer & GetInputFileNames();
00085 
00087   void SetOutputDirectory(std::string const & name)
00088   {
00089     m_OutputDirectory = name;
00090     this->Modified();
00091   }
00093 
00099   const FilenamesContainer & GetOutputFileNames();
00100 
00107   const FilenamesContainer & GetFileNames(const std::string serie);
00108 
00114   const SerieUIDContainer & GetSeriesUIDs();
00115 
00117   itkSetMacro(Recursive, bool);
00118   itkGetConstMacro(Recursive, bool);
00119   itkBooleanMacro(Recursive);
00121 
00126   void SetUseSeriesDetails(bool useSeriesDetails);
00127 
00132   bool GetUseSeriesDetails(void)
00133   {
00134     return m_UseSeriesDetails;
00135   }
00136 
00143   gdcm::SerieHelper * GetSeriesHelper(void)
00144   {
00145     return m_SerieHelper;
00146   }
00147 
00154   void AddSeriesRestriction(const std::string & tag)
00155   {
00156     m_SerieHelper->AddRestriction(tag);
00157   }
00158 
00163   itkSetMacro(LoadSequences, bool);
00164   itkGetConstMacro(LoadSequences, bool);
00165   itkBooleanMacro(LoadSequences);
00167 
00172   itkSetMacro(LoadPrivateTags, bool);
00173   itkGetConstMacro(LoadPrivateTags, bool);
00174   itkBooleanMacro(LoadPrivateTags);
00175 protected:
00176   GDCMSeriesFileNames();
00177   ~GDCMSeriesFileNames();
00178   void PrintSelf(std::ostream & os, Indent indent) const;
00180 
00181 private:
00182   GDCMSeriesFileNames(const Self &); //purposely not implemented
00183   void operator=(const Self &);      //purposely not implemented
00184 
00186   std::string m_InputDirectory;
00187 
00189   std::string m_OutputDirectory;
00190 
00192   FilenamesContainer m_InputFileNames;
00193   FilenamesContainer m_OutputFileNames;
00194 
00196   gdcm::SerieHelper *m_SerieHelper;
00197 
00199   SerieUIDContainer m_SeriesUIDs;
00200 
00201   bool m_UseSeriesDetails;
00202   bool m_Recursive;
00203   bool m_LoadSequences;
00204   bool m_LoadPrivateTags;
00205 };
00206 } //namespace ITK
00207 
00208 #endif // __itkGDCMSeriesFileNames_h
00209