Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkNRRDWriter.h
Go to the documentation of this file.
1 
2 #ifndef __vtkNRRDWriter_h
3 #define __vtkNRRDWriter_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 vtkNRRDWriter : public vtkWriter
24 {
25 public:
26 
27  vtkTypeMacro(vtkNRRDWriter,vtkWriter);
28  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
29 
30  static vtkNRRDWriter *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(FileType,int,VTK_ASCII,VTK_BINARY);
59  vtkGetMacro(FileType,int);
60  void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
61  void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
62 
63  vtkBooleanMacro(WriteError, int);
64  vtkSetMacro(WriteError, int);
65  vtkGetMacro(WriteError, int);
66 
69  void SetAttribute(const std::string& name, const std::string& value);
70 
72  void SetAxisLabel(unsigned int axis, const char* label);
73 
75  void SetAxisUnit(unsigned int axis, const char* unit);
76 
78  void* MakeNRRD();
79 
80 protected:
81  vtkNRRDWriter();
82  ~vtkNRRDWriter();
83 
84  virtual int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
85 
88  void WriteData() VTK_OVERRIDE;
89 
93 
94  char *FileName;
95 
96  vtkDoubleArray* BValues;
97  vtkDoubleArray* DiffusionGradients;
98 
99  vtkMatrix4x4* IJKToRASMatrix;
100  vtkMatrix4x4* MeasurementFrameMatrix;
101 
103  int FileType;
104 
105  AttributeMapType *Attributes;
106  AxisInfoMapType *AxisLabels;
107  AxisInfoMapType *AxisUnits;
108 
109 private:
110  vtkNRRDWriter(const vtkNRRDWriter&);
111  void operator=(const vtkNRRDWriter&);
112  void vtkImageDataInfoToNrrdInfo(vtkImageData *in, int &nrrdKind, size_t &numComp, int &vtkType, void **buffer);
113  int VTKToNrrdPixelType( const int vtkPixelType );
114  int DiffusionWeigthedData;
115 };
116 
117 #endif
Writes PNG files.
Definition: vtkNRRDWriter.h:23
AttributeMapType * Attributes
int WriteError
Flag to set to on when a write error occured.
Definition: vtkNRRDWriter.h:92
void SetFileTypeToBinary()
Definition: vtkNRRDWriter.h:61
vtkMatrix4x4 * MeasurementFrameMatrix
vtkDoubleArray * DiffusionGradients
Definition: vtkNRRDWriter.h:97
vtkDoubleArray * BValues
Definition: vtkNRRDWriter.h:96
void SetFileTypeToASCII()
Definition: vtkNRRDWriter.h:60
AxisInfoMapType * AxisLabels
vtkMatrix4x4 * IJKToRASMatrix
Definition: vtkNRRDWriter.h:99
AxisInfoMapType * AxisUnits