Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkTeemNRRDWriter.h
Go to the documentation of this file.
1 
2 #ifndef __vtkTeemNRRDWriter_h
3 #define __vtkTeemNRRDWriter_h
4 
5 #include "vtkWriter.h"
6 
7 #include "vtkDoubleArray.h"
8 #include "vtkMatrix4x4.h"
9 #include "vtkSmartPointer.h"
10 #include "teem/nrrd.h"
11 
12 #include "vtkTeemConfigure.h"
13 
14 class vtkImageData;
15 class AttributeMapType;
16 class AxisInfoMapType;
17 
23 class VTK_Teem_EXPORT vtkTeemNRRDWriter : public vtkWriter
24 {
25 public:
26 
27  vtkTypeMacro(vtkTeemNRRDWriter,vtkWriter);
28  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
29 
30  static vtkTeemNRRDWriter *New();
31 
34  vtkImageData* GetInput();
35  vtkImageData* GetInput(int port);
36 
39  vtkSetStringMacro(FileName);
40  vtkGetStringMacro(FileName);
41 
42  vtkSetObjectMacro(DiffusionGradients,vtkDoubleArray);
43  vtkGetObjectMacro(DiffusionGradients,vtkDoubleArray);
44 
45  vtkSetObjectMacro(BValues,vtkDoubleArray);
46  vtkGetObjectMacro(BValues,vtkDoubleArray);
47 
48  vtkSetObjectMacro(IJKToRASMatrix,vtkMatrix4x4);
49  vtkGetObjectMacro(IJKToRASMatrix,vtkMatrix4x4);
50 
51  vtkSetObjectMacro(MeasurementFrameMatrix,vtkMatrix4x4);
52  vtkGetObjectMacro(MeasurementFrameMatrix,vtkMatrix4x4);
53 
54  vtkSetMacro(UseCompression,int);
55  vtkGetMacro(UseCompression,int);
56  vtkBooleanMacro(UseCompression,int);
57 
58  vtkSetClampMacro(CompressionLevel, int, 0, 9);
59  vtkGetMacro(CompressionLevel, int);
60 
61  vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY);
62  vtkGetMacro(FileType,int);
63  void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
64  void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
65 
66  vtkBooleanMacro(WriteError, int);
67  vtkSetMacro(WriteError, int);
68  vtkGetMacro(WriteError, int);
69 
72  void SetAttribute(const std::string& name, const std::string& value);
73 
75  void SetAxisLabel(unsigned int axis, const char* label);
76 
78  void SetAxisUnit(unsigned int axis, const char* unit);
79 
83  void SetVectorAxisKind(int kind);
84 
86  void* MakeNRRD();
87 
88 protected:
91 
92  virtual int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
93 
96  void WriteData() VTK_OVERRIDE;
97 
100  int WriteError;
101 
102  char *FileName;
103 
104  vtkDoubleArray* BValues;
105  vtkDoubleArray* DiffusionGradients;
106 
107  vtkMatrix4x4* IJKToRASMatrix;
108  vtkMatrix4x4* MeasurementFrameMatrix;
109 
110  int UseCompression;
111  int CompressionLevel;
112  int FileType;
113 
114  AttributeMapType *Attributes;
115  AxisInfoMapType *AxisLabels;
116  AxisInfoMapType *AxisUnits;
117  int VectorAxisKind;
118 
119 private:
121  void operator=(const vtkTeemNRRDWriter&);
122  void vtkImageDataInfoToNrrdInfo(vtkImageData *in, int &nrrdKind, size_t &numComp, int &vtkType, void **buffer);
123  int VTKToNrrdPixelType( const int vtkPixelType );
124  int DiffusionWeightedData;
125 };
126 
127 #endif
Writes PNG files.