Slicer 5.9
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
14class vtkImageData;
15class AttributeMapType;
16class AxisInfoMapType;
17
23class VTK_Teem_EXPORT vtkTeemNRRDWriter : public vtkWriter
24{
25public:
26
27 vtkTypeMacro(vtkTeemNRRDWriter,vtkWriter);
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
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
108protected:
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;
129
133
134 AttributeMapType *Attributes;
135 AxisInfoMapType *AxisLabels;
136 AxisInfoMapType *AxisUnits;
138 int Space;
139
141
142private:
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
AxisInfoMapType * AxisLabels
AttributeMapType * Attributes
AxisInfoMapType * AxisUnits
virtual void SetFileType(int)
virtual void SetSpace(int)
static vtkTeemNRRDWriter * New()
void SetVectorAxisKind(int kind)
void * MakeNRRD()
Utility function to return image as a Nrrd*.
void SetAttribute(const std::string &name, const std::string &value)
vtkMatrix4x4 * IJKToRASMatrix
~vtkTeemNRRDWriter() override
vtkDoubleArray * BValues
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMatrix4x4 * MeasurementFrameMatrix
void WriteData() override
Write method. It is called by vtkWriter::Write();.
vtkDoubleArray * DiffusionGradients
int FillInputPortInformation(int port, vtkInformation *info) override
vtkImageData * GetInput(int port)
void SetAxisLabel(unsigned int axis, const char *label)
Method to set label for each axis.
void vtkSetSpaceToRAS()
Set coordinate system to RAS.
void SetAxisUnit(unsigned int axis, const char *unit)
Method to set unit for each axis.
int WriteError
Flag to set to on when a write error occurred.
vtkImageData * GetInput()
Get the input to this writer.
void vtkSetSpaceToLPS()
Set coordinate system to LPS.