VTK  9.7.1
vtkNrrdReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
26 #ifndef vtkNrrdReader_h
27 #define vtkNrrdReader_h
28 
29 #include "vtkIOImageModule.h" // For export macro
30 #include "vtkImageReader.h"
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCharArray;
34 
35 class VTKIOIMAGE_EXPORT vtkNrrdReader : public vtkImageReader
36 {
37 public:
38  vtkTypeMacro(vtkNrrdReader, vtkImageReader);
39  static vtkNrrdReader* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43  int CanReadFile(VTK_FILEPATH const char* filename) override;
44 
45 protected:
46  vtkNrrdReader();
47  ~vtkNrrdReader() override;
48 
49  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
50  vtkInformationVector* outputVector) override;
51 
52  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
53  vtkInformationVector* outputVector) override;
54 
55  int ReadHeaderInternal(vtkCharArray* headerBuffer);
56  virtual int ReadHeader();
57  virtual int ReadHeader(vtkCharArray* headerBuffer);
58 
59  virtual int ReadDataAscii(vtkImageData* output);
60 
61  template <typename T>
62  int vtkNrrdReaderReadDataGZipTemplate(vtkImageData* output, T* outBuffer);
63  virtual int ReadDataGZip(vtkImageData* output);
64 
66 
67  enum
68  {
71  ENCODING_GZIP
72  };
73 
74  int Encoding;
75 
76 private:
77  vtkNrrdReader(const vtkNrrdReader&) = delete;
78  void operator=(const vtkNrrdReader&) = delete;
79 };
80 
81 VTK_ABI_NAMESPACE_END
82 #endif // vtkNrrdReader_h
Store vtkAlgorithm input/output information.
a vtkAbstractArray subclass for strings
static vtkImageReader * New()
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:44
vtkStringArray * DataFiles
Definition: vtkNrrdReader.h:65
a simple class to control print indentation
Definition: vtkIndent.h:28
Superclass of transformable binary file readers.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
Read nrrd files file system.
Definition: vtkNrrdReader.h:35
int CanReadFile(const char *) override
vtkImageReader itself can read raw binary files.
#define VTK_FILEPATH
virtual int CanReadFile(const char *fname)
Return non zero if the reader can read the given file name.
Store zero or more vtkInformation instances.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.