]> Creatis software - gdcm.git/blob - vtk/vtkGdcmReader.h
* vtk/vtkGdcmReader.[h|cxx] : fix the read of 3 gdcmHeader when making an
[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    virtual void RemoveAllFileName(void);
22    virtual void AddFileName(const char* name);
23    virtual void SetFileName(const char *name);
24    vtkGetObjectMacro(LookupTable,vtkLookupTable);
25
26 protected:
27    vtkGdcmReader();
28    ~vtkGdcmReader();
29
30    virtual void ExecuteInformation();
31    virtual void ExecuteData(vtkDataObject *output);
32    virtual void BuildFileListFromPattern();
33    virtual 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    vtkTimeStamp fileTime;
48
49    //BTX
50    // Number of columns of the image/volume to be loaded
51    int NumColumns;
52    // Number of lines of the image/volume to be loaded
53    int NumLines;
54    // Total number of planes (or images) of the stack to be build.
55    int TotalNumberOfPlanes;
56    // Number of scalar components of the image to be loaded (1=monochrome 3=rgb)
57    int NumComponents;
58    // Type of the image[s]: 8/16/32 bits, signed/unsigned:
59    std::string ImageType;
60    // Pixel size (in number of bytes):
61    size_t PixelSize;
62    // List of filenames to be read in order to build a stack of images
63    // or volume. The order in the list shall be the order of the images.
64    std::list<std::string> FileNameList;
65
66    // List of filenames created in ExecuteInformation and used in
67    // ExecuteData.
68    // If FileNameList isn't empty, InternalFileNameList is a copy of
69    //    FileNameList
70    // Otherwise, InternalFileNameList correspond to the list of 
71    //    files patterned
72    std::list<std::string> InternalFileNameList;
73    //ETX
74 };
75
76 //-----------------------------------------------------------------------------
77 #endif
78