]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageReSlicerBox.h
2075 creaRigidRegistration Feature New Normal Registration 3D 1P
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageReSlicerBox.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 #
8 #  This software is governed by the CeCILL-B license under French law and 
9 #  abiding by the rules of distribution of free software. You can  use, 
10 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
11 #  license as circulated by CEA, CNRS and INRIA at the following URL 
12 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
13 #  or in the file LICENSE.txt.
14 #
15 #  As a counterpart to the access to the source code and  rights to copy,
16 #  modify and redistribute granted by the license, users are provided only
17 #  with a limited warranty  and the software's author,  the holder of the
18 #  economic rights,  and the successive licensors  have only  limited
19 #  liability. 
20 #
21 #  The fact that you are presently reading this means that you have had
22 #  knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------   
24 */
25
26
27 #ifndef __bbPackRecalageReSlicerBox_h_INCLUDED__
28 #define __bbPackRecalageReSlicerBox_h_INCLUDED__
29 #include "bbPackRecalage_EXPORT.h"
30 #include "bbtkAtomicBlackBox.h"
31 #include "iostream"
32
33 #include "vtkImageReslice.h" 
34 #include "vtkTransform.h"
35 #include "vtkImageData.h"
36
37 #include "vtkIdentityTransform.h"
38 #include "vtkMatrix4x4.h"
39 #include <vtkImageChangeInformation.h>
40
41 namespace bbPackRecalage
42 {
43
44 class bbPackRecalage_EXPORT ReSlicerBox
45  : 
46    public bbtk::AtomicBlackBox
47 {
48   BBTK_BLACK_BOX_INTERFACE(ReSlicerBox,bbtk::AtomicBlackBox);
49   BBTK_DECLARE_INPUT(In,vtkImageData *);
50   BBTK_DECLARE_INPUT(Origin,std::vector<int>);
51   BBTK_DECLARE_INPUT(Transform,vtkTransform *);
52   BBTK_DECLARE_INPUT(Centered,bool);
53   BBTK_DECLARE_INPUT(Interpolate,bool);
54   BBTK_DECLARE_OUTPUT(Out,vtkImageData *);
55   BBTK_PROCESS(Process);
56   void Process();
57
58   vtkImageChangeInformation* image;
59   vtkImageChangeInformation* imageResult;
60   vtkImageReslice* slicer;
61
62   int sizeBackInfo;
63   double backInfoA[19];  //16+3
64
65   void GetBackInfo(double *backInfo, vtkMatrix4x4 *vtkmatrix, std::vector<int> point );
66   bool CompareBackInfo(double* , double *);
67 };
68
69 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReSlicerBox,bbtk::AtomicBlackBox);
70 BBTK_NAME("ReSlicerBox");
71 BBTK_AUTHOR("davila@creatis.insa-lyon.com");
72 BBTK_DESCRIPTION("Uses the vtk ReSlicer tool to modify an input image given a transformation filter.");
73 BBTK_CATEGORY("filter");
74 BBTK_INPUT(ReSlicerBox,In,"Image input",vtkImageData *,"");
75 BBTK_INPUT(ReSlicerBox,Origin,"Image Origin(x,y,z)",std::vector<int>,"");
76 BBTK_INPUT(ReSlicerBox,Transform,"Transform input",vtkTransform *,"");
77 BBTK_INPUT(ReSlicerBox,Centered,"Rotations of the image are in the center of the image. DEFAULT = False.",bool,"");
78 BBTK_INPUT(ReSlicerBox,Interpolate,"Linear interpolation On. DEFAULT = False.",bool,"");
79 BBTK_OUTPUT(ReSlicerBox,Out,"Image output",vtkImageData *,"");
80 BBTK_END_DESCRIBE_BLACK_BOX(ReSlicerBox);
81 }
82 // EO namespace bbPackRecalage
83
84 #endif // __bbPackRecalageReSlicerBox_h_INCLUDED__
85