]> Creatis software - bbtk.git/blob - packages/itk/src/bbitkImageSeriesReader.h
We can pass the spacing,if the input image doesn't have (and if we now it)
[bbtk.git] / packages / itk / src / bbitkImageSeriesReader.h
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbitkImageSeriesReader.h,v $
4   Language:  C++
5   Date:      $Date: 2008/11/27 14:55:54 $
6   Version:   $Revision: 1.10 $
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 /**
33  * \file 
34  * \brief class ITKImageSeriesReader : generic ITKImage reader
35  */
36 /**
37  * \class bbtk::ITKImageSeriesReader
38  * \brief Generic ITKImage reader
39  */
40 #ifdef _USE_ITK_
41
42 #ifndef __bbitkImageSeriesReader_h_INCLUDED__
43 #define __bbitkImageSeriesReader_h_INCLUDED__
44
45 #include "bbtkAtomicBlackBox.h"
46 #include "bbitkImage.h"
47
48 namespace bbitk
49 {
50
51   //=================================================================
52   // BlackBox declaration
53   class ImageSeriesReader : public bbtk::AtomicBlackBox  
54   {
55     
56     BBTK_BLACK_BOX_INTERFACE(ImageSeriesReader,
57                              bbtk::AtomicBlackBox);
58     //==================================================================
59     /// User callback called in the box contructor
60     virtual void bbUserConstructor();
61     /// User callback called in the box copy constructor
62     virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
63     /// User callback called in the box destructor
64     virtual void bbUserDestructor();
65     //==================================================================
66     BBTK_DECLARE_INPUT(FileNames,std::vector<std::string>);
67     BBTK_DECLARE_INPUT(XSpacing,float);
68     BBTK_DECLARE_INPUT(YSpacing,float);    
69     BBTK_DECLARE_INPUT(ZSpacing,float);    
70     BBTK_DECLARE_OUTPUT(Out,anyImagePointer);
71     BBTK_PROCESS(Read);
72     void Read();
73
74   private:
75     // Template read method 
76     template<class T> void Read();
77   };
78   //=================================================================
79   
80
81   //=================================================================
82   // BlackBox description
83   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSeriesReader,bbtk::AtomicBlackBox);
84   BBTK_NAME("ImageSeriesReader");
85   BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
86   BBTK_DESCRIPTION("Generic itk image series reader");
87   BBTK_CATEGORY("image;read/write");
88   typedef std::vector<std::string> vectorofstring;
89   BBTK_INPUT(ImageSeriesReader,FileNames,
90              "vector of file names with complete paths",vectorofstring,"file names list");
91   BBTK_INPUT(ImageSeriesReader,XSpacing, "if images don't contain information",float,"");            
92   BBTK_INPUT(ImageSeriesReader,YSpacing, "if images don't contain information",float,"" );           
93   BBTK_INPUT(ImageSeriesReader,ZSpacing, "if images don't contain information",float,"");
94              
95   BBTK_OUTPUT(ImageSeriesReader,Out,"Output itk::image<T,D> with type T and dimension D determined by the content of the files + vector size",anyImagePointer,"");
96   
97   BBTK_END_DESCRIBE_BLACK_BOX(ImageSeriesReader);
98   //=================================================================
99   
100
101 }
102 //namespace bbtk
103 #endif
104
105 #endif