]> Creatis software - gdcm.git/blob - vtk/vtkGdcmReader.h
* vtk/*.[h|cxx] : coding style
[gdcm.git] / vtk / vtkGdcmReader.h
1 // vtkGdcmReader.h
2 //-----------------------------------------------------------------------------
3 #ifndef __vtkGdcmReader_h
4 #define __vtkGdcmReader_h
5
6 #include <vtkImageReader.h>
7 #include <list>
8 #include <string>
9
10 //-----------------------------------------------------------------------------
11 class vtkLookupTable;
12
13 //-----------------------------------------------------------------------------
14 class VTK_EXPORT vtkGdcmReader : public vtkImageReader
15 {
16 public:
17    static vtkGdcmReader *New() {return new vtkGdcmReader;};
18    vtkTypeMacro(vtkGdcmReader, vtkImageReader);
19    void PrintSelf(ostream& os, vtkIndent indent);
20
21    void RemoveAllFileName(void);
22    void AddFileName(const char* name);
23    void SetFileName(const char *name);
24    vtkGetObjectMacro(LookupTable,vtkLookupTable);
25
26 protected:
27    vtkGdcmReader();
28    ~vtkGdcmReader();
29
30    virtual void ExecuteInformation();
31    void ExecuteData(vtkDataObject *output);
32    void BuildFileListFromPattern();
33    int CheckFileCoherence();
34
35 private:
36    void RemoveAllInternalFileName(void);
37    void AddInternalFileName(const char* name);
38
39    //BTX
40    size_t LoadImageInMemory(std::string FileName, unsigned char * Dest,
41                            const unsigned long UpdateProgressTarget,
42                            unsigned long & UpdateProgressCount);
43    //ETX
44
45 // Variables
46    vtkLookupTable *LookupTable;
47
48    //BTX
49    // Number of columns of the image/volume to be loaded
50    int NumColumns;
51    // Number of lines of the image/volume to be loaded
52    int NumLines;
53    // Total number of planes (or images) of the stack to be build.
54    int TotalNumberOfPlanes;
55    // Number of scalar components of the image to be loaded (1=monochrome 3=rgb)
56    int NumComponents;
57    // Type of the image[s]: 8/16/32 bits, signed/unsigned:
58    std::string ImageType;
59    // Pixel size (in number of bytes):
60    size_t PixelSize;
61    // List of filenames to be read in order to build a stack of images
62    // or volume. The order in the list shall be the order of the images.
63    std::list<std::string> FileNameList;
64
65    // List of filenames created in ExecuteInformation and used in
66    // ExecuteData.
67    // If FileNameList isn't empty, InternalFileNameList is a copy of
68    //    FileNameList
69    // Otherwise, InternalFileNameList correspond to the list of 
70    //    files patterned
71    std::list<std::string> InternalFileNameList;
72    //ETX
73 };
74
75 //-----------------------------------------------------------------------------
76 #endif
77