PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusCompareVolumes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlusCompareVolumes.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME vtkPlusCompareVolumes - generates a histogram and statistics about volume reconstruction outputs
16 // .SECTION Description
17 // Currently this class only supports volume reconstructions of unsigned characters. The executable needs to be provided the following:
18 // - A ground truth image
19 // - A ground truth alpha image: This is used together with the slices alpha image to identify hole voxels
20 // - A reconstructed "test" image
21 // - A slices alpha image: The alpha channel if the slices are only pasted into the volume without hole filling
22 
23 #ifndef __vtkPlusCompareVolumes_h
24 #define __vtkPlusCompareVolumes_h
25 
26 #include "PlusConfigure.h"
27 #include "vtkThreadedImageAlgorithm.h"
28 #include <vector>
29 
30 class vtkPlusCompareVolumes : public vtkThreadedImageAlgorithm
31 {
32 public:
33  static vtkPlusCompareVolumes *New();
34  vtkTypeMacro(vtkPlusCompareVolumes,vtkThreadedImageAlgorithm);
35 
36  // Description:
37  // Set the Input1 of this filter.
38  virtual void SetInputGT(vtkDataObject *input);;
39 
40  // Description:
41  // Set the Input2 of this filter.
42  virtual void SetInputGTAlpha(vtkDataObject *input);;
43 
44  // Description:
45  // Set the Input3 of this filter.
46  virtual void SetInputTest(vtkDataObject *input);;
47 
48  // Description:
49  // Set the Input4 of this filter.
50  virtual void SetInputTestAlpha(vtkDataObject *input);;
51 
52  // Description:
53  // Set the Input5 of this filter.
54  virtual void SetInputSliceAlpha(vtkDataObject *input);;
55 
56  // Description:
57  // Output the images resulting from this filter
58  vtkImageData* GetOutputTrueDifferenceImage();
59  vtkImageData* GetOutputAbsoluteDifferenceImage();
60 
61  vtkGetMacro(RMS,double);
62  vtkSetMacro(RMS,double);
63 
64  vtkGetMacro(TrueMean,double);
65  vtkSetMacro(TrueMean,double);
66  vtkGetMacro(TrueStdev,double);
67  vtkSetMacro(TrueStdev,double);
68  vtkGetMacro(TrueMedian,double);
69  vtkSetMacro(TrueMedian,double);
70  vtkGetMacro(TrueMinimum,double);
71  vtkSetMacro(TrueMinimum,double);
72  vtkGetMacro(TrueMaximum,double);
73  vtkSetMacro(TrueMaximum,double);
74  vtkGetMacro(True5thPercentile,double);
75  vtkSetMacro(True5thPercentile,double);
76  vtkGetMacro(True95thPercentile,double);
77  vtkSetMacro(True95thPercentile,double);
78 
79  vtkGetMacro(AbsoluteMean,double);
80  vtkSetMacro(AbsoluteMean,double);
81  vtkGetMacro(AbsoluteStdev,double);
82  vtkSetMacro(AbsoluteStdev,double);
83  vtkGetMacro(AbsoluteMedian,double);
84  vtkSetMacro(AbsoluteMedian,double);
85  vtkGetMacro(AbsoluteMinimum,double);
86  vtkSetMacro(AbsoluteMinimum,double);
87  vtkGetMacro(AbsoluteMaximum,double);
88  vtkSetMacro(AbsoluteMaximum,double);
89  vtkGetMacro(Absolute5thPercentile,double);
90  vtkSetMacro(Absolute5thPercentile,double);
91  vtkGetMacro(Absolute95thPercentile,double);
92  vtkSetMacro(Absolute95thPercentile,double);
93  vtkGetMacro(NumberOfHoles,int);
94  vtkSetMacro(NumberOfHoles,int);
95  vtkGetMacro(NumberOfFilledHoles,int);
96  vtkSetMacro(NumberOfFilledHoles,int);
97  vtkGetMacro(NumberVoxelsVisible,int);
98  vtkSetMacro(NumberVoxelsVisible,int);
99 
100  vtkGetMacro(AbsoluteMeanWithHoles,double);
101  vtkSetMacro(AbsoluteMeanWithHoles,double);
102 
103  int* GetTrueHistogramPtr();
106  void incTrueHistogramAtIndex(int value);
109  void resetTrueHistogram();
110  void resetAbsoluteHistogram();
112 
113 protected:
116 
117  double RMS;
121  int TrueHistogram[511];
127 
128  virtual int RequestInformation (vtkInformation *, vtkInformationVector**, vtkInformationVector *);
129 
130  void ThreadedRequestData (vtkInformation* request,
131  vtkInformationVector** inputVector,
132  vtkInformationVector* outputVector,
133  vtkImageData ***inData, vtkImageData **outData,
134  int ext[6], int id);
135 
136  virtual int FillInputPortInformation(int port, vtkInformation* info);
137 
138 
139 private:
140  vtkPlusCompareVolumes(const vtkPlusCompareVolumes&); // Not implemented.
141  void operator=(const vtkPlusCompareVolumes&); // Not implemented.
142 };
143 
144 #endif
vtkImageData * GetOutputAbsoluteDifferenceImage()
virtual void SetInputGT(vtkDataObject *input)
void incAbsoluteHistogramWithHolesAtIndex(int value)
vtkImageData * GetOutputTrueDifferenceImage()
void incAbsoluteHistogramAtIndex(int value)
virtual void SetInputTestAlpha(vtkDataObject *input)
virtual void SetInputTest(vtkDataObject *input)
int port
Definition: phidget22.h:2454
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual void SetInputGTAlpha(vtkDataObject *input)
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id)
const char const char * value
Definition: phidget22.h:5111
static vtkPlusCompareVolumes * New()
void incTrueHistogramAtIndex(int value)
virtual void SetInputSliceAlpha(vtkDataObject *input)