Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
29class VTK_Teem_EXPORT vtkTeemNRRDWriter : public vtkWriter
30{
31public:
32 vtkTypeMacro(vtkTeemNRRDWriter, vtkWriter);
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
36
39 vtkImageData* GetInput();
40 vtkImageData* GetInput(int port);
41
44 vtkSetStringMacro(FileName);
45 vtkGetStringMacro(FileName);
46
47 vtkSetObjectMacro(DiffusionGradients, vtkDoubleArray);
48 vtkGetObjectMacro(DiffusionGradients, vtkDoubleArray);
49
50 vtkSetObjectMacro(BValues, vtkDoubleArray);
51 vtkGetObjectMacro(BValues, vtkDoubleArray);
52
53 vtkSetObjectMacro(IJKToRASMatrix, vtkMatrix4x4);
54 vtkGetObjectMacro(IJKToRASMatrix, vtkMatrix4x4);
55
56 vtkSetObjectMacro(MeasurementFrameMatrix, vtkMatrix4x4);
57 vtkGetObjectMacro(MeasurementFrameMatrix, vtkMatrix4x4);
58
59 vtkSetMacro(UseCompression, int);
60 vtkGetMacro(UseCompression, int);
61 vtkBooleanMacro(UseCompression, int);
62
63 vtkSetClampMacro(CompressionLevel, int, 0, 9);
64 vtkGetMacro(CompressionLevel, int);
65
66 vtkSetClampMacro(FileType, int, VTK_ASCII, VTK_BINARY);
67 vtkGetMacro(FileType, int);
68 void SetFileTypeToASCII() { this->SetFileType(VTK_ASCII); };
69 void SetFileTypeToBinary() { this->SetFileType(VTK_BINARY); };
70
72 vtkBooleanMacro(WriteError, int);
73 vtkSetMacro(WriteError, int);
74 vtkGetMacro(WriteError, int);
75
78 void SetAttribute(const std::string& name, const std::string& value);
79
81 void SetAxisLabel(unsigned int axis, const char* label);
82
84 void SetAxisUnit(unsigned int axis, const char* unit);
85
89 void SetVectorAxisKind(int kind);
90
93 vtkSetMacro(Space, int);
94 vtkGetMacro(Space, int);
95
97 void vtkSetSpaceToRAS() { this->SetSpace(nrrdSpaceRightAnteriorSuperior); };
98 void vtkSetSpaceToRAST() { this->SetSpace(nrrdSpaceRightAnteriorSuperiorTime); };
99
101 void vtkSetSpaceToLPS() { this->SetSpace(nrrdSpaceLeftPosteriorSuperior); };
102 void vtkSetSpaceToLPST() { this->SetSpace(nrrdSpaceLeftPosteriorSuperiorTime); };
103
106 vtkSetMacro(ForceRangeAxis, bool);
107 vtkGetMacro(ForceRangeAxis, bool);
108 vtkBooleanMacro(ForceRangeAxis, bool);
109
111 void* MakeNRRD();
112
113protected:
116
117 int FillInputPortInformation(int port, vtkInformation* info) override;
118
121 void WriteData() override;
122
126
127 char* FileName;
128
129 vtkDoubleArray* BValues;
130 vtkDoubleArray* DiffusionGradients;
131
132 vtkMatrix4x4* IJKToRASMatrix;
134
138
139 AttributeMapType* Attributes;
140 AxisInfoMapType* AxisLabels;
141 AxisInfoMapType* AxisUnits;
143 int Space;
144
146
147private:
148 vtkTeemNRRDWriter(const vtkTeemNRRDWriter&) = delete;
149 void operator=(const vtkTeemNRRDWriter&) = delete;
150 void vtkImageDataInfoToNrrdInfo(vtkImageData* in, int& nrrdKind, size_t& numComp, int& vtkType, void** buffer);
151 int VTKToNrrdPixelType(const int vtkPixelType);
152 int DiffusionWeightedData;
153};
154
155#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.