Slicer  5.0
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) 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 
67  vtkBooleanMacro(WriteError, int);
68  vtkSetMacro(WriteError, int);
69  vtkGetMacro(WriteError, int);
70 
73  void SetAttribute(const std::string& name, const std::string& value);
74 
76  void SetAxisLabel(unsigned int axis, const char* label);
77 
79  void SetAxisUnit(unsigned int axis, const char* unit);
80 
84  void SetVectorAxisKind(int kind);
85 
88  vtkSetMacro(Space, int);
89  vtkGetMacro(Space, int);
90 
92  void vtkSetSpaceToRAS() { this->SetSpace(nrrdSpaceRightAnteriorSuperior); };
93  void vtkSetSpaceToRAST() { this->SetSpace(nrrdSpaceRightAnteriorSuperiorTime); };
94 
96  void vtkSetSpaceToLPS() { this->SetSpace(nrrdSpaceLeftPosteriorSuperior); };
97  void vtkSetSpaceToLPST() { this->SetSpace(nrrdSpaceLeftPosteriorSuperiorTime); };
98 
101  vtkSetMacro(ForceRangeAxis, bool);
102  vtkGetMacro(ForceRangeAxis, bool);
103  vtkBooleanMacro(ForceRangeAxis, bool);
104 
106  void* MakeNRRD();
107 
108 protected:
110  ~vtkTeemNRRDWriter() override;
111 
112  int FillInputPortInformation(int port, vtkInformation *info) override;
113 
116  void WriteData() override;
117 
121 
122  char *FileName;
123 
124  vtkDoubleArray* BValues;
125  vtkDoubleArray* DiffusionGradients;
126 
127  vtkMatrix4x4* IJKToRASMatrix;
128  vtkMatrix4x4* MeasurementFrameMatrix;
129 
132  int FileType;
133 
134  AttributeMapType *Attributes;
135  AxisInfoMapType *AxisLabels;
136  AxisInfoMapType *AxisUnits;
138  int Space;
139 
141 
142 private:
143  vtkTeemNRRDWriter(const vtkTeemNRRDWriter&) = delete;
144  void operator=(const vtkTeemNRRDWriter&) = delete;
145  void vtkImageDataInfoToNrrdInfo(vtkImageData *in, int &nrrdKind, size_t &numComp, int &vtkType, void **buffer);
146  int VTKToNrrdPixelType( const int vtkPixelType );
147  int DiffusionWeightedData;
148 };
149 
150 #endif
int WriteError
Flag to set to on when a write error occurred
vtkDoubleArray * BValues
vtkMatrix4x4 * MeasurementFrameMatrix
AxisInfoMapType * AxisLabels
void vtkSetSpaceToRAS()
Set coordinate system to RAS.
Writes PNG files.
AxisInfoMapType * AxisUnits
vtkDoubleArray * DiffusionGradients
vtkMatrix4x4 * IJKToRASMatrix
void vtkSetSpaceToLPS()
Set coordinate system to LPS.
AttributeMapType * Attributes