Slicer  4.11
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
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 
100  void* MakeNRRD();
101 
102 protected:
104  ~vtkTeemNRRDWriter() override;
105 
106  int FillInputPortInformation(int port, vtkInformation *info) override;
107 
110  void WriteData() override;
111 
115 
116  char *FileName;
117 
118  vtkDoubleArray* BValues;
119  vtkDoubleArray* DiffusionGradients;
120 
121  vtkMatrix4x4* IJKToRASMatrix;
122  vtkMatrix4x4* MeasurementFrameMatrix;
123 
126  int FileType;
127 
128  AttributeMapType *Attributes;
129  AxisInfoMapType *AxisLabels;
130  AxisInfoMapType *AxisUnits;
132  int Space;
133 
134 private:
135  vtkTeemNRRDWriter(const vtkTeemNRRDWriter&) = delete;
136  void operator=(const vtkTeemNRRDWriter&) = delete;
137  void vtkImageDataInfoToNrrdInfo(vtkImageData *in, int &nrrdKind, size_t &numComp, int &vtkType, void **buffer);
138  int VTKToNrrdPixelType( const int vtkPixelType );
139  int DiffusionWeightedData;
140 };
141 
142 #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