-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvtkProstateNavLogic.h
More file actions
180 lines (124 loc) · 4.73 KB
/
Copy pathvtkProstateNavLogic.h
File metadata and controls
180 lines (124 loc) · 4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*=auto=========================================================================
Portions (c) Copyright 2007 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: $
Date: $Date: $
Version: $Revision: $
=========================================================================auto=*/
// .NAME vtkProstateNavLogic - slicer logic class for Locator module
// .SECTION Description
// This class manages the logic associated with tracking device for
// IGT.
#ifndef __vtkProstateNavLogic_h
#define __vtkProstateNavLogic_h
#include "vtkProstateNavWin32Header.h"
#include "vtkKWTkUtilities.h"
#include "vtkSlicerBaseLogic.h"
#include "vtkSlicerModuleLogic.h"
#include "vtkSlicerApplication.h"
#include "vtkCallbackCommand.h"
#include "vtkMRMLFiducialListNode.h"
#include "vtkMRMLSliceNode.h"
#include "vtkMRMLProstateNavManagerNode.h"
class vtkProstateNavGUI;
class VTK_PROSTATENAV_EXPORT vtkProstateNavLogic : public vtkSlicerModuleLogic
{
public:
//BTX
enum
{ // Events
LocatorUpdateEvent = 50000,
StatusUpdateEvent = 50001,
};
//ETX
static vtkProstateNavLogic *New();
vtkTypeRevisionMacro(vtkProstateNavLogic,vtkObject);
vtkSetMacro( TimerOn, int );
void SetGUI(vtkProstateNavGUI* gui) { this->GUI = gui; };
vtkProstateNavGUI* GetGUI() { return this->GUI; };
void PrintSelf(ostream&, vtkIndent);
int Enter();
void TimerHandler();
int RobotStop();
int RobotMoveTo(float px, float py, float pz,
float nx, float ny, float nz,
float tx, float ty, float tz);
int RobotMoveTo(float position[3], float orientation[4]);
int RobotMoveTo();
int ScanStart();
int ScanPause();
int ScanStop();
//BTX
//Image* ReadCalibrationImage(const char* filename, int* width, int* height,
// std::vector<float>& position, std::vector<float>& orientation);
bool AddTargetToNeedle(std::string needleType, float* rasLocation, unsigned int & targetDescIndex);
// Description:
// Add volume to MRML scene and return the MRML node.
// If volumeType is specified, then the volume is also selected as the current Calibration
// targeting or verification volume.
vtkMRMLScalarVolumeNode *AddVolumeToScene(const char *fileName, VolumeType volumeType=VOL_GENERIC);
// Description:
// Set a specific role for a loaded volume.
int SelectVolumeInScene(vtkMRMLScalarVolumeNode* volumeNode, VolumeType volumeType);
// Description:
// Show/hide robot workspace. Returns with 0 in case of failure.
int ShowWorkspaceModel(bool show);
bool IsWorkspaceModelShown();
// Description:
// Show/hide robot. Returns with 0 in case of failure.
int ShowRobotModel(bool show);
bool IsRobotModelShown();
// Description:
// Switch mouse interaction mode to activate target placement
// by clicking on the image
// vtkMRMLInteractionNode::Place = place fiducials
// vtkMRMLInteractionNode::ViewTransform = rotate scene
// Return value: zero if an error occurred
int SetMouseInteractionMode(int mode);
// Description:
// Select the current fidicual list in the Fiducial module
// If the user clicks on the image in Place interaction mode, then fiducials will be added to the current fiducial list.
int SetCurrentFiducialList(vtkMRMLFiducialListNode* fidNode);
//ETX
void UpdateTargetListFromMRML();
// Description:
// Set Slicers's 2D view orientations from the image orientation.
void SetSliceViewFromVolume(vtkMRMLVolumeNode *volumeNode);
protected:
//BTX
std::string GetFoRStrFromVolumeNodeID(const char* volNodeID);
//ETX
// Description:
// Link targets to fiducials (when no FiducialIDs are available), based on fiducial position and label
void LinkTargetsToFiducials();
// Description:
// Helper method for loading a volume via the Volume module.
vtkMRMLScalarVolumeNode *AddArchetypeVolume(const char* fileName, const char *volumeName);
void UpdateAll();
vtkProstateNavLogic();
~vtkProstateNavLogic();
vtkProstateNavLogic(const vtkProstateNavLogic&);
void operator=(const vtkProstateNavLogic&);
static void DataCallback(vtkObject*, unsigned long, void *, void *);
/*
void UpdateAll();
void UpdateSliceDisplay();
void UpdateLocator();
*/
vtkCallbackCommand *DataCallbackCommand;
private:
int GetTargetIndexFromFiducialID(const char* fiducialID);
int CreateCoverageVolume();
void DeleteCoverageVolume();
int UpdateCoverageVolumeImage();
vtkMRMLRobotNode* GetRobotNode();
vtkProstateNavGUI* GUI;
/*
bool Connected;
bool RealtimeImageUpdate;
*/
int TimerOn;
};
#endif