00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00073 #ifndef __vtkMINCImageReader_h
00074 #define __vtkMINCImageReader_h
00075
00076 #include "vtkImageReader2.h"
00077
00078 class vtkStringArray;
00079 class vtkIdTypeArray;
00080 class vtkDoubleArray;
00081 class vtkMatrix4x4;
00082
00083
00084 class vtkMINCImageAttributes;
00085
00086 class VTK_IO_EXPORT vtkMINCImageReader : public vtkImageReader2
00087 {
00088 public:
00089 vtkTypeMacro(vtkMINCImageReader,vtkImageReader2);
00090
00091 static vtkMINCImageReader *New();
00092 virtual void PrintSelf(ostream& os, vtkIndent indent);
00093
00095 virtual void SetFileName(const char *name);
00096
00098
00099 virtual const char* GetFileExtensions() {
00100 return ".mnc"; }
00102
00104
00105 virtual const char* GetDescriptiveName() {
00106 return "MINC"; }
00108
00110 virtual int CanReadFile(const char* name);
00111
00115 virtual vtkMatrix4x4 *GetDirectionCosines();
00116
00118
00121 virtual double GetRescaleSlope();
00122 virtual double GetRescaleIntercept();
00124
00126
00129 vtkSetMacro(RescaleRealValues, int);
00130 vtkBooleanMacro(RescaleRealValues, int);
00131 vtkGetMacro(RescaleRealValues, int);
00133
00135
00139 virtual double *GetDataRange();
00140 virtual void GetDataRange(double range[2]) {
00141 double *r = this->GetDataRange();
00142 range[0] = r[0]; range[1] = r[1]; };
00144
00146 virtual int GetNumberOfTimeSteps();
00147
00149
00150 vtkSetMacro(TimeStep, int);
00151 vtkGetMacro(TimeStep, int);
00153
00156 virtual vtkMINCImageAttributes *GetImageAttributes();
00157
00158 protected:
00159 vtkMINCImageReader();
00160 ~vtkMINCImageReader();
00161
00162 int MINCImageType;
00163 int MINCImageTypeSigned;
00164
00165 double ValidRange[2];
00166 double ImageRange[2];
00167 double DataRange[2];
00168
00169 int NumberOfTimeSteps;
00170 int TimeStep;
00171 vtkMatrix4x4 *DirectionCosines;
00172 double RescaleSlope;
00173 double RescaleIntercept;
00174 int RescaleRealValues;
00175 vtkMINCImageAttributes *ImageAttributes;
00176
00177 int FileNameHasChanged;
00178
00179 virtual int OpenNetCDFFile(const char *filename, int& ncid);
00180 virtual int CloseNetCDFFile(int ncid);
00181 virtual int IndexFromDimensionName(const char *dimName);
00182 virtual int ReadMINCFileAttributes();
00183 virtual void FindRangeAndRescaleValues();
00184 static int ConvertMINCTypeToVTKType(int minctype, int mincsigned);
00185
00186 virtual void ExecuteInformation();
00187 virtual void ExecuteData(vtkDataObject *out);
00188
00189 private:
00190 vtkMINCImageReader(const vtkMINCImageReader&);
00191 void operator=(const vtkMINCImageReader&);
00192
00193 };
00194
00195 #endif