00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 Module: $URL$ 00005 00006 Copyright (c) 2006-2010 Mathieu Malaterre 00007 All rights reserved. 00008 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 // .NAME vtkGDCMThreadedImageReader - read DICOM files with multiple threads 00016 // .SECTION Description 00017 // vtkGDCMThreadedImageReader is a source object that reads some DICOM files 00018 // This reader is threaded. Meaning that on a multiple core CPU with N cpu, it will 00019 // read approx N times faster than when reading in a single thread. 00020 // 00021 // .SECTION Warning: Advanced users only. Do not use this class in the general case, 00022 // you have to understand how physicaly medium works first (sequencial reading for 00023 // instance) before playing with this class 00024 // 00025 // .SECTION Implementation note: when FileLowerLeft is set to on the image is not flipped 00026 // upside down as VTK would expect, use this option only if you know what you are doing 00027 // 00028 // .SECTION FIXME: need to implement the other mode where FileLowerLeft is set to OFF 00029 // 00030 // .SECTION FIXME: you need to call SetFileName when reading a volume file (multiple slices DICOM) 00031 // since SetFileNames expect each single file to be single slice (see parent class) 00032 // 00033 // .SECTION BUG: you should really consider using vtkGDCMThreadedImageReader2 instead ! 00034 // 00035 // .SECTION See Also 00036 // vtkMedicalImageReader2 vtkMedicalImageProperties vtkGDCMThreadedImageReader2 00037 00038 #ifndef VTKGDCMTHREADEDIMAGEREADER_H 00039 #define VTKGDCMTHREADEDIMAGEREADER_H 00040 00041 #include "vtkGDCMImageReader.h" 00042 00043 class VTK_EXPORT vtkGDCMThreadedImageReader : public vtkGDCMImageReader 00044 { 00045 public: 00046 static vtkGDCMThreadedImageReader *New(); 00047 vtkTypeRevisionMacro(vtkGDCMThreadedImageReader,vtkGDCMImageReader); 00048 virtual void PrintSelf(ostream& os, vtkIndent indent); 00049 00050 // Description: 00051 // Explicitely set the Rescale Intercept (0028,1052) 00052 vtkSetMacro(Shift,double); 00053 00054 // Description: 00055 // Explicitely get/set the Rescale Slope (0028,1053) 00056 vtkSetMacro(Scale,double); 00057 00058 // Description: 00059 // Determine whether or not reader should use value from Shift/Scale 00060 // Default is 1 00061 vtkSetMacro(UseShiftScale,int); 00062 vtkGetMacro(UseShiftScale,int); 00063 vtkBooleanMacro(UseShiftScale,int); 00064 00065 // Within this class this is allowed to set the Number of Overlays from outside 00066 //vtkSetMacro(NumberOfOverlays,int); 00067 00068 protected: 00069 vtkGDCMThreadedImageReader(); 00070 ~vtkGDCMThreadedImageReader(); 00071 00072 #if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 ) 00073 int RequestInformation(vtkInformation *request, 00074 vtkInformationVector **inputVector, 00075 vtkInformationVector *outputVector); 00076 int RequestData(vtkInformation *request, 00077 vtkInformationVector **inputVector, 00078 vtkInformationVector *outputVector); 00079 #else /*(VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )*/ 00080 void ExecuteInformation(); 00081 void ExecuteData(vtkDataObject *out); 00082 #endif /*(VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 5 )*/ 00083 00084 void ReadFiles(unsigned int nfiles, const char *filenames[]); 00085 void RequestDataCompat(); 00086 00087 private: 00088 vtkGDCMThreadedImageReader(const vtkGDCMThreadedImageReader&); // Not implemented. 00089 void operator=(const vtkGDCMThreadedImageReader&); // Not implemented. 00090 00091 int UseShiftScale; 00092 }; 00093 00094 #endif