MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkIGTL3DImageDeviceSource.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14
15#include "mitkIGTLMessage.h"
16
17//Microservices
18#include <usGetModuleContext.h>
19#include <usModule.h>
20#include <usServiceProperties.h>
21#include <usModuleContext.h>
22
23//itk
24#include <itkCommand.h>
25
28{
29 this->SetName("IGTLDeviceSource (2D Images)");
30}
31
35
37{
38 if (m_IGTLDevice.IsNull())
39 return;
40
41 /* update output with message from the device */
42 IGTLMessage* msgOut = this->GetOutput();
43 assert(msgOut);
44 igtl::MessageBase::Pointer msgIn = dynamic_cast<igtl::MessageBase*>(m_IGTLDevice->GetNextImage3dMessage().GetPointer());
45 if (msgIn.IsNotNull())
46 {
47 assert(msgIn);
48
49 msgOut->SetMessage(msgIn);
50 msgOut->SetName(msgIn->GetDeviceName());
51 }
52}
void GenerateData() override
filter execute method
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
A wrapper for the OpenIGTLink message type.
void SetMessage(igtl::MessageBase::Pointer msg)
Sets the OpenIGTLink message.
IGT Exceptions.