MeVisLab Toolbox Reference
mlDMFileReaderPlugin.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
14 #include <mlModuleIncludes.h>
15 #include <mlTypeDefs.h>
17 #include <mlDMFileReader.h>
18 #include <ThirdPartyWarningsDisable.h>
19 #include <string>
20 #include <ThirdPartyWarningsRestore.h>
21 
22 ML_START_NAMESPACE
23 
25 class SubImage;
26 class PagedImage;
27 
28 //----------------------------------------------------------------------------------
30 //----------------------------------------------------------------------------------
32 public:
34  static std::string getStringIdentifier();
35 
38 
40  ~DMFileReaderPlugin() override;
41 
45  bool isSupported(const std::string &fileName) const override;
46 
53  MLErrorCode loadFile(const std::string &fileName) override;
54 
57  size_t getNumberOfImagesInFile() override;
58 
62 
75  MLErrorCode fillSubImage(SubImage &dstSubImage) override;
76 
84  std::string getTagDump(const size_t maxNumBinaryEntries=8,
85  const size_t maxNumStringEntries=20) override;
86 
89  void close() override;
90 
93 
94 private:
96  std::string _fileName;
97 
99  DMFileReader _reader;
100 
103 };
104 
105 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLFileReaderPlugins_EXPORT
DLL export macro definition.
Representation for the DM file as data structure.
DMFileReaderPlugin()
Constructor.
MLErrorCode fillSubImage(SubImage &dstSubImage) override
Copy overlapping regions in dstSubImage with image data from the loaded file; note that the calculati...
~DMFileReaderPlugin() override
Destructor. If still open the the file will also be closed.
bool supportsFillingInReferenceCoordinates() const override
Returns true if the loader instance support SubImage filling in reference coordinates,...
void close() override
Closes the file and cleans up data structures.
static std::string getStringIdentifier()
Returns the string identifier for this plugin.
bool isSupported(const std::string &fileName) const override
Applies a fast check whether the file is probably supported or not, for example via the suffix.
MLErrorCode loadFile(const std::string &fileName) override
Opens and loads a file such that getPagedImageProperties() and fillSubImage() can be used to retrieve...
size_t getNumberOfImagesInFile() override
Returns the number of images which are accessible in the loaded file; normally one,...
const PagedImage & getPagedImageProperties() override
Returns the properties of the currently loaded image.
std::string getTagDump(const size_t maxNumBinaryEntries=8, const size_t maxNumStringEntries=20) override
This function returns a tag dump of the loaded file or "" if not possible.
A tool classes to load Digital Microscopy files.
Base class for a generic file reader plugin with factory interface.
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition: mlSubImage.h:75
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
Tool classes to load Digital Micrograph (.dm) files.
Header file of base class for a generic file reader plugin with factory interface.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.