Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

InterfaceBitMap.h 5.56 KB
Newer Older
1
/*****************************************************************************
2
3
4
 * $CAMITK_LICENCE_BEGIN$
 *
 * CamiTK - Computer Assisted Medical Intervention ToolKit
5
 * (c) 2001-2017 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *
 * Visit http://camitk.imag.fr for more information
 *
 * This file is part of CamiTK.
 *
 * CamiTK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * CamiTK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with CamiTK.  If not, see <http://www.gnu.org/licenses/>.
 *
 * $CAMITK_LICENCE_END$
 ****************************************************************************/
25
26
27
28
29
30

#ifndef INTERFACEBITMAP_H
#define INTERFACEBITMAP_H

// -- vtk stuff
#include <vtkSmartPointer.h>
31
32
33
#include <vtkProp.h>
#include <QMap>
#include <QString>
34
35
36
37

// -- vtk stuff Classes
class vtkImageActor;
class vtkActor;
38
class vtkAxesActor;
39
40
class vtkImageData;
class vtkWindowLevelLookupTable;
41
class vtkTransform;
42

43
namespace camitk {
44
45
46
// -- Core stuff Classes
class Component;

47
/**
48
 * @ingroup group_sdk_libraries_core_component
49
50
 *
 * @brief
51
 * This class describes what are the methods to implement
52
53
54
55
56
57
58
59
60
61
62
63
64
 * for a BitMap.
 * An InterfaceBitMap is a kind of simplifier/wrapper for vtkImageData.
 *
 * This class defines an "interface" (in the OOP/java meaning of the term).
 * See the introduction of GoF: "Program to an interface, not an implementation."
 * To see what Erich Gamma has to say about it: http://www.artima.com/lejava/articles/designprinciplesP.html
 * To see what Bjarne Stroustrup has to say about it: http://www.artima.com/intv/modern.html
 *
 * @see Slice
 */

class InterfaceBitMap {

65
public:
66
67
68
69
70
71

    /// virtual destructor
    virtual ~InterfaceBitMap() {};

    /// set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline
    virtual void setOriginalVolume(vtkSmartPointer<vtkImageData>) = 0;
72

73
    /// set the transformation for 3D image representation
74
    virtual void setImageWorldTransform(vtkSmartPointer<vtkTransform>) = 0;
75

76
    /** Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D viewers. */
77
78
    virtual vtkSmartPointer<vtkImageActor> get2DImageActor() const = 0;

79
    /** Return the vtkImageActor (vtkProp) representing a slice to be displayed in 3D viewers. */
80
81
    virtual vtkSmartPointer<vtkImageActor> get3DImageActor() const = 0;

82
    /** Return the vtkActor used to pick pixels in the slices. */
83
84
85
86
87
    virtual vtkSmartPointer<vtkActor> getPickPlaneActor() const = 0;

    /** Return the vtkActor used to pick pixels in the slices. */
    virtual vtkSmartPointer<vtkActor> getPixelActor() = 0;

88
89
    /** Return 2D Axes at the proper slice origin */
//    virtual vtkSmartPointer<vtkAxesActor> get2DAxesActor() = 0;
90
91


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    /** This method is called when the associated plane has been picked in the InteractiveViewer,
     *  the given coordinates is position where the plane was picked.
     */
    virtual void pixelPicked(double, double, double) = 0;

    virtual void updatePickPlane() = 0;

    /** Return the number of slices in the image data set. */
    virtual int getNumberOfSlices() const = 0;

    /** Return the index of the current displayed slice. */
    virtual int getSlice() const = 0;

    /** Set the current slice index.
     * If the slice index is less than the first slice index, the first slice is displayed.
     * If the slice index is more than the last slice index, the last slice is displayed.
     * @param s the index of the slice to display (base 0). */
    virtual void setSlice(int s) = 0;

111
    /// Set the slice corresponding to the given image coordinates (in RAI convention)
112
    virtual void setSlice(double x, double y, double z) = 0;
113

114
115
116
117
118
119
120
    /** Return the number of colors in the images.
     * If color is coded on 1 byte, the images are on 256 grey level.
     * If color is coded on 2 bytes, the images are on 4096 grey level (not 65536). */
    virtual int getNumberOfColors() const = 0;

    /// move the pixel selection green indicator (pixelActor) to the given real position
    virtual void setPixelRealPosition(double, double, double) = 0;
121

122
    /** Returns the encapsultaed data structure: the image as a vtkImageData. */
123
    virtual vtkSmartPointer<vtkImageData> getImageData() const = 0;
124
125
126

    // TODO : put all of this into a dedicated interface
    /// The additional map for prop (include at least "label" and "glyph"
127
    QMap<QString, vtkSmartPointer<vtkProp> > extraProp;
128
129

    /// Return the vtkProp (actors, volumes and annotations) corresponding to the given name
130
    virtual vtkSmartPointer<vtkProp> getProp(const QString&) = 0;
131
132
133
134
135
136
137
138
139
140

    /// return the number of additional prop
    virtual unsigned int getNumberOfProp() const = 0;

    /// return an additional prop by its index
    virtual vtkSmartPointer<vtkProp> getProp(unsigned int) = 0;

    /** insert an additional prop, defining it by its name (default visibility = false)
     *  @return true if the additional prop was added (i.e. another additional prop of the same name does not exist)
     */
141
    virtual bool addProp(const QString&,  vtkSmartPointer<vtkProp>) = 0;
142

143
144
145
    /** remove a given additional prop.
     * @return true if effictively done
     */
146
    virtual bool removeProp(const QString&) = 0;
147
    // END TODO
148
149
150
151
152
153

};

}

#endif