]> Creatis software - bbtk.git/blob - packages/itk/src/bbitkImageProperties.h
09312bfb256b2b7505b75824faff9e2142976c92
[bbtk.git] / packages / itk / src / bbitkImageProperties.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbitkImageProperties.h,v $
5   Language:  C++
6   Date:      $Date: 2008/07/23 12:02:15 $
7   Version:   $Revision: 1.7 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 /**
20  * \file 
21  * \brief class ITKImageProperties : generic ITKImage reader
22  */
23 /**
24  * \class bbtk::ITKImageProperties
25  * \brief Generic ITKImage reader
26  */
27 #ifdef _USE_ITK_
28
29 #ifndef __bbtkITKImageProperties_h__
30 #define __bbtkITKImageProperties_h__
31
32 #include "bbtkAtomicBlackBox.h"
33 #include "bbitkImage.h"
34 #include "bbitkImageRegion.h"
35
36 namespace bbitk
37 {
38
39   //=================================================================
40   // BlackBox declaration
41   class ImageProperties : public bbtk::AtomicBlackBox  
42   {
43     
44     BBTK_BLACK_BOX_INTERFACE(ImageProperties,
45                              bbtk::AtomicBlackBox);
46
47     BBTK_DECLARE_INPUT(In,anyImagePointer);
48     BBTK_DECLARE_OUTPUT(TypeName,std::string);
49     BBTK_DECLARE_OUTPUT(Dimension,unsigned int);
50     BBTK_DECLARE_OUTPUT(LargestPossibleRegion,anyImageRegion);
51     BBTK_DECLARE_OUTPUT(Index,std::vector<int>);
52     BBTK_DECLARE_OUTPUT(Size,std::vector<int>);
53     BBTK_DECLARE_OUTPUT(Spacing,std::vector<float>);
54     BBTK_PROCESS(DoIt);
55     void DoIt();
56
57   private:
58     // Template doit method 
59     template<class ImageType> void DoIt();
60   };
61   //=================================================================
62   
63
64   //=================================================================
65   // BlackBox description
66   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageProperties,bbtk::AtomicBlackBox);
67   BBTK_NAME("ImageProperties");
68   BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
69   BBTK_CATEGORY("image");
70   BBTK_DESCRIPTION("Outputs different properties of an image (type, dimension, size, spacing, ...)");
71   BBTK_INPUT(ImageProperties,In,"Input image",anyImagePointer,"");
72   BBTK_OUTPUT(ImageProperties,TypeName,"Pixel type name",std::string,"pixel type");
73   BBTK_OUTPUT(ImageProperties,Dimension,"Dimension",unsigned int,"image dimension");
74   BBTK_OUTPUT(ImageProperties,LargestPossibleRegion,"Global extent of the image",anyImageRegion,"");
75   BBTK_OUTPUT(ImageProperties,Index,"Origin of the image",std::vector<int>,"image index");
76   BBTK_OUTPUT(ImageProperties,Size,"Size in each dimension",std::vector<int>,"image size");
77   BBTK_OUTPUT(ImageProperties,Spacing,"Size of the voxels",std::vector<float>,"voxel size");
78   BBTK_END_DESCRIBE_BLACK_BOX(ImageProperties);
79   //=================================================================
80   
81
82 }
83 //namespace bbitk
84 #endif
85
86 #endif