00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00068 #ifndef __vtkGDCMImageReader_h
00069 #define __vtkGDCMImageReader_h
00070
00071 #include "vtkMedicalImageReader2.h"
00072 #include "vtkImageData.h"
00073 #include "gdcmTypes.h"
00074
00075 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )
00076 #else
00077 class vtkMedicalImageProperties;
00078 #endif
00079 #if ( VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION > 0 )
00080 #else
00081 class vtkStringArray;
00082 #endif
00083 class vtkPolyData;
00084
00085
00086
00087
00088
00089
00090 #ifndef VTK_INVERSE_LUMINANCE
00091 #define VTK_INVERSE_LUMINANCE 5
00092 #endif
00093 #ifndef VTK_LOOKUP_TABLE
00094 #define VTK_LOOKUP_TABLE 6
00095 #endif
00096 #ifndef VTK_YBR
00097 #define VTK_YBR 7
00098 #endif
00099 #ifndef VTK_CMYK
00100 #define VTK_CMYK 8
00101 #endif
00102
00103
00104 namespace gdcm { class ImageReader; }
00105
00106 class vtkMatrix4x4;
00107 class VTK_EXPORT vtkGDCMImageReader : public vtkMedicalImageReader2
00108 {
00109 public:
00110 static vtkGDCMImageReader *New();
00111 vtkTypeRevisionMacro(vtkGDCMImageReader,vtkMedicalImageReader2);
00112 virtual void PrintSelf(ostream& os, vtkIndent indent);
00113
00114 virtual int CanReadFile(const char* fname);
00115
00117
00118 virtual const char* GetFileExtensions()
00119 {
00120
00121 return ".dcm .DCM";
00122 }
00124
00126
00127 virtual const char* GetDescriptiveName()
00128 {
00129 return "DICOM";
00130 }
00132
00134
00136 vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4);
00138
00139 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )
00140 #else
00141
00142
00143 vtkGetObjectMacro(MedicalImageProperties, vtkMedicalImageProperties);
00145 #endif
00146 virtual void SetMedicalImageProperties(vtkMedicalImageProperties *pd);
00147
00148 #if ( VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION > 0 )
00149 #else
00150 virtual void SetFileNames(vtkStringArray*);
00151 vtkGetObjectMacro(FileNames, vtkStringArray);
00152 #endif
00153
00155
00158 vtkGetMacro(LoadOverlays,int);
00159 vtkSetMacro(LoadOverlays,int);
00160 vtkBooleanMacro(LoadOverlays,int);
00162
00164
00166 vtkGetMacro(LoadIconImage,int);
00167 vtkSetMacro(LoadIconImage,int);
00168 vtkBooleanMacro(LoadIconImage,int);
00170
00172
00174 vtkGetMacro(LossyFlag,int);
00175 vtkSetMacro(LossyFlag,int);
00176 vtkBooleanMacro(LossyFlag,int);
00178
00180
00182 vtkGetMacro(NumberOfOverlays,int);
00184
00186
00188 vtkGetMacro(NumberOfIconImages,int);
00190
00192
00195 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )
00196
00198
00199 vtkAlgorithmOutput* GetOverlayPort(int index);
00200 vtkAlgorithmOutput* GetIconImagePort();
00201
00202 #endif
00203 vtkImageData* GetOverlay(int i);
00204 vtkImageData* GetIconImage();
00205
00207
00208 vtkGetMacro(ApplyLookupTable,int);
00209 vtkSetMacro(ApplyLookupTable,int);
00210 vtkBooleanMacro(ApplyLookupTable,int);
00212
00214
00215 vtkGetMacro(ApplyYBRToRGB,int)
00216 vtkSetMacro(ApplyYBRToRGB,int)
00217 vtkBooleanMacro(ApplyYBRToRGB,int);
00219
00221
00225 vtkGetMacro(ImageFormat,int);
00227
00229
00232 vtkGetMacro(PlanarConfiguration,int);
00234
00236
00245 vtkGetVector3Macro(ImagePositionPatient,double);
00246 vtkGetVector6Macro(ImageOrientationPatient,double);
00248
00250
00251 vtkGetObjectMacro(Curve,vtkPolyData);
00252 virtual void SetCurve(vtkPolyData *pd);
00254
00256
00259 vtkGetMacro(Shift,double);
00260 vtkGetMacro(Scale,double);
00262
00263 protected:
00264 vtkGDCMImageReader();
00265 ~vtkGDCMImageReader();
00266
00267 vtkSetVector6Macro(ImageOrientationPatient,double);
00268
00269
00270 void FillMedicalImageInformation(const gdcm::ImageReader &reader);
00271
00272 int RequestInformationCompat();
00273 int RequestDataCompat();
00274
00275 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )
00276 int ProcessRequest(vtkInformation* request,
00277 vtkInformationVector** inputVector,
00278 vtkInformationVector* outputVector);
00279 int RequestInformation(vtkInformation *request,
00280 vtkInformationVector **inputVector,
00281 vtkInformationVector *outputVector);
00282 int RequestData(vtkInformation *request,
00283 vtkInformationVector **inputVector,
00284 vtkInformationVector *outputVector);
00285 #else
00286 void ExecuteInformation();
00287 void ExecuteData(vtkDataObject *out);
00288 #endif
00289
00290 protected:
00291 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )
00292 #else
00293
00294 vtkMedicalImageProperties *MedicalImageProperties;
00295 #endif
00296 #if ( VTK_MAJOR_VERSION == 5 && VTK_MINOR_VERSION > 0 )
00297 #else
00298 vtkStringArray *FileNames;
00299 #endif
00300
00301 vtkMatrix4x4 *DirectionCosines;
00302 int LoadOverlays;
00303 int NumberOfOverlays;
00304 int LoadIconImage;
00305 int NumberOfIconImages;
00306 int IconImageDataExtent[6];
00307 double ImagePositionPatient[3];
00308 double ImageOrientationPatient[6];
00309 vtkPolyData *Curve;
00310
00311 int ImageFormat;
00312
00313 int ApplyInverseVideo;
00314 int ApplyLookupTable;
00315 int ApplyYBRToRGB;
00316
00317 int ApplyPlanarConfiguration;
00318 int ApplyShiftScale;
00319
00320 int LoadSingleFile(const char *filename, char *pointer, unsigned long &outlen);
00321
00322 double Shift;
00323 double Scale;
00324 int IconDataScalarType;
00325 int IconNumberOfScalarComponents;
00326 int PlanarConfiguration;
00327 int LossyFlag;
00328
00329 protected:
00330
00331 void SetFilePrefix(const char *) {}
00332 vtkGetStringMacro(FilePrefix);
00333 void SetFilePattern(const char *) {}
00334 vtkGetStringMacro(FilePattern);
00335
00336 private:
00337 vtkGDCMImageReader(const vtkGDCMImageReader&);
00338 void operator=(const vtkGDCMImageReader&);
00339 };
00340 #endif
00341