]> Creatis software - bbtk.git/blob - packages/itk/src/bbitkTypedImageToAnyImage.h
e974b15958bdf3f00a5a20ad3df0795012379960
[bbtk.git] / packages / itk / src / bbitkTypedImageToAnyImage.h
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbitkTypedImageToAnyImage.h,v $
4   Language:  C++
5   Date:      $Date: 2009/05/18 10:45:44 $
6   Version:   $Revision: 1.8 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31
32 #ifdef _USE_ITK_
33
34 #ifndef __bbTypedItkImage2GenericItkImage_h__
35 #define __bbTypedItkImage2GenericItkImage_h__
36
37 #include "bbtkAtomicBlackBox.h"
38 #include "bbitkImage.h"
39 #include "bbtkSystem.h"
40
41 namespace bbitk 
42 {
43
44   //=================================================================
45   // BlackBox declaration
46   template <class itkImageTypePointer>
47   class TypedImageToAnyImage : public bbtk::AtomicBlackBox
48   {  
49     BBTK_TEMPLATE_BLACK_BOX_INTERFACE(TypedImageToAnyImage,
50                                       bbtk::AtomicBlackBox,
51                                       itkImageTypePointer);
52     BBTK_DECLARE_INPUT(In,itkImageTypePointer);
53     BBTK_DECLARE_OUTPUT(Out,anyImagePointer);
54     BBTK_PROCESS(DoIt);
55     void DoIt() { bbSetOutputOut( bbGetInputIn() ); bbGetInputIn()->Register(); }
56   };
57   //=================================================================
58  
59   //===================================================
60   template <class T> void TypedImageToAnyImage<T>::bbUserSetDefaultValues()
61   {}
62   template <class T> void TypedImageToAnyImage<T>::bbUserInitializeProcessing()
63   {}
64   template <class T> void TypedImageToAnyImage<T>::bbUserFinalizeProcessing() 
65   {}
66   //===================================================
67   
68
69   //=================================================================
70   // BlackBox description
71   BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(TypedImageToAnyImage,
72                                       bbtk::AtomicBlackBox);
73   BBTK_NAME(bbtk::HumanTypeName<T>()
74             + "To" + bbtk::HumanTypeName<anyImagePointer>());
75   BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
76   BBTK_DESCRIPTION("Converts a typed itk image pointer ("
77                    +bbtk::HumanTypeName<T>()+
78                    ") into a generic itk image pointer ("+
79                    bbtk::HumanTypeName<anyImagePointer>()+")");
80   BBTK_CATEGORY("adaptor");
81   BBTK_DEFAULT_ADAPTOR();
82   BBTK_TEMPLATE_INPUT(TypedImageToAnyImage,In,
83                       "Input typed image",T);
84   BBTK_TEMPLATE_OUTPUT(TypedImageToAnyImage,Out,
85                        "Output generic image",anyImagePointer);
86   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(TypedImageToAnyImage);
87   //=================================================================
88
89  
90
91 }
92 #endif
93 #endif