00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __vtkGdcmReader_h
00020 #define __vtkGdcmReader_h
00021
00022 #include "gdcmCommon.h"
00023 #include "gdcmFile.h"
00024
00025 #include <vtkImageReader.h>
00026 #include <list>
00027 #include <string>
00028 #include <vector>
00029
00030 typedef void (*VOID_FUNCTION_PUINT8_PFILE_POINTER)(uint8_t *, gdcm::File *);
00031
00032
00033 class vtkLookupTable;
00034
00035
00036 class VTK_EXPORT vtkGdcmReader : public vtkImageReader
00037 {
00038 public:
00039 static vtkGdcmReader *New();
00040 vtkTypeRevisionMacro(vtkGdcmReader, vtkImageReader);
00041 void PrintSelf(ostream& os, vtkIndent indent);
00042
00043 virtual void RemoveAllFileName(void);
00044 virtual void AddFileName(const char *name);
00045 virtual void SetFileName(const char *name);
00046
00047
00048 void SetCoherentFileList( std::vector<gdcm::File* > *cfl) {
00049 CoherentFileList = cfl; }
00050
00051
00052 vtkSetMacro(AllowLightChecking, bool);
00053 vtkGetMacro(AllowLightChecking, bool);
00054 vtkBooleanMacro(AllowLightChecking, bool);
00055
00056
00057 void SetUserFunction (VOID_FUNCTION_PUINT8_PFILE_POINTER userFunc )
00058 { UserFunction = userFunc; }
00059
00060
00061
00062
00063
00064
00065 vtkSetMacro(AllowLookupTable, bool);
00066 vtkGetMacro(AllowLookupTable, bool);
00067 vtkBooleanMacro(AllowLookupTable, bool);
00068
00069 vtkGetObjectMacro(LookupTable, vtkLookupTable);
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 vtkSetMacro(LoadMode, int);
00082 vtkGetMacro(LoadMode, int);
00083 vtkBooleanMacro(LoadMode, int);
00084
00085 protected:
00086 vtkGdcmReader();
00087 ~vtkGdcmReader();
00088
00089 virtual void ExecuteInformation();
00090 virtual void ExecuteData(vtkDataObject *output);
00091
00092 virtual void BuildData(vtkDataObject *output);
00093 virtual void BuildFileListFromPattern();
00094 virtual void LoadFileInformation();
00095 virtual void UpdateFileInformation();
00096
00097 virtual void GetFileInformation(gdcm::File *file);
00098 virtual bool TestFileInformation(gdcm::File *file);
00099
00100
00101 private:
00102 void RemoveAllInternalFileName(void);
00103 void AddInternalFileName(const char *name);
00104 void RemoveAllInternalFile(void);
00105
00106
00107 void IncrementProgress(const unsigned long updateProgressTarget,
00108 unsigned long &updateProgressCount);
00109
00110
00111
00112
00113 void LoadImageInMemory(gdcm::File *f, unsigned char *dest,
00114 const unsigned long updateProgressTarget,
00115 unsigned long &updateProgressCount);
00116
00117
00118
00119
00120 typedef std::vector<gdcm::File *> gdcmFileList;
00121
00122
00123 vtkLookupTable *LookupTable;
00124 vtkTimeStamp fileTime;
00125
00126 bool AllowLookupTable;
00127 bool AllowLightChecking;
00128
00129
00130
00131 int NumColumns;
00132
00133 int NumLines;
00134
00135 int NumPlanes;
00136
00137 int TotalNumberOfPlanes;
00138
00139 int NumComponents;
00140
00141 std::string ImageType;
00142
00143 size_t PixelSize;
00144
00145
00146 std::list<std::string> FileNameList;
00147 gdcmFileList *CoherentFileList;
00148 bool OwnFile;
00149
00150
00151
00152
00153
00154
00155
00156 std::list<std::string> InternalFileNameList;
00157 gdcmFileList InternalFileList;
00158 bool Execution;
00159
00160
00161
00167 int LoadMode;
00168
00170 VOID_FUNCTION_PUINT8_PFILE_POINTER UserFunction;
00171
00172 };
00173
00174
00175 #endif
00176