VTK  9.2.6
vtkSEPReader.h
Go to the documentation of this file.
1/*=========================================================================
2 Copyright (c) GeometryFactory
3 All rights reserved.
4 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
5
6 This software is distributed WITHOUT ANY WARRANTY; without even
7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 PURPOSE. See the above copyright notice for more information.
9
10=========================================================================*/
21
22#ifndef vtkSEPReader_h
23#define vtkSEPReader_h
24
25#include "vtkIOImageModule.h" // For export macro
26
27#include "vtkExtentTranslator.h" // for vtkExtentTranslator
28#include "vtkImageAlgorithm.h"
29#include "vtkNew.h" // for ivars
30
31#include <array> // for std::array
32#include <cstdint> // for std::uint8_t
33#include <string> // for std::string
34
35namespace details
36{
37enum class EndiannessType : std::uint8_t
38{
41};
42
43static constexpr int SEP_READER_MAX_DIMENSION = 32u;
44}
45
46class vtkStringArray;
47
48class VTKIOIMAGE_EXPORT vtkSEPReader : public vtkImageAlgorithm
49{
50public:
51 static vtkSEPReader* New();
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
60
65 vtkGetMacro(OutputGridDimension, int);
66 vtkSetMacro(OutputGridDimension, int);
67
72 vtkSetMacro(ExtentSplitMode, int);
73 vtkGetMacro(ExtentSplitMode, int);
74
75 vtkGetMacro(DataOrigin, VTK_FUTURE_CONST double*);
76 vtkGetMacro(DataSpacing, VTK_FUTURE_CONST double*);
77
82 vtkGetObjectMacro(AllDimensions, vtkStringArray);
83
88 vtkGetObjectMacro(AllRanges, vtkStringArray);
89
100
101 vtkSetMacro(FixedDimensionValue1, int);
102 vtkSetMacro(FixedDimensionValue2, int);
103 vtkGetVector2Macro(FixedDimRange, int);
104
105 bool CanReadFile(VTK_FILEPATH const char*);
106
107 std::array<std::int32_t, 6> ComputeExtent() const;
108
109protected:
111
114
116 bool ReadData(vtkImageData*, int*);
117
121 std::string FileName = "";
126 std::string XDimension = "CDP";
127 std::string YDimension = "LINE";
128 std::string ZDimension = "DEPTH"; // used only in 3D
129 std::string FixedDimension1 = "OFFSET";
130 std::string FixedDimension2 = "DEPTH"; // used only in 2D
133 int FixedDimRange[2] = { 0, 0 };
134
137
138private:
139 enum class DataFormatType : std::uint8_t
140 {
141 XDR_FLOAT = 0,
142 XDR_INT = 1,
143 XDR_DOUBLE = 2
144 };
145
149 DataFormatType DataFormat = DataFormatType::XDR_FLOAT;
150 details::EndiannessType Endianness;
151 int Dimensions[details::SEP_READER_MAX_DIMENSION];
152 double OutputSpacing[3];
153 double OutputOrigin[3];
154 std::string Label[details::SEP_READER_MAX_DIMENSION];
155 std::string DataFileType;
156 std::string BinaryFilename;
157 int ESize = 4;
161 int FixedDimension1ArrayId = details::SEP_READER_MAX_DIMENSION;
162 int FixedDimension2ArrayId = details::SEP_READER_MAX_DIMENSION;
163
164 void ReadDataPiece(FILE* file, char*& dataOutput, vtkIdType offset, vtkIdType range);
165
166 vtkSEPReader(const vtkSEPReader&) = delete;
167 void operator=(const vtkSEPReader&) = delete;
168};
169
170#endif // vtkSEPReader_h
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:62
Stanford Exploration Project files reader.
int FixedDimensionValue2
std::array< std::int32_t, 6 > ComputeExtent() const
int RequestData(vtkInformation *request, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
std::string ZDimension
double DataOrigin[details::SEP_READER_MAX_DIMENSION]
vtkGetCharFromStdStringMacro(FileName)
int FixedDimRange[2]
vtkSetStdStringFromCharMacro(ZDimension)
vtkNew< vtkStringArray > AllRanges
vtkSetStdStringFromCharMacro(YDimension)
std::string FileName
Exposed Properties.
int FixedDimensionValue1
vtkSetStdStringFromCharMacro(FixedDimension2)
bool ReadData(vtkImageData *, int *)
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkNew< vtkStringArray > AllDimensions
vtkSetStdStringFromCharMacro(XDimension)
Specify the name for each spatial / fixed dimension.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetStdStringFromCharMacro(FixedDimension1)
std::string YDimension
int OutputGridDimension
std::string XDimension
bool ReadHeader()
double DataSpacing[details::SEP_READER_MAX_DIMENSION]
std::string FixedDimension2
static vtkSEPReader * New()
bool CanReadFile(VTK_FILEPATH const char *)
vtkSetStdStringFromCharMacro(FileName)
Specify file name for the SEP Header file.
std::string FixedDimension1
a vtkAbstractArray subclass for strings
static constexpr int SEP_READER_MAX_DIMENSION
int vtkIdType
Definition vtkType.h:332
#define VTK_FILEPATH