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
00070 #ifndef __vtkMINCImageWriter_h
00071 #define __vtkMINCImageWriter_h
00072
00073 #include "vtkImageWriter.h"
00074
00075 class vtkStringArray;
00076 class vtkIdTypeArray;
00077 class vtkDoubleArray;
00078 class vtkMatrix4x4;
00079
00080
00081 class vtkMINCImageAttributes;
00082
00083 class VTK_IO_EXPORT vtkMINCImageWriter : public vtkImageWriter
00084 {
00085 public:
00086 vtkTypeMacro(vtkMINCImageWriter,vtkImageWriter);
00087
00088 static vtkMINCImageWriter *New();
00089 virtual void PrintSelf(ostream& os, vtkIndent indent);
00090
00092
00093 virtual const char* GetFileExtensions() {
00094 return ".mnc"; }
00096
00098
00099 virtual const char* GetDescriptiveName() {
00100 return "MINC"; }
00102
00104 virtual void SetFileName(const char *name);
00105
00109 virtual void Write();
00110
00112
00120 virtual void SetDirectionCosines(vtkMatrix4x4 *matrix);
00121 vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4);
00123
00125
00128 vtkSetMacro(RescaleSlope, double);
00129 vtkGetMacro(RescaleSlope, double);
00130 vtkSetMacro(RescaleIntercept, double);
00131 vtkGetMacro(RescaleIntercept, double);
00133
00135
00137 virtual void SetImageAttributes(vtkMINCImageAttributes *attributes);
00138 virtual vtkMINCImageAttributes *GetImageAttributes() {
00139 return this->ImageAttributes; };
00141
00143
00145 vtkSetMacro(StrictValidation, int);
00146 vtkBooleanMacro(StrictValidation, int);
00147 vtkGetMacro(StrictValidation, int);
00149
00151
00153 vtkSetStringMacro(HistoryAddition);
00154 vtkGetStringMacro(HistoryAddition);
00156
00157 protected:
00158 vtkMINCImageWriter();
00159 ~vtkMINCImageWriter();
00160
00161 int MINCImageType;
00162 int MINCImageTypeSigned;
00163 int MINCImageMinMaxDims;
00164
00165 vtkMatrix4x4 *DirectionCosines;
00166 double RescaleSlope;
00167 double RescaleIntercept;
00168 int StrictValidation;
00169 int DataUpdateExtent[6];
00170
00171 int FileDataType;
00172 double FileValidRange[2];
00173 double InternalRescaleSlope;
00174 double InternalRescaleIntercept;
00175
00176 int ComputeValidRangeFromScalarRange;
00177
00178 vtkStringArray *FileDimensionNames;
00179
00180 vtkMINCImageAttributes *ImageAttributes;
00181
00182 int Permutation[3];
00183 int Flip[3];
00184
00185 int MismatchedInputs;
00186 int MINCFileId;
00187
00188 char *HistoryAddition;
00189
00190 virtual int OpenNetCDFFile(const char *filename, int& ncid);
00191 virtual int CloseNetCDFFile(int ncid);
00192
00193 virtual int IndexFromDimensionName(const char *dimName);
00194 virtual void ComputePermutationFromOrientation(int permutation[3],
00195 int flip[3]);
00196 virtual int CreateMINCDimensions(vtkImageData *input, int timeStep,
00197 int *dimids);
00198 virtual int CreateMINCVariables(vtkImageData *input, int timeStep,
00199 int *dimids);
00200 virtual int WriteMINCFileAttributes(vtkImageData *input, int timeStep);
00201 virtual int WriteMINCData(vtkImageData *input, int frameNumber);
00202 virtual void FindRescale(double &rescaleSlope, double &rescaleIntercept);
00203 virtual void FindMINCValidRange(double range[2]);
00204
00205 virtual int FillInputPortInformation(int port, vtkInformation *info);
00206
00207 virtual int RequestInformation(vtkInformation *request,
00208 vtkInformationVector **inputVector,
00209 vtkInformationVector *outputVector);
00210
00211 virtual int RequestUpdateExtent(vtkInformation *request,
00212 vtkInformationVector **inputVector,
00213 vtkInformationVector *outputVector);
00214
00215 virtual int RequestData(vtkInformation* request,
00216 vtkInformationVector** inputVector,
00217 vtkInformationVector* outputVector);
00218
00219 private:
00220 vtkMINCImageWriter(const vtkMINCImageWriter&);
00221 void operator=(const vtkMINCImageWriter&);
00222
00223 };
00224
00225 #endif