VTK  9.2.6
vtkOpenSlideReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenSlideReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkOpenSlideReader_h
32 #define vtkOpenSlideReader_h
33 
34 #include "vtkDomainsMicroscopyModule.h" // For export macro
35 #include "vtkImageReader2.h"
36 
37 extern "C"
38 {
39 #include "openslide/openslide.h" // For openslide support
40 }
41 
42 class VTKDOMAINSMICROSCOPY_EXPORT vtkOpenSlideReader : public vtkImageReader2
43 {
44 public:
45  static vtkOpenSlideReader* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  int CanReadFile(VTK_FILEPATH const char* fname) override;
53 
59  const char* GetFileExtensions() override
60  {
61  return ".ndpi .svs"; // TODO: Get exaustive list of formats
62  }
63 
65 
68  const char* GetDescriptiveName() override { return "Openslide::WholeSlideImage"; }
69 
70 protected:
72  ~vtkOpenSlideReader() override;
74 
75  void ExecuteInformation() override;
76  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
77 
78 private:
79  openslide_t* openslide_handle = nullptr;
80 
81  vtkOpenSlideReader(const vtkOpenSlideReader&) = delete;
82  void operator=(const vtkOpenSlideReader&) = delete;
83 };
84 #endif
vtkOpenSlideReader()
Return a descriptive name for the file format that might be useful in a GUI.
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:39
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:65