VTK  9.7.1
vtkOpenSlideReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkOpenSlideReader_h
22 #define vtkOpenSlideReader_h
23 
24 #include "vtkDomainsMicroscopyModule.h" // For export macro
25 #include "vtkImageReader2.h"
26 
27 extern "C"
28 {
29 #include "openslide/openslide.h" // For openslide support
30 }
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class VTKDOMAINSMICROSCOPY_EXPORT vtkOpenSlideReader : public vtkImageReader2
34 {
35 public:
36  static vtkOpenSlideReader* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40  using Superclass::CanReadFile;
44  int CanReadFile(VTK_FILEPATH const char* fname) override;
45 
51  const char* GetFileExtensions() override
52  {
53  return ".ndpi .svs"; // TODO: Get exhaustive list of formats
54  }
55 
57 
60  const char* GetDescriptiveName() override { return "Openslide::WholeSlideImage"; }
61 
62 protected:
63  vtkOpenSlideReader() = default;
64  ~vtkOpenSlideReader() override;
66 
67  void ExecuteInformation() override;
68  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
69 
70 private:
71  openslide_t* openslide_handle = nullptr;
72 
73  vtkOpenSlideReader(const vtkOpenSlideReader&) = delete;
74  void operator=(const vtkOpenSlideReader&) = delete;
75 };
76 VTK_ABI_NAMESPACE_END
77 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
const char * GetFileExtensions() override
Get the file extensions for this format.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
a simple class to control print indentation
Definition: vtkIndent.h:28
read digital whole slide images supported by openslide library
virtual void ExecuteInformation()
Superclass of binary file readers.
#define VTK_FILEPATH
virtual int CanReadFile(const char *fname)
Return non zero if the reader can read the given file name.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:55