VTK  9.3.20240418
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:
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 exhaustive 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;
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
general representation of visualization data
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store vtkAlgorithm input/output information.
read digital whole slide images supported by openslide library
static vtkOpenSlideReader * New()
vtkOpenSlideReader()=default
Return a descriptive name for the file format that might be useful in a GUI.
~vtkOpenSlideReader() override
Return a descriptive name for the file format that might be useful in a GUI.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ExecuteInformation() override
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
const char * GetFileExtensions() override
Get the file extensions for this format.
int CanReadFile(VTK_FILEPATH const char *fname) override
Is the given file supported ?
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
#define VTK_FILEPATH