Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLScalarVolumeDisplayNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLScalarVolumeDisplayNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLScalarVolumeDisplayNode_h
16 #define __vtkMRMLScalarVolumeDisplayNode_h
17 
18 // MRML includes
20 
21 // VTK includes
22 class vtkImageAlgorithm;
23 class vtkImageAccumulate;
24 class vtkImageAppendComponents;
26 class vtkImageCast;
27 class vtkImageLogic;
28 class vtkImageMapToColors;
29 class vtkImageMapToWindowLevelColors;
30 class vtkImageStencil;
31 class vtkImageThreshold;
32 class vtkImageExtractComponents;
33 class vtkImageMathematics;
34 
35 // STD includes
36 #include <vector>
37 
42 {
43  public:
44  static vtkMRMLScalarVolumeDisplayNode *New();
46  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
47 
48  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
49 
52  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
53 
56  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
57 
60  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
61 
64  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "VolumeDisplay";}
65 
66 
67  //--------------------------------------------------------------------------
69  //--------------------------------------------------------------------------
70 
73  vtkGetMacro(WindowLevelLocked, bool);
74  vtkSetMacro(WindowLevelLocked, bool);
75 
78  vtkBooleanMacro(AutoWindowLevel, int);
79  vtkGetMacro(AutoWindowLevel, int);
80  vtkSetMacro(AutoWindowLevel, int);
81 
84  double GetWindow();
85  virtual void SetWindow(double);
86 
89  double GetLevel();
90  virtual void SetLevel(double);
91 
94  virtual void SetWindowLevel(double window, double level);
97  void SetWindowLevelMinMax(double min, double max);
98 
100  double GetWindowLevelMin();
102  double GetWindowLevelMax();
103 
106  vtkBooleanMacro(ApplyThreshold, int);
107  vtkGetMacro(ApplyThreshold, int);
108  virtual void SetApplyThreshold(int);
109 
112  vtkBooleanMacro(AutoThreshold, int);
113  vtkGetMacro(AutoThreshold, int);
114  vtkSetMacro(AutoThreshold, int);
115 
119  virtual double GetLowerThreshold();
120  virtual void SetLowerThreshold(double lower);
121 
125  virtual double GetUpperThreshold();
126  virtual void SetUpperThreshold(double upper);
127 
128  virtual void SetThreshold(double lower, double upper);
129 
132  vtkGetMacro(Interpolate, int);
133  vtkSetMacro(Interpolate, int);
134  vtkBooleanMacro(Interpolate, int);
135 
136  virtual void SetDefaultColorMap() VTK_OVERRIDE;
137 
140  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
141  unsigned long /*event*/,
142  void * /*callData*/ ) VTK_OVERRIDE;
143 
145  virtual void SetInputImageDataConnection(vtkAlgorithmOutput *imageDataConnection) VTK_OVERRIDE;
146 
148  virtual vtkAlgorithmOutput* GetInputImageDataConnection() VTK_OVERRIDE;
149 
151  virtual vtkAlgorithmOutput* GetOutputImageDataConnection() VTK_OVERRIDE;
152 
155  virtual void SetBackgroundImageStencilDataConnection(vtkAlgorithmOutput *imageDataConnection) VTK_OVERRIDE;
156  virtual vtkAlgorithmOutput* GetBackgroundImageStencilDataConnection() VTK_OVERRIDE;
157 
160  void AddWindowLevelPresetFromString(const char *preset);
163  void AddWindowLevelPreset(double window, double level);
164 
167  void ResetWindowLevelPresets();
168 
171  void SetWindowLevelFromPreset(int p);
172 
175  int GetNumberOfWindowLevelPresets();
176 
179  double GetWindowPreset(int p);
180  double GetLevelPreset(int p);
181 
187  virtual void GetDisplayScalarRange(double range[2]);
188 
189 protected:
194 
195  virtual void SetColorNodeInternal(vtkMRMLColorNode* newColorNode) VTK_OVERRIDE;
196  void UpdateLookupTable(vtkMRMLColorNode* newColorNode);
197  void CalculateAutoLevels();
198 
201  vtkImageData* GetScalarImageData();
202  virtual vtkAlgorithmOutput* GetScalarImageDataConnection();
203 
204  virtual void SetInputToImageDataPipeline(vtkAlgorithmOutput *imageDataConnection) VTK_OVERRIDE;
205 
211  {
212  public:
213  double Window;
214  double Level;
215  WindowLevelPreset() { this->Window = 0.0; this->Level = 0.0; };
216  };
217  //double Window;
218  //double Level;
219  //double UpperThreshold;
220  //double LowerThreshold;
221 
222 
229 
230  vtkImageLogic *AlphaLogic;
231  vtkImageMapToColors *MapToColors;
232  vtkImageThreshold *Threshold;
233  vtkImageAppendComponents *AppendComponents;
234  vtkImageMapToWindowLevelColors *MapToWindowLevelColors;
235  vtkImageExtractComponents *ExtractRGB;
236  vtkImageExtractComponents *ExtractAlpha;
237  vtkImageStencil *MultiplyAlpha;
238 
241  std::vector<WindowLevelPreset> WindowLevelPresets;
242 
245  vtkImageAccumulate *Accumulate;
248 };
249 
250 #endif
virtual void ProcessMRMLEvents(vtkObject *, unsigned long, void *) VTK_OVERRIDE
alternative method to propagate events generated in Display nodes
virtual void SetInputImageDataConnection(vtkAlgorithmOutput *imageDataConnection)
MRML node for representing a volume display attributes.
virtual void SetDefaultColorMap()
set gray colormap or override in subclass
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual void SetColorNodeInternal(vtkMRMLColorNode *newColorNode)
vtkImageMapToWindowLevelColors * MapToWindowLevelColors
std::vector< WindowLevelPreset > WindowLevelPresets
window level presets
virtual void SetBackgroundImageStencilDataConnection(vtkAlgorithmOutput *imageDataConnection)
Abstract MRML node to represent color information.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void SetInputToImageDataPipeline(vtkAlgorithmOutput *imageDataConnection)
void operator=(const vtkMRMLVolumeDisplayNode &)
virtual vtkAlgorithmOutput * GetOutputImageDataConnection()
Analysis bimodal histograms.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual vtkAlgorithmOutput * GetBackgroundImageStencilDataConnection()
vtkImageAccumulate * Accumulate
Used internally in CalculateScalarAutoLevels and CalculateStatisticsAutoLevels.
MRML node for representing a volume display attributes.
virtual vtkAlgorithmOutput * GetInputImageDataConnection()