Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkMultilabelActivator.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 
13 #include <usGetModuleContext.h>
14 #include <usModule.h>
15 #include <usModuleActivator.h>
16 #include <usModuleContext.h>
17 
18 #include "mitkLabelSetImageIO.h"
19 
20 namespace mitk
21 {
25  class MultilabelIOModuleActivator : public us::ModuleActivator
26  {
27  std::vector<AbstractFileIO *> m_FileIOs;
28 
29  public:
30  void Load(us::ModuleContext * /*context*/) override
31  {
32  m_FileIOs.push_back(new LabelSetImageIO());
33  }
34  void Unload(us::ModuleContext *) override
35  {
36  for (auto &elem : m_FileIOs)
37  {
38  delete elem;
39  }
40  }
41  };
42 }
43 
44 US_EXPORT_MODULE_ACTIVATOR(mitk::MultilabelIOModuleActivator)
DataCollection - Class to facilitate loading/accessing structured data.
virtual void Unload(ModuleContext *context)=0
#define US_EXPORT_MODULE_ACTIVATOR(_activator_type)
Export a module activator class.
virtual void Load(ModuleContext *context)=0