Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkITKImageSequenceWriter.h
Go to the documentation of this file.
1/*==========================================================================
2
3 Copyright (c) Ebatinca S.L., Las Palmas de Gran Canaria, Spain
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13
14 This file was originally developed by Csaba Pinter, Ebatinca, funded
15 by the grant GRT-00000485 of Children's Hospital of Philadelphia, USA.
16
17==========================================================================*/
18
19#ifndef __vtkITKImageSequenceWriter_h
20#define __vtkITKImageSequenceWriter_h
21
22#include "vtkImageAlgorithm.h"
23#include "vtkImageData.h"
24#include "vtkObjectFactory.h"
25#include "vtkMatrix4x4.h"
26
27#include "vtkITK.h"
28#include "vtkITKImageWriter.h"
29#include "itkImageIOBase.h"
30
31class vtkStringArray;
32class AttributeMapType;
33class AxisInfoMapType;
34
35class VTK_ITK_EXPORT vtkITKImageSequenceWriter : public vtkImageAlgorithm
36{
37public:
39 vtkTypeMacro(vtkITKImageSequenceWriter, vtkImageAlgorithm);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
44 vtkGetMacro(UseCompression, int);
45 vtkSetMacro(UseCompression, int);
46 vtkBooleanMacro(UseCompression, int);
47
50 vtkGetStringMacro(FileName);
51 vtkSetStringMacro(FileName);
52
55 vtkGetStringMacro(ImageIOClassName);
56 vtkSetStringMacro(ImageIOClassName);
57
59 void Write();
60
62 void SetRasToIJKMatrix(vtkMatrix4x4* mat) { RasToIJKMatrix = mat; }
63
66 vtkSetMacro(VoxelVectorType, int);
67 vtkGetMacro(VoxelVectorType, int);
68
70 vtkSetStringMacro(IntentCode);
71 vtkGetStringMacro(IntentCode);
72
76 vtkGetMacro(SequenceAxisSpacing, double);
77
81 vtkGetMacro(SequenceAxisOrigin, double);
82
84 void SetAttribute(const std::string& name, const std::string& value);
86 AttributeMapType* GetAttributes() const { return this->Attributes; }
87
89 void SetAxisLabel(unsigned int axis, const char* label);
91 AxisInfoMapType* GetAxisLabels() const { return this->AxisLabels; }
92
94 void SetAxisUnit(unsigned int axis, const char* unit);
96 AxisInfoMapType* GetAxisUnits() const { return this->AxisUnits; }
97
100 vtkSetStringMacro(VoxelValueUnit);
101 vtkGetStringMacro(VoxelValueUnit);
102
105 vtkSetStringMacro(VoxelValueLabel);
106 vtkGetStringMacro(VoxelValueLabel);
107
108protected:
111
115 int FillInputPortInformation(int port, vtkInformation* info) override;
116
119
122 void UpdateNiftiSequenceAxis(int numberOfFrames);
123
124protected:
125 char* FileName{ nullptr };
126 vtkMatrix4x4* RasToIJKMatrix{ nullptr };
128 char* ImageIOClassName{ nullptr };
130 char* IntentCode{ nullptr };
131 char* VoxelValueUnit{ nullptr };
132 char* VoxelValueLabel{ nullptr };
133 double SequenceAxisSpacing{ 1.0 };
134 double SequenceAxisOrigin{ 0.0 };
135
136 AttributeMapType* Attributes;
137 AxisInfoMapType* AxisLabels;
138 AxisInfoMapType* AxisUnits;
139
140private:
142 void operator=(const vtkITKImageSequenceWriter&) = delete;
143};
144
145#endif
void SetAttribute(const std::string &name, const std::string &value)
Method to set an attribute that will be passed into the NRRD file on write.
AttributeMapType * GetAttributes() const
Get the attributes map.
void SetAxisLabel(unsigned int axis, const char *label)
Method to set label for each axis.
void SetRasToIJKMatrix(vtkMatrix4x4 *mat)
Set orientation matrix.
void Write()
The main interface which triggers the writer to start.
void SetAxisUnit(unsigned int axis, const char *unit)
Method to set unit for each axis.
bool IsNiftiFile()
Returns true if the image is written in NIfTI file format.
void UpdateNiftiSequenceAxis(int numberOfFrames)
static vtkITKImageSequenceWriter * New()
void PrintSelf(ostream &os, vtkIndent indent) override
~vtkITKImageSequenceWriter() override
AxisInfoMapType * GetAxisLabels() const
Get the axis labels map.
AxisInfoMapType * GetAxisUnits() const
Get the axis units map.
int FillInputPortInformation(int port, vtkInformation *info) override