Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMAPRegistrationWrapperObjectFactory.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 
18 
19 #include <mitkProperties.h>
20 #include <mitkBaseRenderer.h>
21 #include <mitkDataNode.h>
22 
26 
27 typedef std::multimap<std::string, std::string> MultimapType;
28 
31 {
32  static bool alreadyDone = false;
33  if (!alreadyDone)
34  {
35  MITK_INFO << "MAPRegistrationWrapperObjectFactory c'tor" << std::endl;
36 
37  alreadyDone = true;
38  }
39 
40 }
41 
43 {
44 }
45 
49 {
50  mitk::Mapper::Pointer newMapper=NULL;
51 
52  if ( slotId == mitk::BaseRenderer::Standard2D )
53  {
54  std::string classname("MAPRegistrationWrapper");
55  if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0)
56  {
58  newMapper->SetDataNode(node);
59  }
60  }
61  else if ( slotId == mitk::BaseRenderer::Standard3D )
62  {
63  std::string classname("MAPRegistrationWrapper");
64  if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0)
65  {
67  newMapper->SetDataNode(node);
68  }
69  }
70 
71  return newMapper;
72 };
73 
75 {
76  if(node==NULL)
77  return;
78 
79  mitk::DataNode::Pointer nodePointer = node;
80 
81  if(node->GetData() ==NULL)
82  return;
83 
84  if( dynamic_cast<mitk::MAPRegistrationWrapper*>(node->GetData())!=NULL )
85  {
87  }
88 }
89 
91 {
92  std::string fileExtension;
93  this->CreateFileExtensions(m_FileExtensionsMap, fileExtension);
94  return fileExtension.c_str();
95 };
96 
98 {
99  return m_FileExtensionsMap;
100 }
101 
103 {
104  std::string fileExtension;
105  this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension);
106  return fileExtension.c_str();
107 }
108 
110 {
111  return m_SaveFileExtensionsMap;
112 }
113 
114 struct RegisterMAPRegistrationWrapperObjectFactoryHelper{
115  RegisterMAPRegistrationWrapperObjectFactoryHelper()
116  : m_Factory( mitk::MAPRegistrationWrapperObjectFactory::New() )
117  {
118  mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory( m_Factory );
119  }
120 
121  ~RegisterMAPRegistrationWrapperObjectFactoryHelper()
122  {
123  mitk::CoreObjectFactory::GetInstance()->UnRegisterExtraFactory( m_Factory );
124  }
125 
127 };
128 
129 static RegisterMAPRegistrationWrapperObjectFactoryHelper registerMITKRegistrationWrapperIOFactoryHelper;
std::multimap< std::string, std::string > MultimapType
#define MITK_INFO
Definition: mitkLogMacros.h:22
virtual mitk::Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId)
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=NULL, bool overwrite=false)
virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap()
virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap()
DataCollection - Class to facilitate loading/accessing structured data.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
static RegisterMAPRegistrationWrapperObjectFactoryHelper registerMITKRegistrationWrapperIOFactoryHelper
unsigned int MapperSlotId
Definition: mitkCommon.h:37
std::multimap< std::string, std::string > MultimapType
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.