SimpleITK  1.1.0
sitkImageSeriesWriter.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 sitkImageSeriesWriter_h
19 #define sitkImageSeriesWriter_h
20 
21 #include "sitkMacro.h"
22 #include "sitkImage.h"
23 #include "sitkProcessObject.h"
24 #include "sitkIO.h"
26 
27 namespace itk {
28  namespace simple {
29 
46  : public ProcessObject
47  {
48  public:
50 
51  virtual ~ImageSeriesWriter();
52 
54 
56  virtual std::string ToString() const;
57 
60  virtual std::vector<std::string> GetRegisteredImageIOs() const;
61 
63  virtual std::string GetName() const { return std::string("ImageSeriesWriter"); }
64 
71  SITK_RETURN_SELF_TYPE_HEADER SetUseCompression( bool UseCompression );
72  bool GetUseCompression( void ) const;
73 
74  SITK_RETURN_SELF_TYPE_HEADER UseCompressionOn( void ) { return this->SetUseCompression(true); }
75  SITK_RETURN_SELF_TYPE_HEADER UseCompressionOff( void ) { return this->SetUseCompression(false); }
83  SITK_RETURN_SELF_TYPE_HEADER SetFileNames ( const std::vector<std::string> &fileNames );
84  const std::vector<std::string> &GetFileNames() const;
88  SITK_RETURN_SELF_TYPE_HEADER Execute( const Image& );
89  SITK_RETURN_SELF_TYPE_HEADER Execute( const Image &image, const std::vector<std::string> &inFileNames, bool useCompression );
90 
91  protected:
92 
93  template <class TImageType> Self &ExecuteInternal ( const Image& inImage );
94 
95  private:
96 
97  // function pointer type
98  typedef Self& (Self::*MemberFunctionType)( const Image& );
99 
100  // friend to get access to executeInternal member
101  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
102  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
103 
105  std::vector<std::string> m_FileNames;
106  };
107 
108  SITKIO_EXPORT void WriteImage ( const Image & image, const std::vector<std::string> &fileNames, bool useCompression=false );
109  }
110 }
111 
112 #endif
itk::simple::Image
The main Image class for SimpleITK.
Definition: sitkImage.h:54
itk::simple::ImageSeriesWriter::GetName
virtual std::string GetName() const
Definition: sitkImageSeriesWriter.h:63
itk::simple::WriteImage
SITKIO_EXPORT void WriteImage(const Image &image, const std::string &fileName, bool useCompression=false)
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:32
SITKIO_EXPORT
#define SITKIO_EXPORT
Definition: sitkIO.h:33
itk::simple::ImageSeriesWriter::Self
ImageSeriesWriter Self
Definition: sitkImageSeriesWriter.h:49
sitkImage.h
itk::simple::ImageSeriesWriter::MemberFunctionType
Self &(Self::* MemberFunctionType)(const Image &)
Definition: sitkImageSeriesWriter.h:98
itk::simple::ioutils::GetRegisteredImageIOs
SITKIO_HIDDEN std::vector< std::string > GetRegisteredImageIOs()
sitkMemberFunctionFactory.h
sitkProcessObject.h
sitkMacro.h
itk::simple::ImageSeriesWriter::UseCompressionOn
Self & UseCompressionOn(void)
Enable compression if available for file type.
Definition: sitkImageSeriesWriter.h:74
itk::simple::ImageSeriesWriter::m_MemberFactory
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkImageSeriesWriter.h:102
itk::simple::ImageSeriesWriter::UseCompressionOff
Self & UseCompressionOff(void)
Enable compression if available for file type.
Definition: sitkImageSeriesWriter.h:75
itk
itk::simple::ImageSeriesWriter::m_UseCompression
bool m_UseCompression
Definition: sitkImageSeriesWriter.h:104
itk::simple::ProcessObject
Base class for SimpleITK classes based on ProcessObject.
Definition: sitkProcessObject.h:50
sitkIO.h
itk::simple::ImageSeriesWriter
Writer series of image from a SimpleITK image.
Definition: sitkImageSeriesWriter.h:45
itk::simple::ImageSeriesWriter::m_FileNames
std::vector< std::string > m_FileNames
Definition: sitkImageSeriesWriter.h:105