Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkCoreObjectFactory.h
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 #ifndef mitkCoreObjectFactory_h
14 #define mitkCoreObjectFactory_h
15 
16 #include <set>
17 
20 #include <MitkCoreExports.h>
21 namespace mitk
22 {
23  class Event;
24  class LegacyFileReaderService;
25  class LegacyFileWriterService;
26  class LegacyImageWriterService;
27 
29  {
30  public:
32  itkFactorylessNewMacro(CoreObjectFactory);
33 
34  Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
35  void SetDefaultProperties(mitk::DataNode *node) override;
36 
37  virtual void MapEvent(const mitk::Event *event, const int eventID);
38 
39  virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
40  virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
41 
42  static Pointer GetInstance();
43 
44  ~CoreObjectFactory() override;
45 
54  DEPRECATED(virtual std::string GetFileExtensions() override);
55 
62  DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
63 
72  DEPRECATED(virtual std::string GetSaveFileExtensions() override);
73 
80  MultimapType GetSaveFileExtensionsMap() override;
81 
85  DEPRECATED(virtual FileWriterList GetFileWriters());
86 
90  DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
91 
92  protected:
94 
105  void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
106 
111  void CreateFileExtensionsMap();
112 
116  DEPRECATED(void CreateSaveFileExtensions());
117 
118  typedef std::set<mitk::CoreObjectFactoryBase::Pointer> ExtraFactoriesContainer;
119 
121  FileWriterList m_FileWriters;
122  std::string m_FileExtensions;
124  std::string m_SaveFileExtensions;
126 
127  private:
128  void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
129  void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
130 
131  void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
132  void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
133 
134  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
135  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
136  };
137 
138 } // namespace mitk
139 
140 #endif
mitk::CoreObjectFactory::m_FileExtensionsMap
MultimapType m_FileExtensionsMap
Definition: mitkCoreObjectFactory.h:123
mitk::CoreObjectFactory::m_FileExtensions
std::string m_FileExtensions
Definition: mitkCoreObjectFactory.h:122
DEPRECATED
#define DEPRECATED(func)
Definition: mitkCommon.h:175
itk::SmartPointer< Self >
mitk::CoreObjectFactory::m_SaveFileExtensionsMap
MultimapType m_SaveFileExtensionsMap
Definition: mitkCoreObjectFactory.h:125
mitk::CoreObjectFactory::m_ExtraFactories
ExtraFactoriesContainer m_ExtraFactories
Definition: mitkCoreObjectFactory.h:120
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::CoreObjectFactory::m_FileWriters
FileWriterList m_FileWriters
Definition: mitkCoreObjectFactory.h:121
mitk::CoreObjectFactory::m_SaveFileExtensions
std::string m_SaveFileExtensions
Definition: mitkCoreObjectFactory.h:124
MitkCoreExports.h
mitkFileWriterWithInformation.h
mitk::CoreObjectFactory::ExtraFactoriesContainer
std::set< mitk::CoreObjectFactoryBase::Pointer > ExtraFactoriesContainer
Definition: mitkCoreObjectFactory.h:118
mitk::CoreObjectFactory
Definition: mitkCoreObjectFactory.h:28
mitkCoreObjectFactoryBase.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MapperSlotId
unsigned int MapperSlotId
Definition: mitkCommon.h:29
mitk::CoreObjectFactoryBase
Definition: mitkCoreObjectFactoryBase.h:37
mitk::CoreObjectFactoryBase::MultimapType
std::multimap< std::string, std::string > MultimapType
Definition: mitkCoreObjectFactoryBase.h:41
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.