VTK  9.3.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
19 #ifndef vtkOpenSlideReader_h
20 #define vtkOpenSlideReader_h
21 
22 #include "vtkDomainsMicroscopyModule.h" // For export macro
23 #include "vtkImageReader2.h"
24 
25 extern "C"
26 {
27 #include "openslide/openslide.h" // For openslide support
28 }
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class VTKDOMAINSMICROSCOPY_EXPORT vtkOpenSlideReader : public vtkImageReader2
32 {
33 public:
34  static vtkOpenSlideReader* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
41  int CanReadFile(VTK_FILEPATH const char* fname) override;
42 
48  const char* GetFileExtensions() override
49  {
50  return ".ndpi .svs"; // TODO: Get exaustive list of formats
51  }
52 
54 
57  const char* GetDescriptiveName() override { return "Openslide::WholeSlideImage"; }
58 
59 protected:
60  vtkOpenSlideReader() = default;
61  ~vtkOpenSlideReader() override;
63 
64  void ExecuteInformation() override;
65  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
66 
67 private:
68  openslide_t* openslide_handle = nullptr;
69 
70  vtkOpenSlideReader(const vtkOpenSlideReader&) = delete;
71  void operator=(const vtkOpenSlideReader&) = delete;
72 };
73 VTK_ABI_NAMESPACE_END
74 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
const char * GetFileExtensions() override
Get the file extensions for this format.
virtual int CanReadFile(VTK_FILEPATH const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
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
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:54