VTK  9.2.6
vtkNrrdReader.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkNrrdReader.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 /*----------------------------------------------------------------------------
17  Copyright (c) Sandia Corporation
18  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
19 ----------------------------------------------------------------------------*/
20 
42 #ifndef vtkNrrdReader_h
43 #define vtkNrrdReader_h
44 
45 #include "vtkIOImageModule.h" // For export macro
46 #include "vtkImageReader.h"
47 
48 class vtkCharArray;
49 
50 class VTKIOIMAGE_EXPORT vtkNrrdReader : public vtkImageReader
51 {
52 public:
53  vtkTypeMacro(vtkNrrdReader, vtkImageReader);
54  static vtkNrrdReader* New();
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
57  int CanReadFile(VTK_FILEPATH const char* filename) override;
58 
59 protected:
60  vtkNrrdReader();
61  ~vtkNrrdReader() override;
62 
63  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
64  vtkInformationVector* outputVector) override;
65 
66  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
67  vtkInformationVector* outputVector) override;
68 
69  int ReadHeaderInternal(vtkCharArray* headerBuffer);
70  virtual int ReadHeader();
71  virtual int ReadHeader(vtkCharArray* headerBuffer);
72 
73  virtual int ReadDataAscii(vtkImageData* output);
74 
75  template <typename T>
76  int vtkNrrdReaderReadDataGZipTemplate(vtkImageData* output, T* outBuffer);
77  virtual int ReadDataGZip(vtkImageData* output);
78 
80 
81  enum
82  {
85  ENCODING_GZIP
86  };
87 
88  int Encoding;
89 
90 private:
91  vtkNrrdReader(const vtkNrrdReader&) = delete;
92  void operator=(const vtkNrrdReader&) = delete;
93 };
94 
95 #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:51
vtkStringArray * DataFiles
Definition: vtkNrrdReader.h:79
a simple class to control print indentation
Definition: vtkIndent.h:39
Superclass of transformable binary file readers.
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
int CanReadFile(VTK_FILEPATH const char *) override
vtkImageReader itself can read raw binary files.
Read nrrd files file system.
Definition: vtkNrrdReader.h:50
#define VTK_FILEPATH
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.