Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkImageWriterFactory.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkImageWriterFactory.h"
18 
19 #include "itkCreateObjectFunction.h"
20 #include "itkVersion.h"
21 
22 #include "mitkImageWriter.h"
23 
24 namespace mitk
25 {
26  template <class T>
27  class CreateImageWriter : public itk::CreateObjectFunctionBase
28  {
29  public:
31  typedef CreateImageWriter Self;
33 
35  itkFactorylessNewMacro(Self);
36  LightObject::Pointer CreateObject() override
37  {
38  typename T::Pointer p = T::New();
39  p->Register();
40  return p.GetPointer();
41  }
42 
43  protected:
44  CreateImageWriter() {}
45  ~CreateImageWriter() {}
46  private:
47  CreateImageWriter(const Self &); // purposely not implemented
48  void operator=(const Self &); // purposely not implemented
49  };
50 
52  {
53  this->RegisterOverride(
54  "IOWriter", "ImageWriter", "Image Writer", 1, mitk::CreateImageWriter<mitk::ImageWriter>::New());
55  }
56 
58  const char *ImageWriterFactory::GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
59  const char *ImageWriterFactory::GetDescription() const { return "ImageWriterFactory"; }
60 } // end namespace mitk
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
virtual const char * GetDescription(void) const override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.