]> Creatis software - gdcm.git/blob - vtk/vtkGdcmReader.h
* vtk/vtkGdcm*.[h|cxx] : remove warnings. Add header to files
[gdcm.git] / vtk / vtkGdcmReader.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: vtkGdcmReader.h,v $
5   Language:  C++
6   Date:      $Date: 2004/12/09 10:59:59 $
7   Version:   $Revision: 1.20 $
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/Gdcm/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 #ifndef __vtkGdcmReader_h
20 #define __vtkGdcmReader_h
21
22 #include "gdcmCommon.h" // To avoid warnings concerning the std
23
24 #include <vtkImageReader.h>
25 #include <list>
26 #include <string>
27
28 //-----------------------------------------------------------------------------
29 class vtkLookupTable;
30
31 //-----------------------------------------------------------------------------
32 class VTK_EXPORT vtkGdcmReader : public vtkImageReader
33 {
34 public:
35    static vtkGdcmReader *New();
36    vtkTypeRevisionMacro(vtkGdcmReader, vtkImageReader);
37    void PrintSelf(ostream& os, vtkIndent indent);
38
39    virtual void RemoveAllFileName(void);
40    virtual void AddFileName(const char* name);
41    virtual void SetFileName(const char *name);
42    
43    // Description:
44    // If this flag is set and the DICOM reader encounters a dicom file with 
45    // lookup table the data will be kept as unsigned chars and a lookuptable 
46    // will be exported and accessible through GetLookupTable() 
47    vtkSetMacro(AllowLookupTable,int);
48    vtkGetMacro(AllowLookupTable,int);
49    vtkBooleanMacro(AllowLookupTable,int);
50
51    vtkGetObjectMacro(LookupTable,vtkLookupTable);
52
53 protected:
54    vtkGdcmReader();
55    ~vtkGdcmReader();
56
57    virtual void ExecuteInformation();
58    virtual void ExecuteData(vtkDataObject *output);
59    virtual void BuildFileListFromPattern();
60    virtual int CheckFileCoherence();
61
62 private:
63    void RemoveAllInternalFileName(void);
64    void AddInternalFileName(const char* name);
65
66    //BTX
67    size_t LoadImageInMemory(std::string FileName, unsigned char * Dest,
68                            const unsigned long UpdateProgressTarget,
69                            unsigned long & UpdateProgressCount);
70    //ETX
71
72 // Variables
73    vtkLookupTable *LookupTable;
74    vtkTimeStamp fileTime;
75    int AllowLookupTable;
76
77    //BTX
78    // Number of columns of the image/volume to be loaded
79    int NumColumns;
80    // Number of lines of the image/volume to be loaded
81    int NumLines;
82    // Total number of planes (or images) of the stack to be build.
83    int TotalNumberOfPlanes;
84    // Number of scalar components of the image to be loaded (1=monochrome 3=rgb)
85    int NumComponents;
86    // Type of the image[s]: 8/16/32 bits, signed/unsigned:
87    std::string ImageType;
88    // Pixel size (in number of bytes):
89    size_t PixelSize;
90    // List of filenames to be read in order to build a stack of images
91    // or volume. The order in the list shall be the order of the images.
92    std::list<std::string> FileNameList;
93
94    // List of filenames created in ExecuteInformation and used in
95    // ExecuteData.
96    // If FileNameList isn't empty, InternalFileNameList is a copy of
97    //    FileNameList
98    // Otherwise, InternalFileNameList correspond to the list of 
99    //    files patterned
100    std::list<std::string> InternalFileNameList;
101    //ETX
102 };
103
104 //-----------------------------------------------------------------------------
105 #endif
106