Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkITKImageSequenceReader.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 __vtkITKImageSequenceReader_h
20#define __vtkITKImageSequenceReader_h
21
22#include "vtkMedicalImageReader2.h"
23
24#include "vtkMatrix4x4.h"
25
26#include "vtkITK.h"
27#include "vtkITKImageWriter.h"
28
29class VTK_ITK_EXPORT vtkITKImageSequenceReader : public vtkMedicalImageReader2
30{
31public:
33 vtkTypeMacro(vtkITKImageSequenceReader, vtkMedicalImageReader2);
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
37 vtkSetMacro(CurrentFrameIndex, unsigned int);
39 vtkGetMacro(CurrentFrameIndex, unsigned int);
40
42 vtkSetMacro(NumberOfFrames, unsigned int);
44 vtkGetMacro(NumberOfFrames, unsigned int);
45
47 vtkSetObjectMacro(RasToIjkMatrix, vtkMatrix4x4);
48 vtkGetObjectMacro(RasToIjkMatrix, vtkMatrix4x4);
49
51 vtkSetMacro(VoxelVectorType, int);
52 vtkGetMacro(VoxelVectorType, int);
53
55 const std::vector<std::string> GetHeaderKeysVector();
57 const std::map<std::string, std::string> GetHeaderKeysMap();
59 const char* GetHeaderValue(const char* key);
60
62 const char* GetAxisLabel(unsigned int axis);
63
65 const char* GetAxisUnit(unsigned int axis);
66
67 vtkGetMacro(SequenceAxisLabel, std::string);
68 vtkGetMacro(SequenceAxisUnit, std::string);
69
71 vtkImageData* GetCachedImage(unsigned int index);
73
74protected:
77
78 // void ExecuteInformation() override;
79 void ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo) override;
80
81protected:
83 unsigned int CurrentFrameIndex{ 0 };
84
86 unsigned int NumberOfFrames{ 0 };
87
89 vtkMatrix4x4* RasToIjkMatrix{ nullptr };
90
92
94 std::map<std::string, std::string> HeaderKeyValueMap;
95
96 // Axis labels read from the header.
97 std::map<unsigned int, std::string> AxisLabels;
98 // Axis units read from the header.
99 std::map<unsigned int, std::string> AxisUnits;
100 // Sequence axis label read from the header.
101 std::string SequenceAxisLabel;
102 // Sequence axis unit read from the header.
103 std::string SequenceAxisUnit;
104
105 std::vector<vtkSmartPointer<vtkImageData>> CachedImages;
106
107private:
109 void operator=(const vtkITKImageSequenceReader&) = delete;
110};
111
112#endif
vtkMatrix4x4 * RasToIjkMatrix
RAS to IJK matrix.
const char * GetAxisUnit(unsigned int axis)
Get unit for specified axis.
std::map< unsigned int, std::string > AxisUnits
void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo) override
vtkImageData * GetCachedImage(unsigned int index)
std::map< unsigned int, std::string > AxisLabels
std::map< std::string, std::string > HeaderKeyValueMap
Key/value pairs read from the header.
void PrintSelf(ostream &os, vtkIndent indent) override
const std::map< std::string, std::string > GetHeaderKeysMap()
Get the map of keys in the header.
unsigned int CurrentFrameIndex
Current frame index that is extracted from the sequence image to the output port.
unsigned int NumberOfFrames
Number of frames in recently read image. Set in first Update. Read only.
const char * GetAxisLabel(unsigned int axis)
Get label for specified axis.
~vtkITKImageSequenceReader() override
static vtkITKImageSequenceReader * New()
const std::vector< std::string > GetHeaderKeysVector()
Get the list of keys in the header.
const char * GetHeaderValue(const char *key)
Get a value given a key in the header.
std::vector< vtkSmartPointer< vtkImageData > > CachedImages
unsigned int GetNumberOfCachedImages()