2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbvtkImagePlanes.h,v $
32 Date: $Date: 2012/11/16 08:51:58 $
33 Version: $Revision: 1.25 $
34 =========================================================================*/
37 * \brief Short description in one line
39 * Long description which
40 * can span multiple lines
44 * \brief Pattern for the definition of a new type of Node (header)
47 * \class bbtk::NodePatern
48 * \brief Pattern for the definition of a new type of Node
53 #ifndef __bbvtkImagePlanes_h_INCLUDED__
54 #define __bbvtkImagePlanes_h_INCLUDED__
56 #include "bbtkAtomicBlackBox.h"
59 class vtkImagePlaneWidget;
61 #include "vtkPlaneWidget.h"
62 #include "vtkRenderWindowInteractor.h"
63 #include "vtkImageReslice.h"
64 #include <vtkTransform.h>
68 typedef std::vector<double> winLevel;
70 class /*BBTK_EXPORT*/ ImagePlanes : public bbtk::AtomicBlackBox
73 BBTK_BLACK_BOX_INTERFACE(ImagePlanes,bbtk::AtomicBlackBox);
74 // BBTK_DECLARE_INPUT(Contour, int);
75 BBTK_DECLARE_INPUT(In, vtkImageData*);
76 BBTK_DECLARE_INPUT(WindowLevel, winLevel);
77 BBTK_DECLARE_INPUT(PointsX, std::vector<int>);
78 BBTK_DECLARE_INPUT(PointsY, std::vector<int>);
79 BBTK_DECLARE_INPUT(PointsZ, std::vector<int>);
80 BBTK_DECLARE_INPUT(Interactor, vtkRenderWindowInteractor*);
81 BBTK_DECLARE_INPUT(Interpolation, int);
83 BBTK_DECLARE_OUTPUT(PlaneX, vtkImagePlaneWidget*);
84 BBTK_DECLARE_OUTPUT(PlaneY, vtkImagePlaneWidget*);
85 BBTK_DECLARE_OUTPUT(PlaneZ, vtkImagePlaneWidget*);
86 BBTK_DECLARE_OUTPUT(Plane3Pts, vtkInteractorObserver*);
87 BBTK_DECLARE_OUTPUT(ImageX, vtkImageData*);
88 BBTK_DECLARE_OUTPUT(ImageY, vtkImageData*);
89 BBTK_DECLARE_OUTPUT(ImageZ, vtkImageData*);
90 BBTK_DECLARE_OUTPUT(Image3Pts, vtkImageData*);
91 BBTK_DECLARE_OUTPUT(Transform3Pts, vtkLinearTransform*);
93 BBTK_PROCESS(Process);
97 vtkTransform *_imageTransform;
103 class VtkCallbackType;
104 VtkCallbackType *mVtkCallback;
106 vtkImageReslice *_imageReslicer;
108 vtkTransform *_transform;
109 vtkMatrix4x4 *_matrix;
111 double *getCrossProduct(double* vect0,double* vect1);
112 double getPodoubleProduct(double* vect0,double* vect1);
113 double *getNormal(double* vect);
114 double getMagnitud(double* vect);
115 double *makeVector(double podouble0[3], double podouble1[3]);
116 void updateInteractor();
118 vtkImagePlaneWidget* GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker);
121 //=================================================================
122 // UserBlackBox description
123 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImagePlanes,bbtk::AtomicBlackBox);
124 BBTK_NAME("ImagePlanes");
125 BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
126 BBTK_DESCRIPTION("Creates three 3D planes with the input image mapped onto which the user can interact with. The output vtkImagePlaneWidget objects are to be inserted into a 3D scene (e.g. a Viewer3D)");
127 BBTK_CATEGORY("3D object creator");
129 BBTK_INPUT(ImagePlanes, In, "Input Image", vtkImageData *, "");
130 BBTK_INPUT(ImagePlanes, WindowLevel, "Widdow Level", winLevel, "");
131 BBTK_INPUT(ImagePlanes, PointsX, "Points in X", std::vector<int>, "");
132 BBTK_INPUT(ImagePlanes, PointsY, "Points in Y", std::vector<int>, "");
133 BBTK_INPUT(ImagePlanes, PointsZ, "Points in Z", std::vector<int>, "");
134 BBTK_INPUT(ImagePlanes, Interactor, "Interactor for the planes", vtkRenderWindowInteractor*, "");
135 BBTK_INPUT(ImagePlanes, Interpolation, "Interpolation (default 1) 0=NEAREST_RESLICE 1=LINEAR_RESLICE 2=CUBIC_RESLICE", int, "");
138 BBTK_OUTPUT(ImagePlanes,PlaneX, "The image plane in X direction", vtkImagePlaneWidget*, "");
139 BBTK_OUTPUT(ImagePlanes,PlaneY, "The image plane in Y direction", vtkImagePlaneWidget*, "");
140 BBTK_OUTPUT(ImagePlanes,PlaneZ, "The image plane in Z direction", vtkImagePlaneWidget*, "");
141 BBTK_OUTPUT(ImagePlanes,Plane3Pts, "The image plane (3 points definition) ", vtkInteractorObserver*, "");
142 BBTK_OUTPUT(ImagePlanes,ImageX, "The image in X direction", vtkImageData*, "");
143 BBTK_OUTPUT(ImagePlanes,ImageY, "The image in Y direction", vtkImageData*, "");
144 BBTK_OUTPUT(ImagePlanes,ImageZ, "The image in Z direction", vtkImageData*, "");
145 BBTK_OUTPUT(ImagePlanes,Image3Pts, "The image (3 points plane definition)", vtkImageData*, "");
146 BBTK_OUTPUT(ImagePlanes,Transform3Pts, "The Tranform of the image", vtkLinearTransform*, "");
149 BBTK_END_DESCRIBE_BLACK_BOX(ImagePlanes);
150 //=================================================================
159 typedef vtkImageData* vtkImageDataPointer;
162 typedef vtkImageData* vtkImageDataPointer;
166 BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(vtkImageDataPointer, "vtkImageDataPointer");
170 #endif //__bbtvtkImagePlanes_h__