-
Notifications
You must be signed in to change notification settings - Fork 2
/
ImageWidget.h
94 lines (69 loc) · 1.88 KB
/
ImageWidget.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
/*
* File: ImageWidget.h
* Author: zian
*
* Created on 22 de octubre de 2013, 13:32
*/
#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H
#include <QtGui>
#include <QWidget>
#include <QVTKWidget.h>
#include <vtkSmartPointer.h>
#include <vtkImageData.h>
#include <vtkRenderer.h>
#include <vtkImageActor.h>
#include <vtkRenderWindow.h>
#include <vtkCamera.h>
#include <itkImage.h>
//#include <QString>
typedef itk::Image<unsigned char, 2> ImageType;
typedef itk::Image<float, 2> FloatImageType;
class ImageWidget : public QWidget
{
Q_OBJECT
public:
/**
* Constructor for this ImageWidget
*/
ImageWidget(QWidget *parent = 0);
/**
* Destructor for this ImageWidget
*/
virtual ~ImageWidget();
/**
* load an display an image from file
*/
void open(QString filename);
/**
* Applays a median filter to an image
*/
void medianFilter(int windowSize);
/**
* Applays a Gradient Anisotropic Filter to an image
*/
void gradientAnisotropicFilter(int iterations, double conductance, double timeStep);
/**
* return an itk image representation from this vtkImageData
*/
ImageType::Pointer toITKImage();
/**
* return a vtkImageData from a itk image representation.
*/
vtkSmartPointer<vtkImageData> toVTKImageData(ImageType::Pointer itkImage);
private:
/** A special widget to display inside Qtwidget a vtk object */
QVTKWidget *qvtkWidget;
/**
* to display the loaded image in the QVTKwidget
* @param image vtkImageData
*/
void displayImage(vtkImageData *image);
/** The VTK image */
vtkSmartPointer <vtkImageData> vtkImage;
vtkSmartPointer<vtkImageActor> actor;
vtkSmartPointer<vtkRenderer> renderer;
vtkSmartPointer<vtkRenderWindow> renderWindow;
vtkSmartPointer<vtkCamera> camera;
};
#endif /* IMAGEWIDGET_H */