]> Creatis software - bbtk.git/blob - packages/itkvtk/src/bbitkvtkvtkImageDataVector2itkImageVector.h
Feature #1774
[bbtk.git] / packages / itkvtk / src / bbitkvtkvtkImageDataVector2itkImageVector.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 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
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.
16 #
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
21 #  liability.
22 #
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 # ------------------------------------------------------------------------ */
26
27
28 /*=========================================================================
29                                                                                 
30   Program:   bbtk
31   Module:    $RCSfile: bbitkvtkvtkImageDataVector2itkImageVector.h,v $
32   Language:  C++
33   Date:      $Date: 2012/11/16 08:50:49 $
34   Version:   $Revision: 1.2 $
35  
36                                                                                 
37 =========================================================================*/
38 /**
39  * \file 
40  * \brief class vtkImageDataVector2itkImageVector : Converts a vtkImageData to a generic itkImage
41  */
42 /**
43  * \class vtkImageDataVector2itkImageVector 
44  * \brief Converts a vtkImageData to a generic itkImage
45  */
46 #ifdef _USE_ITK_
47 #ifdef _USE_VTK_
48
49 #ifndef __bbitkvtkvtkImageDataVector2itkImageVector_h__
50 #define __bbvitkvtktkImageData2itkImage_h__
51
52 #include "bbtkAtomicBlackBox.h"
53 #include "bbitkImage.h"
54 #include "vtkImageData.h"
55 #include "itkProcessObject.h"
56
57 namespace bbitkvtk
58 {
59
60   class /*BBTK_EXPORT*/ vtkImageDataVector2itkImageVector : public bbtk::AtomicBlackBox  
61   {
62     
63     BBTK_BLACK_BOX_INTERFACE(vtkImageDataVector2itkImageVector,
64                              bbtk::AtomicBlackBox);
65
66     BBTK_DECLARE_INPUT(In,std::vector<vtkImageData*>);
67     BBTK_DECLARE_OUTPUT(Out,std::vector<bbitk::anyImagePointer>);
68     BBTK_PROCESS(Convert);
69     void Convert();
70
71   private:
72     // Convert method : template on type of the itk image to be created
73     template<class T, unsigned int D> void Convert();
74     // stores the pointer on the template itk::VTKImageToImageFilter 
75     itk::ProcessObject::Pointer mConverter;
76     std::vector<bbitk::anyImagePointer> m_Output_Vector;
77   }; 
78   
79
80   //=================================================================
81   // AtomicBlackBox description
82   BBTK_BEGIN_DESCRIBE_BLACK_BOX(vtkImageDataVector2itkImageVector,bbtk::AtomicBlackBox);
83   BBTK_NAME("vtkImageDataVector2itkImageVector");
84   BBTK_AUTHOR("jpr@creatis.insa-lyon.fr");
85   BBTK_DESCRIPTION("Converts a std::vector of vtkImageData* to a std::vector of generic itkImage pointer");
86   BBTK_DEFAULT_ADAPTOR();
87   BBTK_INPUT(vtkImageDataVector2itkImageVector,In,
88              "Input std::vector of vtkImageData*",std::vector<vtkImageData*>,"");
89   BBTK_OUTPUT(vtkImageDataVector2itkImageVector,Out,
90               "Output std::vector of generic itkImage pointer",
91               std::vector<bbitk::anyImagePointer>,"");
92   BBTK_END_DESCRIBE_BLACK_BOX(vtkImageDataVector2itkImageVector);
93   //=================================================================
94
95
96 }
97 //namespace bbitkvtk
98 #endif
99 // _USE_VTK_
100 #endif
101 // _USE_ITK_
102
103 #endif