-
Notifications
You must be signed in to change notification settings - Fork 217
/
CPRController.h
269 lines (227 loc) · 9.58 KB
/
CPRController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/*=========================================================================
Program: OsiriX
Copyright (c) OsiriX Team
All rights reserved.
Distributed under GNU - LGPL
See http://www.osirix-viewer.com/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#import <Cocoa/Cocoa.h>
#import "OSIWindowController.h"
#import "CPRMPRDCMView.h"
#import "VRController.h"
#import "VRView.h"
#import "FlyAssistant.h"
enum _ViewsPosition {
NormalPosition = 0,
HorizontalPosition = 1,
VerticalPosition = 2
};
typedef NSInteger ViewsPosition;
enum _CPRType {
CPRStraightenedType = 0,
CPRStretchedType = 1
};
typedef NSInteger CPRType;
enum _CPRExportImageFormat {
CPR8BitRGBExportImageFormat = 0,
CPR16BitExportImageFormat = 1,
};
typedef NSInteger CPRExportImageFormat;
enum _CPRExportSequenceType {
CPRCurrentOnlyExportSequenceType = 0,
CPRSeriesExportSequenceType = 1,
};
typedef NSInteger CPRExportSequenceType;
enum _CPRExportSeriesType {
CPRRotationExportSeriesType = 0,
CPRSlabExportSeriesType = 1,
CPRTransverseViewsExportSeriesType = 2
};
typedef NSInteger CPRExportSeriesType;
enum _CPRExportRotationSpan {
CPR180ExportRotationSpan = 0,
CPR360ExportRotationSpan = 1,
};
typedef NSInteger CPRExportRotationSpan;
@class CPRMPRDCMView;
@class CPRView;
@class CPRCurvedPath;
@class CPRDisplayInfo;
@class CPRTransverseView;
@class CPRVolumeData;
@interface CPRController : Window3DController <CPRViewDelegate, NSToolbarDelegate, NSSplitViewDelegate>
{
// To avoid the Cocoa bindings memory leak bug...
IBOutlet NSObjectController *ob;
// To be able to use Cocoa bindings with toolbar...
IBOutlet NSView *tbLOD, *tbThickSlab, *tbWLWW, *tbTools, *tbShading, *tbMovie, *tbBlending, *tbSyncZoomLevel, *tbHighResolution;
IBOutlet NSView *tbPathAssistant;
IBOutlet NSView *testView;
NSToolbar *toolbar;
IBOutlet NSMatrix *toolsMatrix;
IBOutlet NSPopUpButton *popupRoi;
IBOutlet CPRMPRDCMView *mprView1, *mprView2, *mprView3;
IBOutlet CPRView *cprView;
IBOutlet CPRTransverseView *topTransverseView, *middleTransverseView, *bottomTransverseView;
IBOutlet NSSplitView *horizontalSplit1, *horizontalSplit2, *verticalSplit;
IBOutlet NSView *tbStraightenedCPRAngle;
double straightenedCPRAngle; // this is in degrees, the CPRView uses radians
IBOutlet NSView *tbCPRType, *tbViewsPosition, *tbCPRPathMode;
CPRType cprType;
ViewsPosition viewsPosition;
CPRVolumeData *cprVolumeData;
CPRCurvedPath *curvedPath;
CPRDisplayInfo *displayInfo;
N3Vector baseNormal; // this value will depend on which view gets clicked first, it will be used as the basis for deciding what normal to use for what angle
NSColor *curvedPathColor;
BOOL curvedPathCreationMode;
// Fly Assistant and CurvedPath simplification
FlyAssistant * assistant;
NSMutableArray * centerline;
NSMutableArray * nodeRemovalCost;
NSMutableArray * delHistory;
NSMutableArray * delNodes;
IBOutlet NSSlider *pathSimplificationSlider;
// Blending
DCMView *blendedMprView1, *blendedMprView2, *blendedMprView3;
float blendingPercentage;
int blendingMode;
BOOL blendingModeAvailable;
NSString *startingOpacityMenu;
NSMutableArray *undoQueue, *redoQueue;
ViewerController *viewer2D, *fusedViewer2D;
VRController *hiddenVRController;
VRView *hiddenVRView;
NSMutableArray *HR_PixList, *HR_FileList;
NSData *HR_Data;
NSMutableArray *filesList[ MAX4D], *pixList[ MAX4D];
DCMPix *originalPix;
NSData *volumeData[ MAX4D];
BOOL avoidReentry;
BOOL highResolutionMode;
// 4D Data support
NSTimeInterval lastMovieTime;
NSTimer *movieTimer;
int curMovieIndex, maxMovieIndex;
float movieRate;
IBOutlet NSSlider *moviePosSlider;
Point3D *mousePosition;
int mouseViewID;
BOOL displayMousePosition;
// Export Dcm & Quicktime
IBOutlet NSWindow *dcmWindow;
IBOutlet NSWindow *quicktimeWindow;
IBOutlet NSView *dcmSeriesView;
CPRMPRDCMView *curExportView;
BOOL quicktimeExportMode;
NSMutableArray *qtFileArray;
NSString *exportSeriesName;
CPRExportImageFormat exportImageFormat;
CPRExportSequenceType exportSequenceType;
CPRExportSeriesType exportSeriesType;
CPRExportRotationSpan exportRotationSpan;
BOOL exportReverseSliceOrder;
NSInteger exportNumberOfRotationFrames;
CGFloat exportSlabThickness;
BOOL exportSliceIntervalSameAsVolumeSliceInterval;
CGFloat exportSliceInterval, exportTransverseSliceInterval;
// int dcmmN;
// Clipping Range
float dcmIntervalMin, dcmIntervalMax;
float clippingRangeThickness;
int clippingRangeMode;
NSArray *wlwwMenuItems;
float LOD;
BOOL lowLOD;
IBOutlet NSPanel *shadingPanel;
IBOutlet ShadingArrayController *shadingsPresetsController;
BOOL shadingEditable;
IBOutlet NSButton *shadingCheck;
IBOutlet NSTextField *shadingValues;
IBOutlet NSView *tbAxisColors;
NSColor *colorAxis1, *colorAxis2, *colorAxis3;
NSMutableArray *_delegateCurveViewDebugging;
NSMutableArray *_delegateDisplayInfoDebugging;
}
@property (nonatomic) float clippingRangeThickness, dcmIntervalMin, dcmIntervalMax, blendingPercentage;
@property (nonatomic) int clippingRangeMode, mouseViewID;
@property (nonatomic) int curMovieIndex, maxMovieIndex, blendingMode;
@property (nonatomic, retain) Point3D *mousePosition;
@property (retain) NSArray *wlwwMenuItems;
@property (readonly) DCMPix *originalPix;
@property (readonly) CPRTransverseView *topTransverseView, *middleTransverseView, *bottomTransverseView;
@property (nonatomic) float LOD, movieRate;
@property BOOL lowLOD, displayMousePosition, blendingModeAvailable;
@property (nonatomic, retain) NSColor *colorAxis1, *colorAxis2, *colorAxis3;
@property (readonly) CPRMPRDCMView *mprView1, *mprView2, *mprView3;
@property (readonly) NSSplitView *horizontalSplit1, *horizontalSplit2, *verticalSplit;
@property (nonatomic, readonly, copy) CPRCurvedPath *curvedPath;
@property (readonly, copy) CPRDisplayInfo *displayInfo;
@property (nonatomic) BOOL curvedPathCreationMode, highResolutionMode;
@property (retain) NSColor *curvedPathColor;
@property (nonatomic) double straightenedCPRAngle;
@property (nonatomic) CPRType cprType;
@property (nonatomic) ViewsPosition viewsPosition;
@property (nonatomic, readonly) CPRView *cprView;
//@property (nonatomic) BOOL assistantPathMode;3
// export related properties
@property (nonatomic, retain) NSString *exportSeriesName;
@property (nonatomic) CPRExportImageFormat exportImageFormat;
@property (nonatomic) CPRExportSequenceType exportSequenceType;
@property (nonatomic) CPRExportSeriesType exportSeriesType;
@property (nonatomic) CPRExportRotationSpan exportRotationSpan;
@property (nonatomic) BOOL exportReverseSliceOrder;
@property (nonatomic) NSInteger exportNumberOfRotationFrames;
@property (nonatomic) CGFloat exportSlabThickness;
@property (nonatomic) BOOL exportSliceIntervalSameAsVolumeSliceInterval;
@property (nonatomic) CGFloat exportSliceInterval, exportTransverseSliceInterval;
@property (nonatomic, readonly) NSInteger exportSequenceNumberOfFrames;
+ (double) angleBetweenVector:(float*) a andPlane:(float*) orientation;
- (id)initWithDCMPixList:(NSMutableArray*)pix filesList:(NSMutableArray*)files volumeData:(NSData*)volume viewerController:(ViewerController*)viewer fusedViewerController:(ViewerController*)fusedViewer;
- (DCMPix*) emptyPix: (DCMPix*) originalPix width: (long) w height: (long) h;
- (CPRMPRDCMView*) selectedView;
- (id) selectedViewOnlyMPRView: (BOOL) onlyMPRView;
- (void) computeCrossReferenceLines:(CPRMPRDCMView*) sender;
- (IBAction)setTool:(id)sender;
- (void) setToolIndex: (int) toolIndex;
- (float) getClippingRangeThicknessInMm;
- (void) propagateWLWW:(DCMView*) sender;
- (void) propagateOriginRotationAndZoomToTransverseViews: (CPRTransverseView*) sender;
- (void)bringToFrontROI:(ROI*) roi;
- (id) prepareObjectForUndo:(NSString*) string;
- (void)createWLWWMenuItems;
- (void)UpdateWLWWMenu:(NSNotification*)note;
- (void)ApplyWLWW:(id)sender;
- (void)applyWLWWForString:(NSString *)menuString;
- (void) updateViewsAccordingToFrame:(id) sender;
- (void)findShadingPreset:(id) sender;
- (IBAction)editShadingValues:(id) sender;
- (void) moviePlayStop:(id) sender;
- (IBAction) endDCMExportSettings:(id) sender;
- (void) addMoviePixList:(NSMutableArray*) pix :(NSData*) vData;
- (void)updateToolbarItems;
- (void)toogleAxisVisibility:(id) sender;
- (BOOL) getMovieDataAvailable;
- (void)Apply3DOpacityString:(NSString*)str;
- (void)Apply2DOpacityString:(NSString*)str;
- (NSImage*) imageForROI: (int) i;
- (void) setROIToolTag:(int) roitype;
- (IBAction) roiGetInfo:(id) sender;
- (void) delayedFullLODRendering: (id) sender;
- (IBAction) saveBezierPath: (id) sender;
- (IBAction) loadBezierPath: (id) sender;
- (void) saveBezierPathToFile:(NSString*) f;
- (void) loadBezierPathFromFile:(NSString*) f;
- (NSDictionary*)exportDCMImage16bitWithWidth:(NSUInteger)width height:(NSUInteger)height fullDepth:(BOOL)fullDepth withDicomExport:(DICOMExport *)dicomExport; // dicomExport can be nil
- (void) setupToolbar;
- (void)removeNode;
- (void)undoLastNodeRemoval;
- (void)updateCurvedPathCost;
- (void)resetSlider;
- (IBAction)runFlyAssistant:(id)sender;
- (IBAction)onSliderMove:(id)sender;
- (float) costFunction:(NSUInteger)index;
@end