~ubuntu-branches/ubuntu/lucid/igstk/lucid

« back to all changes in this revision

Viewing changes to Source/igstkReslicerPlaneSpatialObject.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Dominique Belhachemi
  • Date: 2009-10-07 17:35:43 UTC
  • mfrom: (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091007173543-69eyhyjrh0bfoqe5
Tags: 4.2.0-2
* Fixed link issue (Closes: #549799)
* switch to quilt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Image Guided Surgery Software Toolkit
 
4
  Module:    $RCSfile: igstkReslicerPlaneSpatialObject.cxx,v $
 
5
  Language:  C++
 
6
  Date:      $Date: 2009-06-17 14:40:23 $
 
7
  Version:   $Revision: 1.3 $
 
8
 
 
9
  Copyright (c) ISC  Insight Software Consortium.  All rights reserved.
 
10
  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
 
11
 
 
12
     This software is distributed WITHOUT ANY WARRANTY; without even
 
13
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
14
     PURPOSE.  See the above copyright notices for more information.
 
15
 
 
16
=========================================================================*/
 
17
 
 
18
#ifndef __igstkReslicerPlaneSpatialObject_cxx
 
19
#define __igstkReslicerPlaneSpatialObject_cxx
 
20
 
 
21
#include "igstkReslicerPlaneSpatialObject.h"
 
22
#include "igstkEvents.h"
 
23
 
 
24
#include "vtkPlaneSource.h"
 
25
#include "vtkPlane.h"
 
26
#include "vtkMath.h"
 
27
#include "vtkTransform.h"
 
28
 
 
29
namespace igstk
 
30
 
31
 
 
32
/** Constructor */
 
33
ReslicerPlaneSpatialObject
 
34
::ReslicerPlaneSpatialObject():m_StateMachine(this)
 
35
{
 
36
  //Default reslicing mode
 
37
  m_ReslicingMode = Orthogonal;
 
38
 
 
39
  //Default orientation type
 
40
  m_OrientationType = Axial;
 
41
 
 
42
  m_BoundingBoxProviderSpatialObject = NULL;
 
43
  m_ToolSpatialObject = NULL; 
 
44
 
 
45
  //tool spatial object check flag
 
46
  m_ToolSpatialObjectSet  = false;
 
47
 
 
48
  //Cursor position 
 
49
  m_CursorPosition[0] = 0;
 
50
  m_CursorPosition[1] = 0;
 
51
  m_CursorPosition[2] = 0;
 
52
 
 
53
  //tool position 
 
54
  m_ToolPosition[0] = 0;
 
55
  m_ToolPosition[1] = 0;
 
56
  m_ToolPosition[2] = 0;
 
57
 
 
58
  m_CursorPositionSetFlag = false;
 
59
 
 
60
  //List of states
 
61
  igstkAddStateMacro( Initial );
 
62
  igstkAddStateMacro( ReslicingModeSet );
 
63
  igstkAddStateMacro( OrientationTypeSet );
 
64
  igstkAddStateMacro( BoundingBoxProviderSpatialObjectSet );
 
65
  igstkAddStateMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem );
 
66
  igstkAddStateMacro( AttemptingToSetCursorPosition );
 
67
  igstkAddStateMacro( AttemptingToSetBoundingBoxProviderSpatialObject );
 
68
 
 
69
  // List of state machine inputs
 
70
  igstkAddInputMacro( SetBoundingBoxProviderSpatialObject );
 
71
  igstkAddInputMacro( ValidReslicingMode );
 
72
  igstkAddInputMacro( InValidReslicingMode );
 
73
  igstkAddInputMacro( ValidOrientationType );
 
74
  igstkAddInputMacro( InValidOrientationType );
 
75
  igstkAddInputMacro( ValidBoundingBoxProviderSpatialObject );
 
76
  igstkAddInputMacro( InValidBoundingBoxProviderSpatialObject );
 
77
  igstkAddInputMacro( ValidToolSpatialObject );
 
78
  igstkAddInputMacro( InValidToolSpatialObject );  
 
79
  igstkAddInputMacro( SetCursorPosition );
 
80
  igstkAddInputMacro( ValidCursorPosition );
 
81
  igstkAddInputMacro( InValidCursorPosition );
 
82
  igstkAddInputMacro( GetToolPosition );
 
83
  igstkAddInputMacro( GetReslicingPlaneParameters );
 
84
  igstkAddInputMacro( GetToolTransformWRTImageCoordinateSystem );
 
85
  igstkAddInputMacro( ToolTransformWRTImageCoordinateSystem );
 
86
  igstkAddInputMacro( ComputeReslicePlane );
 
87
 
 
88
 
 
89
  // List of state machine transitions
 
90
 
 
91
  //From Initial
 
92
  igstkAddTransitionMacro( Initial, ValidReslicingMode, 
 
93
                           ReslicingModeSet, SetReslicingMode );
 
94
 
 
95
  igstkAddTransitionMacro( Initial, InValidReslicingMode, 
 
96
                           Initial, ReportInvalidReslicingMode );
 
97
 
 
98
  igstkAddTransitionMacro( Initial, SetBoundingBoxProviderSpatialObject, 
 
99
                           Initial, ReportInvalidRequest);
 
100
 
 
101
  igstkAddTransitionMacro( Initial, ValidOrientationType, 
 
102
                           Initial, ReportInvalidRequest);
 
103
 
 
104
  igstkAddTransitionMacro( Initial, InValidOrientationType, 
 
105
                           Initial, ReportInvalidRequest);  
 
106
 
 
107
  igstkAddTransitionMacro( Initial, ValidBoundingBoxProviderSpatialObject, 
 
108
                           Initial, ReportInvalidRequest);  
 
109
 
 
110
  igstkAddTransitionMacro( Initial, InValidBoundingBoxProviderSpatialObject, 
 
111
                           Initial, ReportInvalidRequest);
 
112
 
 
113
  igstkAddTransitionMacro( Initial, ValidToolSpatialObject, 
 
114
                           Initial, ReportInvalidRequest);  
 
115
 
 
116
  igstkAddTransitionMacro( Initial, InValidToolSpatialObject, 
 
117
                           Initial, ReportInvalidRequest);  
 
118
 
 
119
  igstkAddTransitionMacro( Initial, SetCursorPosition, 
 
120
                           Initial, ReportInvalidRequest);
 
121
 
 
122
  igstkAddTransitionMacro( Initial, ValidCursorPosition, 
 
123
                           Initial, ReportInvalidRequest);
 
124
 
 
125
  igstkAddTransitionMacro( Initial, InValidCursorPosition, 
 
126
                           Initial, ReportInvalidRequest);
 
127
 
 
128
  igstkAddTransitionMacro( Initial, GetToolPosition, 
 
129
                           Initial, ReportInvalidRequest);
 
130
 
 
131
  igstkAddTransitionMacro( Initial, GetReslicingPlaneParameters, 
 
132
                           Initial, ReportInvalidRequest);
 
133
 
 
134
  igstkAddTransitionMacro( Initial, GetToolTransformWRTImageCoordinateSystem, 
 
135
                           Initial, ReportInvalidRequest);
 
136
 
 
137
  igstkAddTransitionMacro( Initial, ToolTransformWRTImageCoordinateSystem, 
 
138
                           Initial, ReportInvalidRequest);
 
139
 
 
140
  igstkAddTransitionMacro( Initial, ComputeReslicePlane, 
 
141
                           Initial, ReportInvalidRequest);
 
142
 
 
143
  //From ReslicingModeSet
 
144
  igstkAddTransitionMacro( ReslicingModeSet, ValidOrientationType, 
 
145
                           OrientationTypeSet, SetOrientationType );
 
146
 
 
147
  igstkAddTransitionMacro( ReslicingModeSet, InValidOrientationType, 
 
148
                           ReslicingModeSet, ReportInvalidOrientationType);
 
149
 
 
150
  igstkAddTransitionMacro( ReslicingModeSet, SetCursorPosition, 
 
151
                           ReslicingModeSet, ReportInvalidRequest );  
 
152
 
 
153
  igstkAddTransitionMacro( ReslicingModeSet, 
 
154
                           SetBoundingBoxProviderSpatialObject,
 
155
                           ReslicingModeSet, 
 
156
                           ReportInvalidRequest);
 
157
 
 
158
  igstkAddTransitionMacro( ReslicingModeSet, 
 
159
                           ValidBoundingBoxProviderSpatialObject, 
 
160
                           ReslicingModeSet, 
 
161
                           ReportInvalidRequest);  
 
162
 
 
163
  igstkAddTransitionMacro( ReslicingModeSet, 
 
164
                           InValidBoundingBoxProviderSpatialObject, 
 
165
                           ReslicingModeSet, ReportInvalidRequest);
 
166
 
 
167
  igstkAddTransitionMacro( ReslicingModeSet, ValidToolSpatialObject, 
 
168
                           ReslicingModeSet, ReportInvalidRequest);  
 
169
 
 
170
  igstkAddTransitionMacro( ReslicingModeSet, InValidToolSpatialObject, 
 
171
                           ReslicingModeSet, ReportInvalidRequest);  
 
172
 
 
173
  igstkAddTransitionMacro( ReslicingModeSet, ValidCursorPosition, 
 
174
                           ReslicingModeSet, ReportInvalidRequest);
 
175
 
 
176
  igstkAddTransitionMacro( ReslicingModeSet, InValidCursorPosition, 
 
177
                           ReslicingModeSet, ReportInvalidRequest);
 
178
 
 
179
  igstkAddTransitionMacro( ReslicingModeSet, GetToolPosition, 
 
180
                           ReslicingModeSet, ReportInvalidRequest);
 
181
 
 
182
  igstkAddTransitionMacro( ReslicingModeSet, GetReslicingPlaneParameters, 
 
183
                           ReslicingModeSet, ReportInvalidRequest);
 
184
 
 
185
  igstkAddTransitionMacro( ReslicingModeSet, 
 
186
                           GetToolTransformWRTImageCoordinateSystem, 
 
187
                           ReslicingModeSet, ReportInvalidRequest);
 
188
 
 
189
  igstkAddTransitionMacro( ReslicingModeSet, 
 
190
                           ToolTransformWRTImageCoordinateSystem, 
 
191
                           ReslicingModeSet, ReportInvalidRequest);
 
192
 
 
193
  igstkAddTransitionMacro( ReslicingModeSet, ComputeReslicePlane, 
 
194
                           ReslicingModeSet, ReportInvalidRequest);
 
195
 
 
196
  //From OrientationTypeSet
 
197
  igstkAddTransitionMacro( OrientationTypeSet, 
 
198
                           SetBoundingBoxProviderSpatialObject,
 
199
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
200
                           AttemptSetBoundingBoxProviderSpatialObject );
 
201
 
 
202
  igstkAddTransitionMacro( OrientationTypeSet, SetCursorPosition, 
 
203
                           OrientationTypeSet, ReportInvalidRequest );
 
204
 
 
205
  igstkAddTransitionMacro( OrientationTypeSet, ValidOrientationType, 
 
206
                           OrientationTypeSet, SetOrientationType );
 
207
 
 
208
  igstkAddTransitionMacro( OrientationTypeSet, InValidOrientationType, 
 
209
                           OrientationTypeSet, ReportInvalidOrientationType);
 
210
 
 
211
  igstkAddTransitionMacro( OrientationTypeSet, 
 
212
                           ValidBoundingBoxProviderSpatialObject, 
 
213
                           OrientationTypeSet, ReportInvalidRequest);  
 
214
 
 
215
  igstkAddTransitionMacro( OrientationTypeSet, 
 
216
                           InValidBoundingBoxProviderSpatialObject, 
 
217
                           OrientationTypeSet, ReportInvalidRequest);
 
218
 
 
219
  igstkAddTransitionMacro( OrientationTypeSet, ValidToolSpatialObject, 
 
220
                           OrientationTypeSet, ReportInvalidRequest);  
 
221
 
 
222
  igstkAddTransitionMacro( OrientationTypeSet, InValidToolSpatialObject, 
 
223
                           OrientationTypeSet, ReportInvalidRequest);  
 
224
 
 
225
  igstkAddTransitionMacro( OrientationTypeSet, ValidCursorPosition, 
 
226
                           OrientationTypeSet, ReportInvalidRequest);
 
227
 
 
228
  igstkAddTransitionMacro( OrientationTypeSet, InValidCursorPosition, 
 
229
                           OrientationTypeSet, ReportInvalidRequest);
 
230
 
 
231
  igstkAddTransitionMacro( OrientationTypeSet, GetToolPosition, 
 
232
                           OrientationTypeSet, ReportInvalidRequest);
 
233
 
 
234
  igstkAddTransitionMacro( OrientationTypeSet, GetReslicingPlaneParameters, 
 
235
                           OrientationTypeSet, ReportInvalidRequest);
 
236
 
 
237
  igstkAddTransitionMacro( OrientationTypeSet, 
 
238
                           GetToolTransformWRTImageCoordinateSystem, 
 
239
                           OrientationTypeSet, ReportInvalidRequest);
 
240
 
 
241
  igstkAddTransitionMacro( OrientationTypeSet, 
 
242
                           ToolTransformWRTImageCoordinateSystem, 
 
243
                           OrientationTypeSet, ReportInvalidRequest);
 
244
 
 
245
  igstkAddTransitionMacro( OrientationTypeSet, ComputeReslicePlane, 
 
246
                           OrientationTypeSet, ReportInvalidRequest);
 
247
 
 
248
 
 
249
  // From AttemptingToSetBoundingBoxProviderSpatialObject
 
250
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
251
                           ValidBoundingBoxProviderSpatialObject,
 
252
                           BoundingBoxProviderSpatialObjectSet,  
 
253
                           SetBoundingBoxProviderSpatialObject ); 
 
254
 
 
255
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
256
                           InValidBoundingBoxProviderSpatialObject,
 
257
                           OrientationTypeSet,  
 
258
                           ReportInvalidBoundingBoxProviderSpatialObject );
 
259
 
 
260
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
261
                           SetBoundingBoxProviderSpatialObject,
 
262
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
263
                           ReportInvalidRequest );
 
264
 
 
265
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
266
                           SetCursorPosition, 
 
267
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
268
                           ReportInvalidRequest );
 
269
 
 
270
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
271
                           ValidOrientationType, 
 
272
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
273
                           ReportInvalidRequest );
 
274
 
 
275
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
276
                           InValidOrientationType, 
 
277
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
278
                           ReportInvalidRequest);
 
279
 
 
280
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
281
                           ValidBoundingBoxProviderSpatialObject, 
 
282
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
283
                           ReportInvalidRequest);  
 
284
 
 
285
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
286
                           InValidBoundingBoxProviderSpatialObject, 
 
287
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
288
                           ReportInvalidRequest);
 
289
 
 
290
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
291
                           ValidToolSpatialObject, 
 
292
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
293
                           ReportInvalidRequest);  
 
294
 
 
295
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
296
                           InValidToolSpatialObject, 
 
297
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
298
                           ReportInvalidRequest);  
 
299
 
 
300
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
301
                           ValidCursorPosition, 
 
302
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
303
                           ReportInvalidRequest);
 
304
 
 
305
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
306
                           InValidCursorPosition, 
 
307
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
308
                           ReportInvalidRequest);
 
309
 
 
310
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
311
                           GetToolPosition, 
 
312
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
313
                           ReportInvalidRequest);
 
314
 
 
315
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
316
                           GetReslicingPlaneParameters, 
 
317
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
318
                           ReportInvalidRequest);
 
319
 
 
320
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
321
                           GetToolTransformWRTImageCoordinateSystem, 
 
322
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
323
                           ReportInvalidRequest);
 
324
 
 
325
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
326
                           ToolTransformWRTImageCoordinateSystem, 
 
327
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
328
                           ReportInvalidRequest);
 
329
 
 
330
  igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject, 
 
331
                           ComputeReslicePlane, 
 
332
                           AttemptingToSetBoundingBoxProviderSpatialObject, 
 
333
                           ReportInvalidRequest);
 
334
 
 
335
  //From BoundingBoxProviderSpatialObjectSet
 
336
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
337
                           ValidOrientationType,
 
338
                           BoundingBoxProviderSpatialObjectSet, 
 
339
                           SetOrientationType );
 
340
 
 
341
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
342
                           InValidOrientationType,
 
343
                           BoundingBoxProviderSpatialObjectSet, 
 
344
                           ReportInvalidOrientationType );
 
345
 
 
346
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
347
                           ValidReslicingMode, 
 
348
                           BoundingBoxProviderSpatialObjectSet, 
 
349
                           SetReslicingMode );
 
350
 
 
351
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
352
                           InValidReslicingMode, 
 
353
                           BoundingBoxProviderSpatialObjectSet, 
 
354
                           ReportInvalidReslicingMode );
 
355
 
 
356
  //  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
357
  //                           ValidCursorPosition,
 
358
  //                           BoundingBoxProviderSpatialObjectSet,  
 
359
  //                           SetCursorPosition ); 
 
360
 
 
361
  //  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
362
  //                           InValidCursorPosition,
 
363
  //                           BoundingBoxProviderSpatialObjectSet,  
 
364
  //                           ReportInvalidCursorPosition );
 
365
 
 
366
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
367
                           ValidToolSpatialObject,
 
368
                           BoundingBoxProviderSpatialObjectSet, 
 
369
                           SetToolSpatialObject );
 
370
 
 
371
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
372
                           InValidToolSpatialObject,
 
373
                           BoundingBoxProviderSpatialObjectSet, 
 
374
                           ReportInvalidToolSpatialObject );  
 
375
 
 
376
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
377
                           SetCursorPosition,
 
378
                           AttemptingToSetCursorPosition, 
 
379
                           AttemptSetCursorPosition );  
 
380
 
 
381
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
382
                           ComputeReslicePlane,
 
383
                           BoundingBoxProviderSpatialObjectSet, 
 
384
                           ComputeReslicePlane );
 
385
 
 
386
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
387
                           GetToolPosition,
 
388
                           BoundingBoxProviderSpatialObjectSet, 
 
389
                           ReportToolPosition );
 
390
 
 
391
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
392
                           GetReslicingPlaneParameters,
 
393
                           BoundingBoxProviderSpatialObjectSet, 
 
394
                           ReportReslicingPlaneParameters );
 
395
 
 
396
  igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet, 
 
397
                           GetToolTransformWRTImageCoordinateSystem,
 
398
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
399
                           RequestGetToolTransformWRTImageCoordinateSystem );
 
400
 
 
401
  // From AttemptingToSetCursorPosition
 
402
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
403
                           ValidCursorPosition,
 
404
                           BoundingBoxProviderSpatialObjectSet, 
 
405
                           SetCursorPosition ); 
 
406
 
 
407
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
408
                           InValidCursorPosition,
 
409
                           BoundingBoxProviderSpatialObjectSet, 
 
410
                           ReportInvalidCursorPosition );
 
411
 
 
412
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
413
                           ValidBoundingBoxProviderSpatialObject,
 
414
                           AttemptingToSetCursorPosition, 
 
415
                           ReportInvalidRequest ); 
 
416
 
 
417
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
418
                           InValidBoundingBoxProviderSpatialObject,
 
419
                           AttemptingToSetCursorPosition, 
 
420
                           ReportInvalidRequest );
 
421
 
 
422
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
423
                           SetBoundingBoxProviderSpatialObject,
 
424
                           AttemptingToSetCursorPosition, 
 
425
                           ReportInvalidRequest );
 
426
 
 
427
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, SetCursorPosition, 
 
428
                           AttemptingToSetCursorPosition, 
 
429
                           ReportInvalidRequest );
 
430
 
 
431
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, ValidOrientationType, 
 
432
                           AttemptingToSetCursorPosition, 
 
433
                           ReportInvalidRequest );
 
434
 
 
435
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
436
                           InValidOrientationType, 
 
437
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
438
 
 
439
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
440
                           ValidBoundingBoxProviderSpatialObject, 
 
441
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
442
 
 
443
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
444
                           InValidBoundingBoxProviderSpatialObject, 
 
445
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
446
 
 
447
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
448
                           ValidToolSpatialObject, 
 
449
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
450
 
 
451
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
452
                           InValidToolSpatialObject, 
 
453
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
454
 
 
455
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, GetToolPosition, 
 
456
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
457
 
 
458
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
459
                           GetReslicingPlaneParameters, 
 
460
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
461
 
 
462
  igstkAddTransitionMacro( AttemptingToSetCursorPosition,
 
463
                           GetToolTransformWRTImageCoordinateSystem, 
 
464
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
465
 
 
466
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, 
 
467
                           ToolTransformWRTImageCoordinateSystem, 
 
468
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
469
 
 
470
  igstkAddTransitionMacro( AttemptingToSetCursorPosition, ComputeReslicePlane, 
 
471
                           AttemptingToSetCursorPosition, ReportInvalidRequest);
 
472
 
 
473
 
 
474
  // From AttemptingToGetToolTransformWRTImageCoordinateSystem
 
475
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
476
                           ToolTransformWRTImageCoordinateSystem,
 
477
                           BoundingBoxProviderSpatialObjectSet,
 
478
                           ReceiveToolTransformWRTImageCoordinateSystem );
 
479
 
 
480
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
481
                           ValidReslicingMode, 
 
482
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
483
                           SetReslicingMode );
 
484
 
 
485
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
486
                           InValidReslicingMode, 
 
487
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
488
                           ReportInvalidReslicingMode );
 
489
 
 
490
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
491
                           SetBoundingBoxProviderSpatialObject, 
 
492
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
493
                           ReportInvalidRequest);
 
494
 
 
495
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
496
                           ValidOrientationType, 
 
497
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
498
                           ReportInvalidRequest);
 
499
 
 
500
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
501
                           InValidOrientationType, 
 
502
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
503
                           ReportInvalidRequest);  
 
504
 
 
505
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
506
                           ValidBoundingBoxProviderSpatialObject, 
 
507
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
508
                           ReportInvalidRequest);  
 
509
 
 
510
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
511
                           InValidBoundingBoxProviderSpatialObject, 
 
512
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
513
                           ReportInvalidRequest);
 
514
 
 
515
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
516
                           ValidToolSpatialObject, 
 
517
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
518
                           ReportInvalidRequest);  
 
519
 
 
520
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
521
                           InValidToolSpatialObject, 
 
522
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
523
                           ReportInvalidRequest);  
 
524
 
 
525
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
526
                           SetCursorPosition, 
 
527
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
528
                           ReportInvalidRequest);
 
529
 
 
530
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
531
                           ValidCursorPosition, 
 
532
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
533
                           ReportInvalidRequest);
 
534
 
 
535
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
536
                           InValidCursorPosition, 
 
537
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
538
                           ReportInvalidRequest);
 
539
 
 
540
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
541
                           GetToolPosition, 
 
542
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
543
                           ReportInvalidRequest);
 
544
 
 
545
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
546
                           GetReslicingPlaneParameters, 
 
547
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
548
                           ReportInvalidRequest);
 
549
 
 
550
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
551
                           GetToolTransformWRTImageCoordinateSystem, 
 
552
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
553
                           ReportInvalidRequest);
 
554
 
 
555
  igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
556
                           ComputeReslicePlane, 
 
557
                           AttemptingToGetToolTransformWRTImageCoordinateSystem,
 
558
                           ReportInvalidRequest);
 
559
 
 
560
  igstkSetInitialStateMacro( Initial );
 
561
  this->m_StateMachine.SetReadyToRun();
 
562
 
563
 
 
564
/** Destructor */
 
565
ReslicerPlaneSpatialObject
 
566
::~ReslicerPlaneSpatialObject()  
 
567
{  
 
568
 
 
569
}
 
570
 
 
571
void 
 
572
ReslicerPlaneSpatialObject
 
573
::RequestSetReslicingMode( ReslicingMode reslicingMode )
 
574
{  
 
575
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
576
                       ::RequestSetReslicingMode called...\n");
 
577
 
 
578
  bool validReslicingMode = false;
 
579
 
 
580
  if( reslicingMode == Orthogonal )
 
581
    {
 
582
     validReslicingMode = true;
 
583
    }
 
584
 
 
585
  if( reslicingMode == OffOrthogonal )
 
586
    {
 
587
     validReslicingMode = true;
 
588
    }
 
589
 
 
590
  if( reslicingMode == Oblique )
 
591
    {
 
592
     validReslicingMode = true;
 
593
    }
 
594
 
 
595
  if ( validReslicingMode )
 
596
    {
 
597
    m_ReslicingModeToBeSet = reslicingMode;
 
598
    m_StateMachine.PushInput( m_ValidReslicingModeInput );
 
599
    }
 
600
  else
 
601
    {
 
602
    m_StateMachine.PushInput( m_InValidReslicingModeInput );
 
603
    }
 
604
 
 
605
  m_StateMachine.ProcessInputs();
 
606
}
 
607
 
 
608
/** Null Operation for a State Machine Transition */
 
609
void 
 
610
ReslicerPlaneSpatialObject
 
611
::NoProcessing()
 
612
{
 
613
}
 
614
 
 
615
void
 
616
ReslicerPlaneSpatialObject
 
617
::RequestGetToolPosition() 
 
618
{
 
619
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
620
                        ::RequestGetToolPosition called...\n");
 
621
 
 
622
  igstkPushInputMacro( GetToolPosition );
 
623
  m_StateMachine.ProcessInputs();
 
624
}
 
625
 
 
626
void
 
627
ReslicerPlaneSpatialObject
 
628
::RequestGetReslicingPlaneParameters() 
 
629
{
 
630
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
631
                        ::RequestGetReslicingPlaneParameters called...\n");
 
632
 
 
633
  igstkPushInputMacro( GetReslicingPlaneParameters );
 
634
  m_StateMachine.ProcessInputs();
 
635
}
 
636
 
 
637
void
 
638
ReslicerPlaneSpatialObject
 
639
::ReportToolPositionProcessing() 
 
640
{
 
641
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
642
                        ::ReportToolPositionProcessing called...\n");
 
643
 
 
644
  ToolTipPositionEvent event;
 
645
  event.Set( m_ToolPosition );
 
646
  this->InvokeEvent( event );
 
647
}
 
648
 
 
649
ReslicerPlaneSpatialObject::ReslicingMode 
 
650
ReslicerPlaneSpatialObject
 
651
::GetReslicingMode() const
 
652
 
653
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
654
                        ::GetReslicingMode called...\n");
 
655
 
 
656
  return m_ReslicingMode; 
 
657
}
 
658
 
 
659
ReslicerPlaneSpatialObject::OrientationType
 
660
ReslicerPlaneSpatialObject
 
661
::GetOrientationType() const
 
662
 
663
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
664
                        ::GetOrientationType called...\n");
 
665
 
 
666
  return m_OrientationType; 
 
667
}
 
668
 
 
669
void
 
670
ReslicerPlaneSpatialObject
 
671
::ReportReslicingPlaneParametersProcessing() 
 
672
{
 
673
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
674
                       ::ReportReslicingPlaneParametersProcessing called...\n");
 
675
 
 
676
  ReslicerPlaneCenterEvent pcEvent;
 
677
  pcEvent.Set( m_PlaneCenter );
 
678
  this->InvokeEvent( pcEvent );
 
679
 
 
680
  ReslicerPlaneNormalEvent pnEvent;
 
681
  pnEvent.Set( m_PlaneNormal );
 
682
  this->InvokeEvent( pnEvent );
 
683
 
 
684
}
 
685
 
 
686
void 
 
687
ReslicerPlaneSpatialObject
 
688
::RequestSetCursorPosition( const double *point )
 
689
{  
 
690
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
691
                       ::RequestSetCursorPosition called...\n");
 
692
 
 
693
  m_CursorPositionToBeSet[0] = point[0];
 
694
  m_CursorPositionToBeSet[1] = point[1];
 
695
  m_CursorPositionToBeSet[2] = point[2];
 
696
 
 
697
  m_StateMachine.PushInput( m_SetCursorPositionInput );
 
698
 
 
699
  m_StateMachine.ProcessInputs();
 
700
}
 
701
 
 
702
void 
 
703
ReslicerPlaneSpatialObject
 
704
::AttemptSetCursorPositionProcessing()
 
705
{
 
706
 
 
707
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
708
                        ::AttemptSetCursorPositionProcessing called...\n");
 
709
 
 
710
  bool validPosition = false; 
 
711
 
 
712
  switch( m_OrientationType )
 
713
    {
 
714
    case Axial:
 
715
      if( m_CursorPositionToBeSet[2] >= m_Bounds[4] && 
 
716
          m_CursorPositionToBeSet[2] <= m_Bounds[5] )
 
717
        {
 
718
        validPosition = true;
 
719
        }
 
720
        break;
 
721
    case Sagittal:
 
722
      if( m_CursorPositionToBeSet[0] >= m_Bounds[0] && 
 
723
          m_CursorPositionToBeSet[0] <= m_Bounds[1] )
 
724
        {
 
725
        validPosition = true;
 
726
        }
 
727
      break;
 
728
    case Coronal:
 
729
      if( m_CursorPositionToBeSet[1] >= m_Bounds[2] && 
 
730
          m_CursorPositionToBeSet[1] <= m_Bounds[3] )
 
731
        {
 
732
        validPosition = true;
 
733
        }
 
734
      break;
 
735
    default:
 
736
      {
 
737
      validPosition = false;
 
738
      }
 
739
    }
 
740
 
 
741
  if( validPosition )
 
742
    {
 
743
    igstkPushInputMacro( ValidCursorPosition );
 
744
    }
 
745
  else
 
746
    {
 
747
    igstkPushInputMacro( InValidCursorPosition );
 
748
    }
 
749
 
 
750
  m_StateMachine.ProcessInputs();
 
751
}
 
752
 
 
753
void 
 
754
ReslicerPlaneSpatialObject
 
755
::SetCursorPositionProcessing()
 
756
{
 
757
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
 
758
                        ::SetCursorPosition called...\n");
 
759
 
 
760
  m_CursorPosition[0] = m_CursorPositionToBeSet[0];
 
761
  m_CursorPosition[1] = m_CursorPositionToBeSet[1];
 
762
  m_CursorPosition[2] = m_CursorPositionToBeSet[2];
 
763
 
 
764
  m_ToolPosition[0] = m_CursorPosition[0];
 
765
  m_ToolPosition[1] = m_CursorPosition[1];
 
766
  m_ToolPosition[2] = m_CursorPosition[2];
 
767
 
 
768
  //turn on the flag
 
769
  m_CursorPositionSetFlag = true;
 
770
}
 
771
 
 
772
void 
 
773
ReslicerPlaneSpatialObject
 
774
::SetReslicingModeProcessing()
 
775
{
 
776
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
777
                       ::SetReslicingModeProcessing called...\n");
 
778
  m_ReslicingMode = m_ReslicingModeToBeSet;
 
779
}
 
780
 
 
781
void 
 
782
ReslicerPlaneSpatialObject
 
783
::RequestSetOrientationType( OrientationType orientationType )
 
784
{  
 
785
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
786
                       ::RequestSetOrientationType called...\n");
 
787
 
 
788
  m_OrientationTypeToBeSet = orientationType;
 
789
 
 
790
  bool validOrientation = true;
 
791
 
 
792
  if( m_ReslicingMode == Orthogonal )
 
793
    {
 
794
    if( m_OrientationTypeToBeSet == OffAxial ||
 
795
         m_OrientationTypeToBeSet == OffCoronal ||
 
796
         m_OrientationTypeToBeSet == OffSagittal  ||
 
797
         m_OrientationTypeToBeSet == PlaneOrientationWithZAxesNormal ||
 
798
         m_OrientationTypeToBeSet == PlaneOrientationWithXAxesNormal ||
 
799
         m_OrientationTypeToBeSet == PlaneOrientationWithYAxesNormal )
 
800
      {
 
801
      validOrientation = false;
 
802
      }
 
803
    }
 
804
 
 
805
  if( m_ReslicingMode == Oblique )
 
806
    {
 
807
    if( m_OrientationTypeToBeSet  == OffAxial ||
 
808
         m_OrientationTypeToBeSet == OffCoronal ||
 
809
         m_OrientationTypeToBeSet == OffSagittal  ||
 
810
         m_OrientationTypeToBeSet == Axial ||
 
811
         m_OrientationTypeToBeSet == Sagittal ||
 
812
         m_OrientationTypeToBeSet == Coronal )
 
813
      {
 
814
      validOrientation = false;
 
815
      }
 
816
    }
 
817
 
 
818
  if( m_ReslicingMode == OffOrthogonal )
 
819
    {
 
820
    if( m_OrientationTypeToBeSet  == PlaneOrientationWithZAxesNormal ||
 
821
         m_OrientationTypeToBeSet == PlaneOrientationWithXAxesNormal ||
 
822
         m_OrientationTypeToBeSet == PlaneOrientationWithYAxesNormal  ||
 
823
         m_OrientationTypeToBeSet == Axial ||
 
824
         m_OrientationTypeToBeSet == Sagittal ||
 
825
         m_OrientationTypeToBeSet == Coronal )
 
826
      {
 
827
      validOrientation = false;
 
828
      }
 
829
    }
 
830
       
 
831
  if ( validOrientation )
 
832
    {
 
833
    m_StateMachine.PushInput( m_ValidOrientationTypeInput );
 
834
    }
 
835
  else
 
836
    {
 
837
    m_StateMachine.PushInput( m_InValidOrientationTypeInput );
 
838
    }
 
839
 
 
840
  m_StateMachine.ProcessInputs();
 
841
}
 
842
 
 
843
void 
 
844
ReslicerPlaneSpatialObject
 
845
::SetOrientationTypeProcessing()
 
846
{
 
847
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
848
                       ::SetOrientationTypeProcessing called...\n");
 
849
  m_OrientationType = m_OrientationTypeToBeSet;
 
850
}
 
851
 
 
852
void
 
853
ReslicerPlaneSpatialObject
 
854
::RequestSetBoundingBoxProviderSpatialObject( 
 
855
                     const BoundingBoxProviderSpatialObjectType* spatialObject )
 
856
{
 
857
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
858
                    ::RequestSetBoundingBoxProviderSpatialObject called...\n");
 
859
 
 
860
  m_BoundingBoxProviderSpatialObjectToBeSet = 
 
861
             const_cast< BoundingBoxProviderSpatialObjectType* >(spatialObject);
 
862
 
 
863
  m_StateMachine.PushInput( m_SetBoundingBoxProviderSpatialObjectInput );
 
864
 
 
865
  m_StateMachine.ProcessInputs();
 
866
}
 
867
 
 
868
void
 
869
ReslicerPlaneSpatialObject
 
870
::AttemptSetBoundingBoxProviderSpatialObjectProcessing( )
 
871
{
 
872
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
873
                     ::AttemptSetBoundingBoxProviderSpatialObject called...\n");
 
874
 
 
875
  if( !m_BoundingBoxProviderSpatialObjectToBeSet )
 
876
    {
 
877
    m_StateMachine.PushInput( m_InValidBoundingBoxProviderSpatialObjectInput );
 
878
    }
 
879
  else
 
880
    {
 
881
    m_StateMachine.PushInput( m_ValidBoundingBoxProviderSpatialObjectInput );
 
882
    }
 
883
 
 
884
  m_StateMachine.ProcessInputs();
 
885
}
 
886
 
 
887
void 
 
888
ReslicerPlaneSpatialObject
 
889
::SetBoundingBoxProviderSpatialObjectProcessing( )
 
890
{  
 
891
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
892
                  ::SetBoundingBoxProviderSpatialObjectProcessing called...\n");
 
893
 
 
894
  m_BoundingBoxProviderSpatialObject= m_BoundingBoxProviderSpatialObjectToBeSet;
 
895
 
 
896
  // get the bounding box from the reference spatial object
 
897
  BoundingBoxObserver::Pointer boundingBoxObserver = BoundingBoxObserver::New();
 
898
  boundingBoxObserver->Reset();
 
899
 
 
900
  unsigned long boundingBoxObserverID = 
 
901
  m_BoundingBoxProviderSpatialObject->AddObserver( 
 
902
                       BoundingBoxProviderSpatialObjectType::BoundingBoxEvent(),
 
903
                                                          boundingBoxObserver );
 
904
  m_BoundingBoxProviderSpatialObject->RequestGetBounds();
 
905
 
 
906
  if( !boundingBoxObserver->GotBoundingBox() ) 
 
907
  return;
 
908
 
 
909
  m_BoundingBox = boundingBoxObserver->GetBoundingBox();
 
910
 
 
911
  if ( m_BoundingBox.IsNull() )
 
912
  return;
 
913
 
 
914
  m_BoundingBoxProviderSpatialObject->RemoveObserver( boundingBoxObserverID );
 
915
 
 
916
  const BoundingBoxType::BoundsArrayType &bounds = m_BoundingBox->GetBounds();
 
917
 
 
918
  m_Bounds[0] = bounds[0];
 
919
  m_Bounds[1] = bounds[1];
 
920
  m_Bounds[2] = bounds[2];
 
921
  m_Bounds[3] = bounds[3];
 
922
  m_Bounds[4] = bounds[4];
 
923
  m_Bounds[5] = bounds[5];
 
924
 
 
925
  for ( unsigned int i = 0; i <= 4; i += 2 ) // reverse bounds if necessary
 
926
    {
 
927
    if ( m_Bounds[i] > m_Bounds[i+1] )
 
928
      {
 
929
      double t = m_Bounds[i+1];
 
930
      m_Bounds[i+1] = m_Bounds[i];
 
931
      m_Bounds[i] = t;
 
932
      }
 
933
    }
 
934
 
 
935
  // we start in the middle of the bounding box
 
936
  m_ToolPosition[0] = 0.5*(m_Bounds[0] + m_Bounds[1]);
 
937
  m_ToolPosition[1] = 0.5*(m_Bounds[2] + m_Bounds[3]);
 
938
  m_ToolPosition[2] = 0.5*(m_Bounds[4] + m_Bounds[5]);
 
939
  
 
940
  m_PlaneCenter[0] = m_ToolPosition[0];
 
941
  m_PlaneCenter[1] = m_ToolPosition[1];
 
942
  m_PlaneCenter[2] = m_ToolPosition[2];
 
943
 
 
944
}
 
945
 
 
946
void 
 
947
ReslicerPlaneSpatialObject
 
948
::ReportInvalidBoundingBoxProviderSpatialObjectProcessing( )
 
949
{
 
950
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
951
        ::ReportInvalidBoundingBoxProviderSpatialObjectProcessing called...\n");
 
952
}
 
953
 
 
954
void 
 
955
ReslicerPlaneSpatialObject
 
956
::ReportInvalidCursorPositionProcessing( )
 
957
{  
 
958
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
959
                       ::ReportInvalidCursorPositionProcessing called...\n");
 
960
}
 
961
 
 
962
void 
 
963
ReslicerPlaneSpatialObject
 
964
::RequestSetToolSpatialObject( const ToolSpatialObjectType * toolSpatialObject )
 
965
{  
 
966
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
967
                       ::RequestSetToolSpatialObject called...\n");
 
968
 
 
969
  m_ToolSpatialObjectToBeSet = const_cast< ToolSpatialObjectType *>(
 
970
                                                             toolSpatialObject);
 
971
 
 
972
  if( !m_ToolSpatialObjectToBeSet )
 
973
    {
 
974
    m_StateMachine.PushInput( m_InValidToolSpatialObjectInput );
 
975
    }
 
976
  else
 
977
    {
 
978
    m_StateMachine.PushInput( m_ValidToolSpatialObjectInput );
 
979
    }
 
980
 
 
981
  m_StateMachine.ProcessInputs();
 
982
}
 
983
 
 
984
void 
 
985
ReslicerPlaneSpatialObject
 
986
::SetToolSpatialObjectProcessing( )
 
987
{  
 
988
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
989
                       ::SetToolSpatialObjectProcessing called...\n");
 
990
 
 
991
  m_ToolSpatialObject = m_ToolSpatialObjectToBeSet;
 
992
  this->ObserveToolTransformWRTImageCoordinateSystemInput( 
 
993
                                                    this->m_ToolSpatialObject );
 
994
  m_ToolSpatialObjectSet = true;
 
995
}
 
996
 
 
997
void 
 
998
ReslicerPlaneSpatialObject
 
999
::ReportInvalidToolSpatialObjectProcessing( )
 
1000
{  
 
1001
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
1002
                       ::ReportInvalidToolSpatialObjectProcessing called...\n");
 
1003
}
 
1004
 
 
1005
void
 
1006
ReslicerPlaneSpatialObject
 
1007
::RequestUpdateToolTransformWRTImageCoordinateSystem()
 
1008
{
 
1009
  igstkLogMacro( DEBUG,
 
1010
                 "igstk::ReslicerPlaneSpatialObject::\
 
1011
              RequestUpdateToolTransformWRTImageCoordinateSystem called ...\n");
 
1012
  
 
1013
  igstkPushInputMacro( GetToolTransformWRTImageCoordinateSystem );
 
1014
  this->m_StateMachine.ProcessInputs();
 
1015
}
 
1016
 
 
1017
/** Request to receive the tool transform WRT reference spatial object 
 
1018
 * coordinate system */
 
1019
void
 
1020
ReslicerPlaneSpatialObject
 
1021
::RequestGetToolTransformWRTImageCoordinateSystemProcessing()
 
1022
{
 
1023
  igstkLogMacro( DEBUG,
 
1024
                 "igstk::ReslicerPlaneSpatialObject::\
 
1025
       RequestGetToolTransformWRTImageCoordinateSystemProcessing called ...\n");
 
1026
 
 
1027
  typedef igstk::Friends::CoordinateSystemHelper     CoordinateSystemHelperType;
 
1028
 
 
1029
  const CoordinateSystem* ImageSpatialObjectCoordinateSystem = 
 
1030
    CoordinateSystemHelperType::GetCoordinateSystem( 
 
1031
                                           m_BoundingBoxProviderSpatialObject );
 
1032
 
 
1033
  CoordinateSystem * ImageSpatialObjectCoordinateSystemNC =
 
1034
          const_cast< CoordinateSystem *>(ImageSpatialObjectCoordinateSystem);
 
1035
 
 
1036
  m_ToolSpatialObject->RequestComputeTransformTo( 
 
1037
                                         ImageSpatialObjectCoordinateSystemNC );
 
1038
}
 
1039
 
 
1040
/** Receive the tool spatial object transform WRT reference sapatial object
 
1041
 * coordinate system using a transduction macro */
 
1042
void
 
1043
ReslicerPlaneSpatialObject
 
1044
::ReceiveToolTransformWRTImageCoordinateSystemProcessing()
 
1045
{
 
1046
  igstkLogMacro( DEBUG, "ReceiveToolTransformWRTImageCoordinateSystemProcessing"
 
1047
                 << this->m_ToolTransformWRTImageCoordinateSystem );
 
1048
 
 
1049
  this->m_ToolTransformWRTImageCoordinateSystem =
 
1050
    this->m_ToolTransformWRTImageCoordinateSystemInputToBeSet.GetTransform();
 
1051
}
 
1052
 
 
1053
/** Request compute reslicing plane */
 
1054
void
 
1055
ReslicerPlaneSpatialObject
 
1056
::RequestComputeReslicingPlane( )
 
1057
{
 
1058
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
1059
                       ::RequestComputeReslicingPlane called...\n");
 
1060
 
 
1061
  igstkPushInputMacro( ComputeReslicePlane );
 
1062
  m_StateMachine.ProcessInputs();
 
1063
 
 
1064
}
 
1065
 
 
1066
/** Compute reslicing plane */
 
1067
void
 
1068
ReslicerPlaneSpatialObject
 
1069
::ComputeReslicePlaneProcessing()
 
1070
{
 
1071
  //Update the tool transform if tool spatial object provided
 
1072
  if ( m_ToolSpatialObject ) 
 
1073
    {
 
1074
    this->RequestUpdateToolTransformWRTImageCoordinateSystem();
 
1075
    }
 
1076
 
 
1077
  switch( m_ReslicingMode )
 
1078
    {
 
1079
    case Orthogonal:
 
1080
      {
 
1081
      this->ComputeOrthogonalReslicingPlane();
 
1082
      break;
 
1083
      }
 
1084
    case Oblique:
 
1085
      {
 
1086
      this->ComputeObliqueReslicingPlane();
 
1087
      break;
 
1088
      }
 
1089
    case OffOrthogonal:
 
1090
      {
 
1091
      this->ComputeOffOrthogonalReslicingPlane();
 
1092
      break;
 
1093
      }
 
1094
    default:
 
1095
      break;
 
1096
    }  
 
1097
 
1098
 
 
1099
/**Compute orthgonal reslicing plane */
 
1100
void
 
1101
ReslicerPlaneSpatialObject
 
1102
::ComputeOrthogonalReslicingPlane( )
 
1103
{
 
1104
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
1105
                       ::ComputeOrthogonalReslicingPlane called...\n");
 
1106
 
 
1107
  //If a tool spatial object is set (automatic reslicing) , then the 
 
1108
  //the plane center will be set to the tool postion in 3D space.
 
1109
  if( m_ToolSpatialObject )
 
1110
    {
 
1111
    VectorType   translation;
 
1112
    translation = m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
 
1113
 
 
1114
    m_ToolPosition[0] = translation[0];
 
1115
    m_ToolPosition[1] = translation[1];
 
1116
    m_ToolPosition[2] = translation[2];
 
1117
 
 
1118
    m_PlaneCenter[0] = translation[0];
 
1119
    m_PlaneCenter[1] = translation[1];
 
1120
    m_PlaneCenter[2] = translation[2];
 
1121
 
 
1122
    switch( m_OrientationType )
 
1123
      {
 
1124
      case Axial:
 
1125
        {
 
1126
        m_PlaneNormal[0] = 0.0;
 
1127
        m_PlaneNormal[1] = 0.0;
 
1128
        m_PlaneNormal[2] = 1.0;
 
1129
 
 
1130
        m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
 
1131
        m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
 
1132
 
 
1133
        break;
 
1134
        }
 
1135
 
 
1136
      case Sagittal:
 
1137
        {
 
1138
        m_PlaneNormal[0] = 1.0;
 
1139
        m_PlaneNormal[1] = 0.0;
 
1140
        m_PlaneNormal[2] = 0.0;
 
1141
 
 
1142
        m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
 
1143
        m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
 
1144
 
 
1145
        break;
 
1146
        }
 
1147
 
 
1148
      case Coronal:
 
1149
        {
 
1150
        m_PlaneNormal[0] = 0.0;
 
1151
        m_PlaneNormal[1] = 1.0;
 
1152
        m_PlaneNormal[2] = 0.0;
 
1153
 
 
1154
        m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
 
1155
        m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
 
1156
 
 
1157
        break;
 
1158
        }
 
1159
 
 
1160
      default:
 
1161
        {
 
1162
        std::cerr << "Invalid orientation type " << std::endl;
 
1163
        break;
 
1164
        }
 
1165
      }
 
1166
    }
 
1167
  else
 
1168
    {
 
1169
    // Otherwise, use the cursor postion and image bounds to set the center
 
1170
    switch( m_OrientationType )
 
1171
      {
 
1172
      case Axial:
 
1173
        {
 
1174
        m_PlaneNormal[0] = 0.0;
 
1175
        m_PlaneNormal[1] = 0.0;
 
1176
        m_PlaneNormal[2] = 1.0;
 
1177
 
 
1178
        m_PlaneCenter[0] = 0.5*(m_Bounds[0] + m_Bounds[1]);
 
1179
        m_PlaneCenter[1] = 0.5*(m_Bounds[2] + m_Bounds[3]);
 
1180
        
 
1181
        if ( m_CursorPositionSetFlag )
 
1182
          {
 
1183
          m_PlaneCenter[2] = m_CursorPosition[2];
 
1184
          m_ToolPosition[2] = m_CursorPosition[2];
 
1185
          m_CursorPositionSetFlag = false;
 
1186
          }
 
1187
        break; 
 
1188
        }
 
1189
      case Sagittal:
 
1190
        {
 
1191
        m_PlaneNormal[0] = 1.0;
 
1192
        m_PlaneNormal[1] = 0.0;
 
1193
        m_PlaneNormal[2] = 0.0;
 
1194
 
 
1195
        m_PlaneCenter[1] = 0.5*(m_Bounds[2] + m_Bounds[3]);
 
1196
        m_PlaneCenter[2] = 0.5*(m_Bounds[4] + m_Bounds[5]);
 
1197
 
 
1198
        if ( m_CursorPositionSetFlag )
 
1199
          {
 
1200
          m_PlaneCenter[0] = m_CursorPosition[0];
 
1201
          m_ToolPosition[0] = m_CursorPosition[0];
 
1202
          m_CursorPositionSetFlag = false;
 
1203
          }
 
1204
        break;
 
1205
        }
 
1206
      case Coronal:
 
1207
        {
 
1208
        m_PlaneNormal[0] = 0.0;
 
1209
        m_PlaneNormal[1] = 1.0;
 
1210
        m_PlaneNormal[2] = 0.0;
 
1211
 
 
1212
        m_PlaneCenter[0] = 0.5*(m_Bounds[0] + m_Bounds[1]);
 
1213
        m_PlaneCenter[2] = 0.5*(m_Bounds[4] + m_Bounds[5]);
 
1214
 
 
1215
        if ( m_CursorPositionSetFlag )
 
1216
          {
 
1217
          m_PlaneCenter[1] = m_CursorPosition[1];
 
1218
          m_ToolPosition[1] = m_CursorPosition[1];
 
1219
          m_CursorPositionSetFlag = false;
 
1220
          }
 
1221
        break;
 
1222
        }
 
1223
      default:
 
1224
        {
 
1225
        std::cerr << "Invalid orientaiton" << std::endl;
 
1226
        break;
 
1227
        }
 
1228
      }
 
1229
  }  
 
1230
}
 
1231
 
 
1232
/**Compute oblique reslicing plane */
 
1233
void
 
1234
ReslicerPlaneSpatialObject
 
1235
::ComputeObliqueReslicingPlane( )
 
1236
{
 
1237
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
1238
                       ::ComputeObliqueReslicingPlane called...\n");
 
1239
 
 
1240
  /* Calculate the tool's long axis vector.
 
1241
  * we make the assumption that the tool's long axis is on the -x axis
 
1242
  * with the tip in (0,0,0)
 
1243
  */
 
1244
  const VersorType& rotation = 
 
1245
                          m_ToolTransformWRTImageCoordinateSystem.GetRotation();
 
1246
  // auxiliary vecs
 
1247
  VectorType v1, v2, vn;
 
1248
  vn.Fill(0.0);
 
1249
  vn[0] = 1;
 
1250
  vn = rotation.Transform(vn);
 
1251
 
 
1252
  const VectorType& translation = 
 
1253
                       m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
 
1254
 
 
1255
  m_ToolPosition[0] = translation[0];
 
1256
  m_ToolPosition[1] = translation[1];
 
1257
  m_ToolPosition[2] = translation[2];
 
1258
 
 
1259
  m_PlaneCenter[0] = translation[0];
 
1260
  m_PlaneCenter[1] = translation[1];
 
1261
  m_PlaneCenter[2] = translation[2];
 
1262
 
 
1263
  // get any normal vector to the tool's long axis
 
1264
  // fixme: we could make use of the 6DOF by converting the
 
1265
  // orthonormal base (1,0,0) (0,1,0) (0,0,1) but it's too noisy ...
 
1266
  v1[0] = -vn[1];
 
1267
  v1[1] = vn[0];
 
1268
  v1[2] = 0;
 
1269
 
 
1270
  // get a second normal vector
 
1271
  v2 = itk::CrossProduct( v1, vn );
 
1272
 
 
1273
  switch( m_OrientationType )
 
1274
    {
 
1275
    case PlaneOrientationWithXAxesNormal:
 
1276
      { 
 
1277
      m_PlaneNormal = v1;
 
1278
      break;
 
1279
      }
 
1280
 
 
1281
    case PlaneOrientationWithYAxesNormal:
 
1282
      {
 
1283
      m_PlaneNormal = v2;
 
1284
      break;
 
1285
      }
 
1286
 
 
1287
    case PlaneOrientationWithZAxesNormal:
 
1288
      {
 
1289
      m_PlaneNormal = vn;
 
1290
      break;
 
1291
      }
 
1292
 
 
1293
    default:
 
1294
      {
 
1295
      std::cerr << "Invalid orientation" << std::endl;
 
1296
      break;
 
1297
      }
 
1298
    }
 
1299
}
 
1300
 
 
1301
/**Compute off-orthgonal reslicing plane */
 
1302
void
 
1303
ReslicerPlaneSpatialObject
 
1304
::ComputeOffOrthogonalReslicingPlane( )
 
1305
{
 
1306
  igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
 
1307
                       ::ComputeOffOrthogonalReslicingPlane called...\n");
 
1308
 
 
1309
 /* Calculate the tool's long axis vector.
 
1310
  * we make the assumption that the tool's long axis is on the -x axis
 
1311
  * with the tip in (0,0,0)
 
1312
  */
 
1313
  const VersorType& rotation = 
 
1314
                          m_ToolTransformWRTImageCoordinateSystem.GetRotation();
 
1315
  
 
1316
  // auxiliary vecs
 
1317
  VectorType v1, vn;
 
1318
  vn.Fill(0.0);
 
1319
  vn[0] = 1;
 
1320
  vn = rotation.Transform(vn);
 
1321
 
 
1322
  const VectorType& translation = 
 
1323
                       m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
 
1324
 
 
1325
  m_ToolPosition[0] = translation[0];
 
1326
  m_ToolPosition[1] = translation[1];
 
1327
  m_ToolPosition[2] = translation[2];
 
1328
 
 
1329
  m_PlaneCenter[0] = translation[0];
 
1330
  m_PlaneCenter[1] = translation[1];
 
1331
  m_PlaneCenter[2] = translation[2];
 
1332
 
 
1333
  switch( m_OrientationType )
 
1334
    {
 
1335
    case OffAxial:
 
1336
      {
 
1337
      v1.Fill( 0.0 );
 
1338
      v1[0] = 1;
 
1339
    
 
1340
      if ( fabs(v1*vn) < 1e-9 )
 
1341
      {
 
1342
      // FIXME: need to handle this situation too
 
1343
      igstkLogMacro( DEBUG, "The two vectors are parallel \n");
 
1344
      }
 
1345
 
 
1346
      vn = itk::CrossProduct( v1, vn );
 
1347
      vn.Normalize();
 
1348
 
 
1349
      m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
 
1350
 
 
1351
      m_PlaneNormal = vn;
 
1352
      break;
 
1353
      }
 
1354
 
 
1355
    case OffSagittal:
 
1356
      {
 
1357
                
 
1358
      v1.Fill( 0.0 );
 
1359
      v1[2] = 1;
 
1360
    
 
1361
      if ( fabs(v1*vn) < 1e-9 )
 
1362
        {
 
1363
        // FIXME: need to handle this situation too
 
1364
        igstkLogMacro( DEBUG, "The two vectors are parallel \n");
 
1365
        }
 
1366
 
 
1367
      vn = itk::CrossProduct( v1, vn );
 
1368
      vn.Normalize();
 
1369
 
 
1370
      m_PlaneNormal = vn;
 
1371
 
 
1372
      m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
 
1373
      
 
1374
      break;
 
1375
      }
 
1376
 
 
1377
    case OffCoronal:
 
1378
      {
 
1379
      v1.Fill( 0.0 );
 
1380
      v1[1] = 1;
 
1381
    
 
1382
      if ( fabs(v1*vn) < 1e-9 )
 
1383
        {
 
1384
        // FIXME: need to handle this situation too
 
1385
        igstkLogMacro( DEBUG, "The two vectors are parallel \n");
 
1386
        }
 
1387
 
 
1388
      vn = itk::CrossProduct( v1, vn );
 
1389
      vn.Normalize();
 
1390
 
 
1391
      m_PlaneNormal = vn;
 
1392
 
 
1393
      m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
 
1394
 
 
1395
      break;
 
1396
      }
 
1397
 
 
1398
    default:
 
1399
      {
 
1400
         std::cerr << "Invalid orientation" << std::endl;
 
1401
         break;
 
1402
      }
 
1403
    }
 
1404
}
 
1405
 
 
1406
/** Report invalid reslicing mode */
 
1407
void
 
1408
ReslicerPlaneSpatialObject
 
1409
::ReportInvalidReslicingModeProcessing( void )
 
1410
{
 
1411
  igstkLogMacro( WARNING, "igstk::ReslicerPlaneSpatialObject::\
 
1412
                             ReportInvalidReslicingModeProcessing called...\n");
 
1413
}
 
1414
 
 
1415
/** Report invalid orientation type */
 
1416
void
 
1417
ReslicerPlaneSpatialObject
 
1418
::ReportInvalidOrientationTypeProcessing( void )
 
1419
{
 
1420
  igstkLogMacro( WARNING, "igstk::ReslicerPlaneSpatialObject::\
 
1421
                           ReportInvalidOrientationTypeProcessing called...\n");
 
1422
}
 
1423
 
 
1424
/** Report invalid request */
 
1425
void 
 
1426
ReslicerPlaneSpatialObject
 
1427
::ReportInvalidRequestProcessing( void )
 
1428
{
 
1429
  igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject::\
 
1430
                                   ReportInvalidRequestProcessing called...\n");
 
1431
 
 
1432
  this->InvokeEvent( InvalidRequestErrorEvent() );
 
1433
}
 
1434
 
 
1435
/** Get tool transform WRT Image Coordinate System */
 
1436
igstk::Transform
 
1437
ReslicerPlaneSpatialObject
 
1438
::GetToolTransform( ) const
 
1439
{
 
1440
  return this->m_ToolTransformWRTImageCoordinateSystem;
 
1441
}
 
1442
 
 
1443
//todo: get tool position as an event
 
1444
ReslicerPlaneSpatialObject::VectorType
 
1445
ReslicerPlaneSpatialObject
 
1446
::GetToolPosition() const
 
1447
{
 
1448
  return m_ToolPosition;
 
1449
}
 
1450
 
 
1451
/** Check if tool spatial object is set to drive the reslicing */
 
1452
bool
 
1453
ReslicerPlaneSpatialObject
 
1454
::IsToolSpatialObjectSet( ) 
 
1455
{
 
1456
  return this->m_ToolSpatialObjectSet;
 
1457
}
 
1458
 
 
1459
/** Print object information */
 
1460
void
 
1461
ReslicerPlaneSpatialObject
 
1462
::PrintSelf( std::ostream& os, itk::Indent indent ) const
 
1463
{
 
1464
  Superclass::PrintSelf(os, indent);
 
1465
  os << indent << "Plane normal" << std::endl;
 
1466
  os << indent << m_PlaneNormal[0] << " " << m_PlaneNormal[1] << " " 
 
1467
                                        << m_PlaneNormal[2] << " " << std::endl;
 
1468
  os << indent << "Plane center" << std::endl;
 
1469
  os << indent << m_PlaneCenter[0] << " " << m_PlaneCenter[1] << " " 
 
1470
                                        << m_PlaneCenter[2] << " " << std::endl;
 
1471
  os << indent << "Tool spatial object set?" << std::endl;
 
1472
  os << indent << m_ToolSpatialObjectSet << std::endl;
 
1473
  os << indent << "Tool position" << std::endl;
 
1474
  os << indent << m_ToolPosition[0] << " " << m_ToolPosition[1] << " " 
 
1475
                                       << m_ToolPosition[2] << " " << std::endl;
 
1476
  os << indent << "Cursor position" << std::endl;
 
1477
  os << indent << m_CursorPosition[0] << " " << m_CursorPosition[1] << " " 
 
1478
                                     << m_CursorPosition[2] << " " << std::endl;
 
1479
  os << indent << "Bounding box:" << std::endl;
 
1480
  os << indent << "x: " << m_Bounds[0] << " " << m_Bounds[1] << std::endl;
 
1481
  os << indent << "y: " << m_Bounds[2] << " " << m_Bounds[3] << std::endl;
 
1482
  os << indent << "z: " << m_Bounds[4] << " " << m_Bounds[5] << std::endl;
 
1483
 
 
1484
  os << indent << "Reslicing mode:" << std::endl;
 
1485
 
 
1486
  if( m_ReslicingMode == Orthogonal )
 
1487
    {
 
1488
    os << indent << "Orthogonal" << std::endl;
 
1489
    }
 
1490
  if( m_ReslicingMode == OffOrthogonal )
 
1491
    {
 
1492
    os << indent << "OffOrthogonal" << std::endl;
 
1493
    }
 
1494
  if( m_ReslicingMode == Oblique )
 
1495
    {
 
1496
    os << indent << "Oblique" << std::endl;
 
1497
    }
 
1498
 
 
1499
  os << indent << "Orientation type:" << std::endl;
 
1500
 
 
1501
  if( m_OrientationType == Axial )
 
1502
    {
 
1503
    os << indent << "Axial" << std::endl;
 
1504
    }
 
1505
  if( m_OrientationType == Sagittal )
 
1506
    {
 
1507
    os << indent << "Sagittal" << std::endl;
 
1508
    }
 
1509
  if( m_OrientationType == Coronal )
 
1510
    {
 
1511
    os << indent << "Coronal" << std::endl;
 
1512
    }
 
1513
 
 
1514
  if( m_OrientationType == OffAxial )
 
1515
    {
 
1516
    os << indent << "OffAxial" << std::endl;
 
1517
    }
 
1518
  if( m_OrientationType == OffSagittal )
 
1519
    {
 
1520
    os << indent << "OffSagittal" << std::endl;
 
1521
    }
 
1522
  if( m_OrientationType == OffCoronal )
 
1523
    {
 
1524
    os << indent << "OffCoronal" << std::endl;
 
1525
    }
 
1526
  
 
1527
  if( m_OrientationType == PlaneOrientationWithZAxesNormal )
 
1528
    {
 
1529
    os << indent << "PlaneOrientationWithZAxesNormal" << std::endl;
 
1530
    }
 
1531
  if( m_OrientationType == PlaneOrientationWithXAxesNormal )
 
1532
    {
 
1533
    os << indent << "PlaneOrientationWithXAxesNormal" << std::endl;
 
1534
    }
 
1535
  if( m_OrientationType == PlaneOrientationWithYAxesNormal )
 
1536
    {
 
1537
    os << indent << "PlaneOrientationWithYAxesNormal" << std::endl;
 
1538
    }
 
1539
}
 
1540
 
 
1541
} // end namespace igstk
 
1542
 
 
1543
 
 
1544
#endif