]> Creatis software - bbtk.git/blob - packages/itk/src/bbitkImageProperties.h
Feature #1774
[bbtk.git] / packages / itk / src / bbitkImageProperties.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   Program:   bbtk
30   Module:    $RCSfile: bbitkImageProperties.h,v $
31   Language:  C++
32   Date:      $Date: 2012/11/16 08:50:39 $
33   Version:   $Revision: 1.11 $
34 =========================================================================*/
35
36
37
38 /**
39  * \file 
40  * \brief class ITKImageProperties : generic ITKImage reader
41  */
42 /**
43  * \class bbtk::ITKImageProperties
44  * \brief Generic ITKImage reader
45  */
46 #ifdef _USE_ITK_
47
48 #ifndef __bbtkITKImageProperties_h__
49 #define __bbtkITKImageProperties_h__
50
51 #include "bbtkAtomicBlackBox.h"
52 #include "bbitkImage.h"
53 #include "bbitkImageRegion.h"
54
55 namespace bbitk
56 {
57
58   //=================================================================
59   // BlackBox declaration
60   class ImageProperties : public bbtk::AtomicBlackBox  
61   {
62     
63     BBTK_BLACK_BOX_INTERFACE(ImageProperties,
64                              bbtk::AtomicBlackBox);
65
66     BBTK_DECLARE_INPUT(In,anyImagePointer);
67     BBTK_DECLARE_OUTPUT(TypeName,std::string);
68     BBTK_DECLARE_OUTPUT(Dimension,unsigned int);
69     BBTK_DECLARE_OUTPUT(LargestPossibleRegion,anyImageRegion);
70     BBTK_DECLARE_OUTPUT(Index,std::vector<int>);
71     BBTK_DECLARE_OUTPUT(Size,std::vector<int>);
72     BBTK_DECLARE_OUTPUT(Spacing,std::vector<float>);
73         BBTK_DECLARE_OUTPUT(MinMax,std::vector<float>);
74     BBTK_PROCESS(DoIt);
75     void DoIt();
76
77   private:
78     // Template doit method 
79     template<class ImageType> void DoIt();
80   };
81   //=================================================================
82
83   //=================================================================
84   // BlackBox description
85   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageProperties,bbtk::AtomicBlackBox);
86   BBTK_NAME("ImageProperties");
87   BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
88   BBTK_CATEGORY("image");
89   BBTK_DESCRIPTION("Outputs different properties of an image (type, dimension, size, spacing, ...)");
90   BBTK_INPUT(ImageProperties,In,"Input image",anyImagePointer,"");
91   BBTK_OUTPUT(ImageProperties,TypeName,"Pixel type name",std::string,"pixel type");
92   BBTK_OUTPUT(ImageProperties,Dimension,"Dimension",unsigned int,"image dimension");
93   BBTK_OUTPUT(ImageProperties,LargestPossibleRegion,"Global extent of the image",anyImageRegion,"");
94   BBTK_OUTPUT(ImageProperties,Index,"Origin of the image",std::vector<int>,"image index");
95   BBTK_OUTPUT(ImageProperties,Size,"Size in each dimension",std::vector<int>,"image size");
96   BBTK_OUTPUT(ImageProperties,Spacing,"Size of the voxels",std::vector<float>,"voxel size");
97   BBTK_OUTPUT(ImageProperties,MinMax,"Minimum and the maximum intensity values of an image",std::vector<float>,"");
98   BBTK_END_DESCRIBE_BLACK_BOX(ImageProperties);
99   //=================================================================
100
101 }
102 //namespace bbitk
103 #endif
104
105 #endif