]> Creatis software - clitk.git/blob - vv/vvImageReader.h
added the new headers
[clitk.git] / vv / vvImageReader.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef vvImageReader_H
19 #define vvImageReader_H
20 #include <string>
21 #include <vector>
22 #include <QThread>
23
24 #include "itkCommand.h"
25 #include "vvImage.h"
26 #include "vvConstants.h"
27
28 class vvImageReader : public QThread {
29
30 public:
31     vvImageReader();
32     ~vvImageReader();
33
34     void SetInputFilename(const std::string & filename);
35     void SetInputFilenames(const std::vector<std::string> & filenames);
36
37     vvImage::Pointer GetOutput() {
38         return mImage;
39     }
40
41     std::string GetLastError() {
42         return mLastError;
43     }
44
45     //====================================================================
46     // Main function
47     void Update();
48     void Update(LoadedImageType type);
49     void Update(int dim, std::string InputPixelType, LoadedImageType type);
50     //void Extract(int dim, std::string InputPixelType, int slice);
51
52 protected:
53     void run();
54     //====================================================================
55     std::vector<std::string> mInputFilenames;
56     ///Method used to load the image, see vvConstants.h for definition
57     LoadedImageType mType;
58     itk::Command::Pointer mObserver;
59
60     std::string mLastError;
61
62     //====================================================================
63     template<unsigned int VImageDimension>
64     void UpdateWithDim(std::string inputPixelType);
65
66     //====================================================================
67     /*template<unsigned int VImageDimension>
68     void ExtractWithDim(std::string inputPixelType, int slice);*/
69
70     //====================================================================
71     template<class InputPixelType, unsigned int VImageDimension>
72     void UpdateWithDimAndInputPixelType();
73     ///Input dimension and pixel type
74     int mDim;
75     std::string mInputPixelType;
76
77 private:
78     vvImage::Pointer mImage;
79
80 }; // end class vvImageReader
81
82 #endif /* end #define CLITKvvImageReader_H */
83