1
/*=========================================================================
3
Program: Image Guided Surgery Software Toolkit
4
Module: $RCSfile: igstkReslicerPlaneSpatialObject.cxx,v $
6
Date: $Date: 2009-06-17 14:40:23 $
7
Version: $Revision: 1.3 $
9
Copyright (c) ISC Insight Software Consortium. All rights reserved.
10
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
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.
16
=========================================================================*/
18
#ifndef __igstkReslicerPlaneSpatialObject_cxx
19
#define __igstkReslicerPlaneSpatialObject_cxx
21
#include "igstkReslicerPlaneSpatialObject.h"
22
#include "igstkEvents.h"
24
#include "vtkPlaneSource.h"
27
#include "vtkTransform.h"
33
ReslicerPlaneSpatialObject
34
::ReslicerPlaneSpatialObject():m_StateMachine(this)
36
//Default reslicing mode
37
m_ReslicingMode = Orthogonal;
39
//Default orientation type
40
m_OrientationType = Axial;
42
m_BoundingBoxProviderSpatialObject = NULL;
43
m_ToolSpatialObject = NULL;
45
//tool spatial object check flag
46
m_ToolSpatialObjectSet = false;
49
m_CursorPosition[0] = 0;
50
m_CursorPosition[1] = 0;
51
m_CursorPosition[2] = 0;
54
m_ToolPosition[0] = 0;
55
m_ToolPosition[1] = 0;
56
m_ToolPosition[2] = 0;
58
m_CursorPositionSetFlag = false;
61
igstkAddStateMacro( Initial );
62
igstkAddStateMacro( ReslicingModeSet );
63
igstkAddStateMacro( OrientationTypeSet );
64
igstkAddStateMacro( BoundingBoxProviderSpatialObjectSet );
65
igstkAddStateMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem );
66
igstkAddStateMacro( AttemptingToSetCursorPosition );
67
igstkAddStateMacro( AttemptingToSetBoundingBoxProviderSpatialObject );
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 );
89
// List of state machine transitions
92
igstkAddTransitionMacro( Initial, ValidReslicingMode,
93
ReslicingModeSet, SetReslicingMode );
95
igstkAddTransitionMacro( Initial, InValidReslicingMode,
96
Initial, ReportInvalidReslicingMode );
98
igstkAddTransitionMacro( Initial, SetBoundingBoxProviderSpatialObject,
99
Initial, ReportInvalidRequest);
101
igstkAddTransitionMacro( Initial, ValidOrientationType,
102
Initial, ReportInvalidRequest);
104
igstkAddTransitionMacro( Initial, InValidOrientationType,
105
Initial, ReportInvalidRequest);
107
igstkAddTransitionMacro( Initial, ValidBoundingBoxProviderSpatialObject,
108
Initial, ReportInvalidRequest);
110
igstkAddTransitionMacro( Initial, InValidBoundingBoxProviderSpatialObject,
111
Initial, ReportInvalidRequest);
113
igstkAddTransitionMacro( Initial, ValidToolSpatialObject,
114
Initial, ReportInvalidRequest);
116
igstkAddTransitionMacro( Initial, InValidToolSpatialObject,
117
Initial, ReportInvalidRequest);
119
igstkAddTransitionMacro( Initial, SetCursorPosition,
120
Initial, ReportInvalidRequest);
122
igstkAddTransitionMacro( Initial, ValidCursorPosition,
123
Initial, ReportInvalidRequest);
125
igstkAddTransitionMacro( Initial, InValidCursorPosition,
126
Initial, ReportInvalidRequest);
128
igstkAddTransitionMacro( Initial, GetToolPosition,
129
Initial, ReportInvalidRequest);
131
igstkAddTransitionMacro( Initial, GetReslicingPlaneParameters,
132
Initial, ReportInvalidRequest);
134
igstkAddTransitionMacro( Initial, GetToolTransformWRTImageCoordinateSystem,
135
Initial, ReportInvalidRequest);
137
igstkAddTransitionMacro( Initial, ToolTransformWRTImageCoordinateSystem,
138
Initial, ReportInvalidRequest);
140
igstkAddTransitionMacro( Initial, ComputeReslicePlane,
141
Initial, ReportInvalidRequest);
143
//From ReslicingModeSet
144
igstkAddTransitionMacro( ReslicingModeSet, ValidOrientationType,
145
OrientationTypeSet, SetOrientationType );
147
igstkAddTransitionMacro( ReslicingModeSet, InValidOrientationType,
148
ReslicingModeSet, ReportInvalidOrientationType);
150
igstkAddTransitionMacro( ReslicingModeSet, SetCursorPosition,
151
ReslicingModeSet, ReportInvalidRequest );
153
igstkAddTransitionMacro( ReslicingModeSet,
154
SetBoundingBoxProviderSpatialObject,
156
ReportInvalidRequest);
158
igstkAddTransitionMacro( ReslicingModeSet,
159
ValidBoundingBoxProviderSpatialObject,
161
ReportInvalidRequest);
163
igstkAddTransitionMacro( ReslicingModeSet,
164
InValidBoundingBoxProviderSpatialObject,
165
ReslicingModeSet, ReportInvalidRequest);
167
igstkAddTransitionMacro( ReslicingModeSet, ValidToolSpatialObject,
168
ReslicingModeSet, ReportInvalidRequest);
170
igstkAddTransitionMacro( ReslicingModeSet, InValidToolSpatialObject,
171
ReslicingModeSet, ReportInvalidRequest);
173
igstkAddTransitionMacro( ReslicingModeSet, ValidCursorPosition,
174
ReslicingModeSet, ReportInvalidRequest);
176
igstkAddTransitionMacro( ReslicingModeSet, InValidCursorPosition,
177
ReslicingModeSet, ReportInvalidRequest);
179
igstkAddTransitionMacro( ReslicingModeSet, GetToolPosition,
180
ReslicingModeSet, ReportInvalidRequest);
182
igstkAddTransitionMacro( ReslicingModeSet, GetReslicingPlaneParameters,
183
ReslicingModeSet, ReportInvalidRequest);
185
igstkAddTransitionMacro( ReslicingModeSet,
186
GetToolTransformWRTImageCoordinateSystem,
187
ReslicingModeSet, ReportInvalidRequest);
189
igstkAddTransitionMacro( ReslicingModeSet,
190
ToolTransformWRTImageCoordinateSystem,
191
ReslicingModeSet, ReportInvalidRequest);
193
igstkAddTransitionMacro( ReslicingModeSet, ComputeReslicePlane,
194
ReslicingModeSet, ReportInvalidRequest);
196
//From OrientationTypeSet
197
igstkAddTransitionMacro( OrientationTypeSet,
198
SetBoundingBoxProviderSpatialObject,
199
AttemptingToSetBoundingBoxProviderSpatialObject,
200
AttemptSetBoundingBoxProviderSpatialObject );
202
igstkAddTransitionMacro( OrientationTypeSet, SetCursorPosition,
203
OrientationTypeSet, ReportInvalidRequest );
205
igstkAddTransitionMacro( OrientationTypeSet, ValidOrientationType,
206
OrientationTypeSet, SetOrientationType );
208
igstkAddTransitionMacro( OrientationTypeSet, InValidOrientationType,
209
OrientationTypeSet, ReportInvalidOrientationType);
211
igstkAddTransitionMacro( OrientationTypeSet,
212
ValidBoundingBoxProviderSpatialObject,
213
OrientationTypeSet, ReportInvalidRequest);
215
igstkAddTransitionMacro( OrientationTypeSet,
216
InValidBoundingBoxProviderSpatialObject,
217
OrientationTypeSet, ReportInvalidRequest);
219
igstkAddTransitionMacro( OrientationTypeSet, ValidToolSpatialObject,
220
OrientationTypeSet, ReportInvalidRequest);
222
igstkAddTransitionMacro( OrientationTypeSet, InValidToolSpatialObject,
223
OrientationTypeSet, ReportInvalidRequest);
225
igstkAddTransitionMacro( OrientationTypeSet, ValidCursorPosition,
226
OrientationTypeSet, ReportInvalidRequest);
228
igstkAddTransitionMacro( OrientationTypeSet, InValidCursorPosition,
229
OrientationTypeSet, ReportInvalidRequest);
231
igstkAddTransitionMacro( OrientationTypeSet, GetToolPosition,
232
OrientationTypeSet, ReportInvalidRequest);
234
igstkAddTransitionMacro( OrientationTypeSet, GetReslicingPlaneParameters,
235
OrientationTypeSet, ReportInvalidRequest);
237
igstkAddTransitionMacro( OrientationTypeSet,
238
GetToolTransformWRTImageCoordinateSystem,
239
OrientationTypeSet, ReportInvalidRequest);
241
igstkAddTransitionMacro( OrientationTypeSet,
242
ToolTransformWRTImageCoordinateSystem,
243
OrientationTypeSet, ReportInvalidRequest);
245
igstkAddTransitionMacro( OrientationTypeSet, ComputeReslicePlane,
246
OrientationTypeSet, ReportInvalidRequest);
249
// From AttemptingToSetBoundingBoxProviderSpatialObject
250
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
251
ValidBoundingBoxProviderSpatialObject,
252
BoundingBoxProviderSpatialObjectSet,
253
SetBoundingBoxProviderSpatialObject );
255
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
256
InValidBoundingBoxProviderSpatialObject,
258
ReportInvalidBoundingBoxProviderSpatialObject );
260
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
261
SetBoundingBoxProviderSpatialObject,
262
AttemptingToSetBoundingBoxProviderSpatialObject,
263
ReportInvalidRequest );
265
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
267
AttemptingToSetBoundingBoxProviderSpatialObject,
268
ReportInvalidRequest );
270
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
271
ValidOrientationType,
272
AttemptingToSetBoundingBoxProviderSpatialObject,
273
ReportInvalidRequest );
275
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
276
InValidOrientationType,
277
AttemptingToSetBoundingBoxProviderSpatialObject,
278
ReportInvalidRequest);
280
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
281
ValidBoundingBoxProviderSpatialObject,
282
AttemptingToSetBoundingBoxProviderSpatialObject,
283
ReportInvalidRequest);
285
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
286
InValidBoundingBoxProviderSpatialObject,
287
AttemptingToSetBoundingBoxProviderSpatialObject,
288
ReportInvalidRequest);
290
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
291
ValidToolSpatialObject,
292
AttemptingToSetBoundingBoxProviderSpatialObject,
293
ReportInvalidRequest);
295
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
296
InValidToolSpatialObject,
297
AttemptingToSetBoundingBoxProviderSpatialObject,
298
ReportInvalidRequest);
300
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
302
AttemptingToSetBoundingBoxProviderSpatialObject,
303
ReportInvalidRequest);
305
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
306
InValidCursorPosition,
307
AttemptingToSetBoundingBoxProviderSpatialObject,
308
ReportInvalidRequest);
310
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
312
AttemptingToSetBoundingBoxProviderSpatialObject,
313
ReportInvalidRequest);
315
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
316
GetReslicingPlaneParameters,
317
AttemptingToSetBoundingBoxProviderSpatialObject,
318
ReportInvalidRequest);
320
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
321
GetToolTransformWRTImageCoordinateSystem,
322
AttemptingToSetBoundingBoxProviderSpatialObject,
323
ReportInvalidRequest);
325
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
326
ToolTransformWRTImageCoordinateSystem,
327
AttemptingToSetBoundingBoxProviderSpatialObject,
328
ReportInvalidRequest);
330
igstkAddTransitionMacro( AttemptingToSetBoundingBoxProviderSpatialObject,
332
AttemptingToSetBoundingBoxProviderSpatialObject,
333
ReportInvalidRequest);
335
//From BoundingBoxProviderSpatialObjectSet
336
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
337
ValidOrientationType,
338
BoundingBoxProviderSpatialObjectSet,
339
SetOrientationType );
341
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
342
InValidOrientationType,
343
BoundingBoxProviderSpatialObjectSet,
344
ReportInvalidOrientationType );
346
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
348
BoundingBoxProviderSpatialObjectSet,
351
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
352
InValidReslicingMode,
353
BoundingBoxProviderSpatialObjectSet,
354
ReportInvalidReslicingMode );
356
// igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
357
// ValidCursorPosition,
358
// BoundingBoxProviderSpatialObjectSet,
359
// SetCursorPosition );
361
// igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
362
// InValidCursorPosition,
363
// BoundingBoxProviderSpatialObjectSet,
364
// ReportInvalidCursorPosition );
366
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
367
ValidToolSpatialObject,
368
BoundingBoxProviderSpatialObjectSet,
369
SetToolSpatialObject );
371
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
372
InValidToolSpatialObject,
373
BoundingBoxProviderSpatialObjectSet,
374
ReportInvalidToolSpatialObject );
376
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
378
AttemptingToSetCursorPosition,
379
AttemptSetCursorPosition );
381
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
383
BoundingBoxProviderSpatialObjectSet,
384
ComputeReslicePlane );
386
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
388
BoundingBoxProviderSpatialObjectSet,
389
ReportToolPosition );
391
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
392
GetReslicingPlaneParameters,
393
BoundingBoxProviderSpatialObjectSet,
394
ReportReslicingPlaneParameters );
396
igstkAddTransitionMacro( BoundingBoxProviderSpatialObjectSet,
397
GetToolTransformWRTImageCoordinateSystem,
398
AttemptingToGetToolTransformWRTImageCoordinateSystem,
399
RequestGetToolTransformWRTImageCoordinateSystem );
401
// From AttemptingToSetCursorPosition
402
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
404
BoundingBoxProviderSpatialObjectSet,
407
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
408
InValidCursorPosition,
409
BoundingBoxProviderSpatialObjectSet,
410
ReportInvalidCursorPosition );
412
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
413
ValidBoundingBoxProviderSpatialObject,
414
AttemptingToSetCursorPosition,
415
ReportInvalidRequest );
417
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
418
InValidBoundingBoxProviderSpatialObject,
419
AttemptingToSetCursorPosition,
420
ReportInvalidRequest );
422
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
423
SetBoundingBoxProviderSpatialObject,
424
AttemptingToSetCursorPosition,
425
ReportInvalidRequest );
427
igstkAddTransitionMacro( AttemptingToSetCursorPosition, SetCursorPosition,
428
AttemptingToSetCursorPosition,
429
ReportInvalidRequest );
431
igstkAddTransitionMacro( AttemptingToSetCursorPosition, ValidOrientationType,
432
AttemptingToSetCursorPosition,
433
ReportInvalidRequest );
435
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
436
InValidOrientationType,
437
AttemptingToSetCursorPosition, ReportInvalidRequest);
439
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
440
ValidBoundingBoxProviderSpatialObject,
441
AttemptingToSetCursorPosition, ReportInvalidRequest);
443
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
444
InValidBoundingBoxProviderSpatialObject,
445
AttemptingToSetCursorPosition, ReportInvalidRequest);
447
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
448
ValidToolSpatialObject,
449
AttemptingToSetCursorPosition, ReportInvalidRequest);
451
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
452
InValidToolSpatialObject,
453
AttemptingToSetCursorPosition, ReportInvalidRequest);
455
igstkAddTransitionMacro( AttemptingToSetCursorPosition, GetToolPosition,
456
AttemptingToSetCursorPosition, ReportInvalidRequest);
458
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
459
GetReslicingPlaneParameters,
460
AttemptingToSetCursorPosition, ReportInvalidRequest);
462
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
463
GetToolTransformWRTImageCoordinateSystem,
464
AttemptingToSetCursorPosition, ReportInvalidRequest);
466
igstkAddTransitionMacro( AttemptingToSetCursorPosition,
467
ToolTransformWRTImageCoordinateSystem,
468
AttemptingToSetCursorPosition, ReportInvalidRequest);
470
igstkAddTransitionMacro( AttemptingToSetCursorPosition, ComputeReslicePlane,
471
AttemptingToSetCursorPosition, ReportInvalidRequest);
474
// From AttemptingToGetToolTransformWRTImageCoordinateSystem
475
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
476
ToolTransformWRTImageCoordinateSystem,
477
BoundingBoxProviderSpatialObjectSet,
478
ReceiveToolTransformWRTImageCoordinateSystem );
480
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
482
AttemptingToGetToolTransformWRTImageCoordinateSystem,
485
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
486
InValidReslicingMode,
487
AttemptingToGetToolTransformWRTImageCoordinateSystem,
488
ReportInvalidReslicingMode );
490
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
491
SetBoundingBoxProviderSpatialObject,
492
AttemptingToGetToolTransformWRTImageCoordinateSystem,
493
ReportInvalidRequest);
495
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
496
ValidOrientationType,
497
AttemptingToGetToolTransformWRTImageCoordinateSystem,
498
ReportInvalidRequest);
500
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
501
InValidOrientationType,
502
AttemptingToGetToolTransformWRTImageCoordinateSystem,
503
ReportInvalidRequest);
505
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
506
ValidBoundingBoxProviderSpatialObject,
507
AttemptingToGetToolTransformWRTImageCoordinateSystem,
508
ReportInvalidRequest);
510
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
511
InValidBoundingBoxProviderSpatialObject,
512
AttemptingToGetToolTransformWRTImageCoordinateSystem,
513
ReportInvalidRequest);
515
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
516
ValidToolSpatialObject,
517
AttemptingToGetToolTransformWRTImageCoordinateSystem,
518
ReportInvalidRequest);
520
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
521
InValidToolSpatialObject,
522
AttemptingToGetToolTransformWRTImageCoordinateSystem,
523
ReportInvalidRequest);
525
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
527
AttemptingToGetToolTransformWRTImageCoordinateSystem,
528
ReportInvalidRequest);
530
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
532
AttemptingToGetToolTransformWRTImageCoordinateSystem,
533
ReportInvalidRequest);
535
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
536
InValidCursorPosition,
537
AttemptingToGetToolTransformWRTImageCoordinateSystem,
538
ReportInvalidRequest);
540
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
542
AttemptingToGetToolTransformWRTImageCoordinateSystem,
543
ReportInvalidRequest);
545
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
546
GetReslicingPlaneParameters,
547
AttemptingToGetToolTransformWRTImageCoordinateSystem,
548
ReportInvalidRequest);
550
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
551
GetToolTransformWRTImageCoordinateSystem,
552
AttemptingToGetToolTransformWRTImageCoordinateSystem,
553
ReportInvalidRequest);
555
igstkAddTransitionMacro( AttemptingToGetToolTransformWRTImageCoordinateSystem,
557
AttemptingToGetToolTransformWRTImageCoordinateSystem,
558
ReportInvalidRequest);
560
igstkSetInitialStateMacro( Initial );
561
this->m_StateMachine.SetReadyToRun();
565
ReslicerPlaneSpatialObject
566
::~ReslicerPlaneSpatialObject()
572
ReslicerPlaneSpatialObject
573
::RequestSetReslicingMode( ReslicingMode reslicingMode )
575
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
576
::RequestSetReslicingMode called...\n");
578
bool validReslicingMode = false;
580
if( reslicingMode == Orthogonal )
582
validReslicingMode = true;
585
if( reslicingMode == OffOrthogonal )
587
validReslicingMode = true;
590
if( reslicingMode == Oblique )
592
validReslicingMode = true;
595
if ( validReslicingMode )
597
m_ReslicingModeToBeSet = reslicingMode;
598
m_StateMachine.PushInput( m_ValidReslicingModeInput );
602
m_StateMachine.PushInput( m_InValidReslicingModeInput );
605
m_StateMachine.ProcessInputs();
608
/** Null Operation for a State Machine Transition */
610
ReslicerPlaneSpatialObject
616
ReslicerPlaneSpatialObject
617
::RequestGetToolPosition()
619
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
620
::RequestGetToolPosition called...\n");
622
igstkPushInputMacro( GetToolPosition );
623
m_StateMachine.ProcessInputs();
627
ReslicerPlaneSpatialObject
628
::RequestGetReslicingPlaneParameters()
630
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
631
::RequestGetReslicingPlaneParameters called...\n");
633
igstkPushInputMacro( GetReslicingPlaneParameters );
634
m_StateMachine.ProcessInputs();
638
ReslicerPlaneSpatialObject
639
::ReportToolPositionProcessing()
641
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
642
::ReportToolPositionProcessing called...\n");
644
ToolTipPositionEvent event;
645
event.Set( m_ToolPosition );
646
this->InvokeEvent( event );
649
ReslicerPlaneSpatialObject::ReslicingMode
650
ReslicerPlaneSpatialObject
651
::GetReslicingMode() const
653
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
654
::GetReslicingMode called...\n");
656
return m_ReslicingMode;
659
ReslicerPlaneSpatialObject::OrientationType
660
ReslicerPlaneSpatialObject
661
::GetOrientationType() const
663
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
664
::GetOrientationType called...\n");
666
return m_OrientationType;
670
ReslicerPlaneSpatialObject
671
::ReportReslicingPlaneParametersProcessing()
673
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
674
::ReportReslicingPlaneParametersProcessing called...\n");
676
ReslicerPlaneCenterEvent pcEvent;
677
pcEvent.Set( m_PlaneCenter );
678
this->InvokeEvent( pcEvent );
680
ReslicerPlaneNormalEvent pnEvent;
681
pnEvent.Set( m_PlaneNormal );
682
this->InvokeEvent( pnEvent );
687
ReslicerPlaneSpatialObject
688
::RequestSetCursorPosition( const double *point )
690
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
691
::RequestSetCursorPosition called...\n");
693
m_CursorPositionToBeSet[0] = point[0];
694
m_CursorPositionToBeSet[1] = point[1];
695
m_CursorPositionToBeSet[2] = point[2];
697
m_StateMachine.PushInput( m_SetCursorPositionInput );
699
m_StateMachine.ProcessInputs();
703
ReslicerPlaneSpatialObject
704
::AttemptSetCursorPositionProcessing()
707
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
708
::AttemptSetCursorPositionProcessing called...\n");
710
bool validPosition = false;
712
switch( m_OrientationType )
715
if( m_CursorPositionToBeSet[2] >= m_Bounds[4] &&
716
m_CursorPositionToBeSet[2] <= m_Bounds[5] )
718
validPosition = true;
722
if( m_CursorPositionToBeSet[0] >= m_Bounds[0] &&
723
m_CursorPositionToBeSet[0] <= m_Bounds[1] )
725
validPosition = true;
729
if( m_CursorPositionToBeSet[1] >= m_Bounds[2] &&
730
m_CursorPositionToBeSet[1] <= m_Bounds[3] )
732
validPosition = true;
737
validPosition = false;
743
igstkPushInputMacro( ValidCursorPosition );
747
igstkPushInputMacro( InValidCursorPosition );
750
m_StateMachine.ProcessInputs();
754
ReslicerPlaneSpatialObject
755
::SetCursorPositionProcessing()
757
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject\
758
::SetCursorPosition called...\n");
760
m_CursorPosition[0] = m_CursorPositionToBeSet[0];
761
m_CursorPosition[1] = m_CursorPositionToBeSet[1];
762
m_CursorPosition[2] = m_CursorPositionToBeSet[2];
764
m_ToolPosition[0] = m_CursorPosition[0];
765
m_ToolPosition[1] = m_CursorPosition[1];
766
m_ToolPosition[2] = m_CursorPosition[2];
769
m_CursorPositionSetFlag = true;
773
ReslicerPlaneSpatialObject
774
::SetReslicingModeProcessing()
776
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
777
::SetReslicingModeProcessing called...\n");
778
m_ReslicingMode = m_ReslicingModeToBeSet;
782
ReslicerPlaneSpatialObject
783
::RequestSetOrientationType( OrientationType orientationType )
785
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
786
::RequestSetOrientationType called...\n");
788
m_OrientationTypeToBeSet = orientationType;
790
bool validOrientation = true;
792
if( m_ReslicingMode == Orthogonal )
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 )
801
validOrientation = false;
805
if( m_ReslicingMode == Oblique )
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 )
814
validOrientation = false;
818
if( m_ReslicingMode == OffOrthogonal )
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 )
827
validOrientation = false;
831
if ( validOrientation )
833
m_StateMachine.PushInput( m_ValidOrientationTypeInput );
837
m_StateMachine.PushInput( m_InValidOrientationTypeInput );
840
m_StateMachine.ProcessInputs();
844
ReslicerPlaneSpatialObject
845
::SetOrientationTypeProcessing()
847
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
848
::SetOrientationTypeProcessing called...\n");
849
m_OrientationType = m_OrientationTypeToBeSet;
853
ReslicerPlaneSpatialObject
854
::RequestSetBoundingBoxProviderSpatialObject(
855
const BoundingBoxProviderSpatialObjectType* spatialObject )
857
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
858
::RequestSetBoundingBoxProviderSpatialObject called...\n");
860
m_BoundingBoxProviderSpatialObjectToBeSet =
861
const_cast< BoundingBoxProviderSpatialObjectType* >(spatialObject);
863
m_StateMachine.PushInput( m_SetBoundingBoxProviderSpatialObjectInput );
865
m_StateMachine.ProcessInputs();
869
ReslicerPlaneSpatialObject
870
::AttemptSetBoundingBoxProviderSpatialObjectProcessing( )
872
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
873
::AttemptSetBoundingBoxProviderSpatialObject called...\n");
875
if( !m_BoundingBoxProviderSpatialObjectToBeSet )
877
m_StateMachine.PushInput( m_InValidBoundingBoxProviderSpatialObjectInput );
881
m_StateMachine.PushInput( m_ValidBoundingBoxProviderSpatialObjectInput );
884
m_StateMachine.ProcessInputs();
888
ReslicerPlaneSpatialObject
889
::SetBoundingBoxProviderSpatialObjectProcessing( )
891
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
892
::SetBoundingBoxProviderSpatialObjectProcessing called...\n");
894
m_BoundingBoxProviderSpatialObject= m_BoundingBoxProviderSpatialObjectToBeSet;
896
// get the bounding box from the reference spatial object
897
BoundingBoxObserver::Pointer boundingBoxObserver = BoundingBoxObserver::New();
898
boundingBoxObserver->Reset();
900
unsigned long boundingBoxObserverID =
901
m_BoundingBoxProviderSpatialObject->AddObserver(
902
BoundingBoxProviderSpatialObjectType::BoundingBoxEvent(),
903
boundingBoxObserver );
904
m_BoundingBoxProviderSpatialObject->RequestGetBounds();
906
if( !boundingBoxObserver->GotBoundingBox() )
909
m_BoundingBox = boundingBoxObserver->GetBoundingBox();
911
if ( m_BoundingBox.IsNull() )
914
m_BoundingBoxProviderSpatialObject->RemoveObserver( boundingBoxObserverID );
916
const BoundingBoxType::BoundsArrayType &bounds = m_BoundingBox->GetBounds();
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];
925
for ( unsigned int i = 0; i <= 4; i += 2 ) // reverse bounds if necessary
927
if ( m_Bounds[i] > m_Bounds[i+1] )
929
double t = m_Bounds[i+1];
930
m_Bounds[i+1] = m_Bounds[i];
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]);
940
m_PlaneCenter[0] = m_ToolPosition[0];
941
m_PlaneCenter[1] = m_ToolPosition[1];
942
m_PlaneCenter[2] = m_ToolPosition[2];
947
ReslicerPlaneSpatialObject
948
::ReportInvalidBoundingBoxProviderSpatialObjectProcessing( )
950
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
951
::ReportInvalidBoundingBoxProviderSpatialObjectProcessing called...\n");
955
ReslicerPlaneSpatialObject
956
::ReportInvalidCursorPositionProcessing( )
958
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
959
::ReportInvalidCursorPositionProcessing called...\n");
963
ReslicerPlaneSpatialObject
964
::RequestSetToolSpatialObject( const ToolSpatialObjectType * toolSpatialObject )
966
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
967
::RequestSetToolSpatialObject called...\n");
969
m_ToolSpatialObjectToBeSet = const_cast< ToolSpatialObjectType *>(
972
if( !m_ToolSpatialObjectToBeSet )
974
m_StateMachine.PushInput( m_InValidToolSpatialObjectInput );
978
m_StateMachine.PushInput( m_ValidToolSpatialObjectInput );
981
m_StateMachine.ProcessInputs();
985
ReslicerPlaneSpatialObject
986
::SetToolSpatialObjectProcessing( )
988
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
989
::SetToolSpatialObjectProcessing called...\n");
991
m_ToolSpatialObject = m_ToolSpatialObjectToBeSet;
992
this->ObserveToolTransformWRTImageCoordinateSystemInput(
993
this->m_ToolSpatialObject );
994
m_ToolSpatialObjectSet = true;
998
ReslicerPlaneSpatialObject
999
::ReportInvalidToolSpatialObjectProcessing( )
1001
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
1002
::ReportInvalidToolSpatialObjectProcessing called...\n");
1006
ReslicerPlaneSpatialObject
1007
::RequestUpdateToolTransformWRTImageCoordinateSystem()
1009
igstkLogMacro( DEBUG,
1010
"igstk::ReslicerPlaneSpatialObject::\
1011
RequestUpdateToolTransformWRTImageCoordinateSystem called ...\n");
1013
igstkPushInputMacro( GetToolTransformWRTImageCoordinateSystem );
1014
this->m_StateMachine.ProcessInputs();
1017
/** Request to receive the tool transform WRT reference spatial object
1018
* coordinate system */
1020
ReslicerPlaneSpatialObject
1021
::RequestGetToolTransformWRTImageCoordinateSystemProcessing()
1023
igstkLogMacro( DEBUG,
1024
"igstk::ReslicerPlaneSpatialObject::\
1025
RequestGetToolTransformWRTImageCoordinateSystemProcessing called ...\n");
1027
typedef igstk::Friends::CoordinateSystemHelper CoordinateSystemHelperType;
1029
const CoordinateSystem* ImageSpatialObjectCoordinateSystem =
1030
CoordinateSystemHelperType::GetCoordinateSystem(
1031
m_BoundingBoxProviderSpatialObject );
1033
CoordinateSystem * ImageSpatialObjectCoordinateSystemNC =
1034
const_cast< CoordinateSystem *>(ImageSpatialObjectCoordinateSystem);
1036
m_ToolSpatialObject->RequestComputeTransformTo(
1037
ImageSpatialObjectCoordinateSystemNC );
1040
/** Receive the tool spatial object transform WRT reference sapatial object
1041
* coordinate system using a transduction macro */
1043
ReslicerPlaneSpatialObject
1044
::ReceiveToolTransformWRTImageCoordinateSystemProcessing()
1046
igstkLogMacro( DEBUG, "ReceiveToolTransformWRTImageCoordinateSystemProcessing"
1047
<< this->m_ToolTransformWRTImageCoordinateSystem );
1049
this->m_ToolTransformWRTImageCoordinateSystem =
1050
this->m_ToolTransformWRTImageCoordinateSystemInputToBeSet.GetTransform();
1053
/** Request compute reslicing plane */
1055
ReslicerPlaneSpatialObject
1056
::RequestComputeReslicingPlane( )
1058
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
1059
::RequestComputeReslicingPlane called...\n");
1061
igstkPushInputMacro( ComputeReslicePlane );
1062
m_StateMachine.ProcessInputs();
1066
/** Compute reslicing plane */
1068
ReslicerPlaneSpatialObject
1069
::ComputeReslicePlaneProcessing()
1071
//Update the tool transform if tool spatial object provided
1072
if ( m_ToolSpatialObject )
1074
this->RequestUpdateToolTransformWRTImageCoordinateSystem();
1077
switch( m_ReslicingMode )
1081
this->ComputeOrthogonalReslicingPlane();
1086
this->ComputeObliqueReslicingPlane();
1091
this->ComputeOffOrthogonalReslicingPlane();
1099
/**Compute orthgonal reslicing plane */
1101
ReslicerPlaneSpatialObject
1102
::ComputeOrthogonalReslicingPlane( )
1104
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
1105
::ComputeOrthogonalReslicingPlane called...\n");
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 )
1111
VectorType translation;
1112
translation = m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
1114
m_ToolPosition[0] = translation[0];
1115
m_ToolPosition[1] = translation[1];
1116
m_ToolPosition[2] = translation[2];
1118
m_PlaneCenter[0] = translation[0];
1119
m_PlaneCenter[1] = translation[1];
1120
m_PlaneCenter[2] = translation[2];
1122
switch( m_OrientationType )
1126
m_PlaneNormal[0] = 0.0;
1127
m_PlaneNormal[1] = 0.0;
1128
m_PlaneNormal[2] = 1.0;
1130
m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
1131
m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
1138
m_PlaneNormal[0] = 1.0;
1139
m_PlaneNormal[1] = 0.0;
1140
m_PlaneNormal[2] = 0.0;
1142
m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
1143
m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
1150
m_PlaneNormal[0] = 0.0;
1151
m_PlaneNormal[1] = 1.0;
1152
m_PlaneNormal[2] = 0.0;
1154
m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
1155
m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
1162
std::cerr << "Invalid orientation type " << std::endl;
1169
// Otherwise, use the cursor postion and image bounds to set the center
1170
switch( m_OrientationType )
1174
m_PlaneNormal[0] = 0.0;
1175
m_PlaneNormal[1] = 0.0;
1176
m_PlaneNormal[2] = 1.0;
1178
m_PlaneCenter[0] = 0.5*(m_Bounds[0] + m_Bounds[1]);
1179
m_PlaneCenter[1] = 0.5*(m_Bounds[2] + m_Bounds[3]);
1181
if ( m_CursorPositionSetFlag )
1183
m_PlaneCenter[2] = m_CursorPosition[2];
1184
m_ToolPosition[2] = m_CursorPosition[2];
1185
m_CursorPositionSetFlag = false;
1191
m_PlaneNormal[0] = 1.0;
1192
m_PlaneNormal[1] = 0.0;
1193
m_PlaneNormal[2] = 0.0;
1195
m_PlaneCenter[1] = 0.5*(m_Bounds[2] + m_Bounds[3]);
1196
m_PlaneCenter[2] = 0.5*(m_Bounds[4] + m_Bounds[5]);
1198
if ( m_CursorPositionSetFlag )
1200
m_PlaneCenter[0] = m_CursorPosition[0];
1201
m_ToolPosition[0] = m_CursorPosition[0];
1202
m_CursorPositionSetFlag = false;
1208
m_PlaneNormal[0] = 0.0;
1209
m_PlaneNormal[1] = 1.0;
1210
m_PlaneNormal[2] = 0.0;
1212
m_PlaneCenter[0] = 0.5*(m_Bounds[0] + m_Bounds[1]);
1213
m_PlaneCenter[2] = 0.5*(m_Bounds[4] + m_Bounds[5]);
1215
if ( m_CursorPositionSetFlag )
1217
m_PlaneCenter[1] = m_CursorPosition[1];
1218
m_ToolPosition[1] = m_CursorPosition[1];
1219
m_CursorPositionSetFlag = false;
1225
std::cerr << "Invalid orientaiton" << std::endl;
1232
/**Compute oblique reslicing plane */
1234
ReslicerPlaneSpatialObject
1235
::ComputeObliqueReslicingPlane( )
1237
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
1238
::ComputeObliqueReslicingPlane called...\n");
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)
1244
const VersorType& rotation =
1245
m_ToolTransformWRTImageCoordinateSystem.GetRotation();
1247
VectorType v1, v2, vn;
1250
vn = rotation.Transform(vn);
1252
const VectorType& translation =
1253
m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
1255
m_ToolPosition[0] = translation[0];
1256
m_ToolPosition[1] = translation[1];
1257
m_ToolPosition[2] = translation[2];
1259
m_PlaneCenter[0] = translation[0];
1260
m_PlaneCenter[1] = translation[1];
1261
m_PlaneCenter[2] = translation[2];
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 ...
1270
// get a second normal vector
1271
v2 = itk::CrossProduct( v1, vn );
1273
switch( m_OrientationType )
1275
case PlaneOrientationWithXAxesNormal:
1281
case PlaneOrientationWithYAxesNormal:
1287
case PlaneOrientationWithZAxesNormal:
1295
std::cerr << "Invalid orientation" << std::endl;
1301
/**Compute off-orthgonal reslicing plane */
1303
ReslicerPlaneSpatialObject
1304
::ComputeOffOrthogonalReslicingPlane( )
1306
igstkLogMacro( DEBUG,"igstk::ReslicerPlaneSpatialObject\
1307
::ComputeOffOrthogonalReslicingPlane called...\n");
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)
1313
const VersorType& rotation =
1314
m_ToolTransformWRTImageCoordinateSystem.GetRotation();
1320
vn = rotation.Transform(vn);
1322
const VectorType& translation =
1323
m_ToolTransformWRTImageCoordinateSystem.GetTranslation();
1325
m_ToolPosition[0] = translation[0];
1326
m_ToolPosition[1] = translation[1];
1327
m_ToolPosition[2] = translation[2];
1329
m_PlaneCenter[0] = translation[0];
1330
m_PlaneCenter[1] = translation[1];
1331
m_PlaneCenter[2] = translation[2];
1333
switch( m_OrientationType )
1340
if ( fabs(v1*vn) < 1e-9 )
1342
// FIXME: need to handle this situation too
1343
igstkLogMacro( DEBUG, "The two vectors are parallel \n");
1346
vn = itk::CrossProduct( v1, vn );
1349
m_PlaneCenter[0] = 0.5*(m_Bounds[0]+m_Bounds[1]);
1361
if ( fabs(v1*vn) < 1e-9 )
1363
// FIXME: need to handle this situation too
1364
igstkLogMacro( DEBUG, "The two vectors are parallel \n");
1367
vn = itk::CrossProduct( v1, vn );
1372
m_PlaneCenter[2] = 0.5*(m_Bounds[4]+m_Bounds[5]);
1382
if ( fabs(v1*vn) < 1e-9 )
1384
// FIXME: need to handle this situation too
1385
igstkLogMacro( DEBUG, "The two vectors are parallel \n");
1388
vn = itk::CrossProduct( v1, vn );
1393
m_PlaneCenter[1] = 0.5*(m_Bounds[2]+m_Bounds[3]);
1400
std::cerr << "Invalid orientation" << std::endl;
1406
/** Report invalid reslicing mode */
1408
ReslicerPlaneSpatialObject
1409
::ReportInvalidReslicingModeProcessing( void )
1411
igstkLogMacro( WARNING, "igstk::ReslicerPlaneSpatialObject::\
1412
ReportInvalidReslicingModeProcessing called...\n");
1415
/** Report invalid orientation type */
1417
ReslicerPlaneSpatialObject
1418
::ReportInvalidOrientationTypeProcessing( void )
1420
igstkLogMacro( WARNING, "igstk::ReslicerPlaneSpatialObject::\
1421
ReportInvalidOrientationTypeProcessing called...\n");
1424
/** Report invalid request */
1426
ReslicerPlaneSpatialObject
1427
::ReportInvalidRequestProcessing( void )
1429
igstkLogMacro( DEBUG, "igstk::ReslicerPlaneSpatialObject::\
1430
ReportInvalidRequestProcessing called...\n");
1432
this->InvokeEvent( InvalidRequestErrorEvent() );
1435
/** Get tool transform WRT Image Coordinate System */
1437
ReslicerPlaneSpatialObject
1438
::GetToolTransform( ) const
1440
return this->m_ToolTransformWRTImageCoordinateSystem;
1443
//todo: get tool position as an event
1444
ReslicerPlaneSpatialObject::VectorType
1445
ReslicerPlaneSpatialObject
1446
::GetToolPosition() const
1448
return m_ToolPosition;
1451
/** Check if tool spatial object is set to drive the reslicing */
1453
ReslicerPlaneSpatialObject
1454
::IsToolSpatialObjectSet( )
1456
return this->m_ToolSpatialObjectSet;
1459
/** Print object information */
1461
ReslicerPlaneSpatialObject
1462
::PrintSelf( std::ostream& os, itk::Indent indent ) const
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;
1484
os << indent << "Reslicing mode:" << std::endl;
1486
if( m_ReslicingMode == Orthogonal )
1488
os << indent << "Orthogonal" << std::endl;
1490
if( m_ReslicingMode == OffOrthogonal )
1492
os << indent << "OffOrthogonal" << std::endl;
1494
if( m_ReslicingMode == Oblique )
1496
os << indent << "Oblique" << std::endl;
1499
os << indent << "Orientation type:" << std::endl;
1501
if( m_OrientationType == Axial )
1503
os << indent << "Axial" << std::endl;
1505
if( m_OrientationType == Sagittal )
1507
os << indent << "Sagittal" << std::endl;
1509
if( m_OrientationType == Coronal )
1511
os << indent << "Coronal" << std::endl;
1514
if( m_OrientationType == OffAxial )
1516
os << indent << "OffAxial" << std::endl;
1518
if( m_OrientationType == OffSagittal )
1520
os << indent << "OffSagittal" << std::endl;
1522
if( m_OrientationType == OffCoronal )
1524
os << indent << "OffCoronal" << std::endl;
1527
if( m_OrientationType == PlaneOrientationWithZAxesNormal )
1529
os << indent << "PlaneOrientationWithZAxesNormal" << std::endl;
1531
if( m_OrientationType == PlaneOrientationWithXAxesNormal )
1533
os << indent << "PlaneOrientationWithXAxesNormal" << std::endl;
1535
if( m_OrientationType == PlaneOrientationWithYAxesNormal )
1537
os << indent << "PlaneOrientationWithYAxesNormal" << std::endl;
1541
} // end namespace igstk