Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkPointSetWriterFactory.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include "itkCreateObjectFunction.h"
16 #include "itkVersion.h"
17 
18 #include "mitkPointSetWriter.h"
19 
20 namespace mitk
21 {
22  template <class T>
23  class CreatePointSetWriter : public itk::CreateObjectFunctionBase
24  {
25  public:
27  typedef CreatePointSetWriter Self;
28  typedef itk::SmartPointer<Self> Pointer;
29 
31  itkFactorylessNewMacro(Self);
32  LightObject::Pointer CreateObject() override
33  {
34  typename T::Pointer p = T::New();
35  p->Register();
36  return p.GetPointer();
37  }
38 
39  protected:
40  CreatePointSetWriter() {}
41  ~CreatePointSetWriter() override {}
42  private:
43  CreatePointSetWriter(const Self &); // purposely not implemented
44  void operator=(const Self &); // purposely not implemented
45  };
46 
48  {
49  this->RegisterOverride(
50  "IOWriter", "PointSetWriter", "Point-Set Writer", true, mitk::CreatePointSetWriter<mitk::PointSetWriter>::New());
51  }
52 
54  const char *PointSetWriterFactory::GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
55  const char *PointSetWriterFactory::GetDescription() const { return "PointSetWriterFactory"; }
56 } // end namespace mitk
const char * GetITKSourceVersion(void) const override
DataCollection - Class to facilitate loading/accessing structured data.
const char * GetDescription(void) const override