SliceViewerPanelSource.m 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. classdef SliceViewerPanelSource < handle
  2. %SliceViewerPanelSource Root object of SliceViewerPanels
  3. %
  4. % SliceViewerPanelSource is used to store properties shared between a group of
  5. % SliceViewerPanel objects.
  6. %
  7. % See also XTPS, SliceViewerPanel
  8. %
  9. % Copyright Xiaohu Mo
  10. %%
  11. properties (SetObservable, AbortSet)
  12. POI = [1 1 1] % point of intersection
  13. Geometry % struct of various geometry data and settings
  14. % .ROIS % N x 1 cell array of ROI data
  15. % .name % char array, ROI name
  16. % .visible bool
  17. % .color N x 3 float between [0 1], RGB color
  18. optResults
  19. dosedisp % struct of dose display settings
  20. % .mode: consistant with DoseMode dropdown box
  21. % .color: N x 3, float between [0 1]
  22. % .level: N x 1, dose level in Gy
  23. % .alpha: N x 1
  24. ctWindow % struct of window width/window level
  25. % .ww: scalar
  26. % .wl: scalar
  27. hXTPS
  28. TCSVisible % true/false toggle
  29. end
  30. properties (Dependent)
  31. ctClim % calculated based on windowlevel
  32. end
  33. properties (SetAccess = private)
  34. prev_POI = [1 1 1] % used to avoid unnecessary redraws by comparing with new POI
  35. end
  36. %===============================================================================
  37. methods
  38. %-------------------------------------------------------------------------------
  39. function obj = SliceViewerPanelSource() % Constructor returns object
  40. num_dose_lvs = 10;
  41. obj.dosedisp = struct('mode', 'None', ...
  42. 'color', rand(num_dose_lvs,3), ...
  43. 'level', zeros(num_dose_lvs,1), ...
  44. 'alpha', ones(num_dose_lvs,1));
  45. obj.ctWindow = struct('ww', 600, 'wl', 1000);
  46. end
  47. %-------------------------------------------------------------------------------
  48. function set.POI(obj, value)
  49. obj.prev_POI = obj.POI;
  50. obj.POI = value;
  51. end
  52. %-------------------------------------------------------------------------------
  53. function clim = get.ctClim(obj)
  54. clim = [obj.ctWindow.wl-obj.ctWindow.ww/2 obj.ctWindow.wl+obj.ctWindow.ww/2];
  55. end
  56. end
  57. %===============================================================================
  58. end