VTK
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 =========================================================================*/
28 #ifndef vtkOpenSlideReader_h
29 #define vtkOpenSlideReader_h
30 
31 #include "vtkDomainsMicroscopyModule.h" // For export macro
32 #include "vtkImageReader2.h"
33 
34 extern "C" {
35 #include "openslide/openslide.h" // For openslide support
36 }
37 
38 class VTKDOMAINSMICROSCOPY_EXPORT vtkOpenSlideReader : public vtkImageReader2
39 {
40 public:
41  static vtkOpenSlideReader *New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  int CanReadFile(const char* fname) override;
49 
55  const char* GetFileExtensions() override
56  {
57  return ".ndpi .svs"; // TODO: Get exaustive list of formats
58  }
59 
61 
64  const char* GetDescriptiveName() override
65  {
66  return "Openslide::WholeSlideImage";
67  }
68 protected:
72 
73  void ExecuteInformation() override;
74  void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override;
75 private:
76  openslide_t *openslide_handle;
77 
78  vtkOpenSlideReader(const vtkOpenSlideReader&) = delete;
79  void operator=(const vtkOpenSlideReader&) = delete;
80 };
81 #endif
vtkImageReader2::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageReader2::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkOpenSlideReader
read digital whole slide images supported by openslide library
Definition: vtkOpenSlideReader.h:38
vtkOpenSlideReader::vtkOpenSlideReader
vtkOpenSlideReader()
Definition: vtkOpenSlideReader.h:69
vtkImageReader2::New
static vtkImageReader2 * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:52
vtkOpenSlideReader::GetFileExtensions
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkOpenSlideReader.h:55
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkImageReader2::ExecuteInformation
virtual void ExecuteInformation()
vtkImageReader2::CanReadFile
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
Definition: vtkImageReader2.h:279
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
vtkOpenSlideReader::GetDescriptiveName
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkOpenSlideReader.h:64
vtkImageReader2.h