MeVisLab Toolbox Reference
ml::DMFileReaderPlugin Class Reference

Representation for the DM file as data structure. More...

#include <mlDMFileReaderPlugin.h>

Inheritance diagram for ml::DMFileReaderPlugin:
ml::FileReaderPluginsBase

Public Member Functions

 DMFileReaderPlugin ()
 Constructor.
 ~DMFileReaderPlugin () override
 Destructor. If still open the the file will also be closed.
bool isSupported (const std::string &fileName) const override
MLErrorCode loadFile (const std::string &fileName) override
size_t getNumberOfImagesInFile () override
const PagedImagegetPagedImageProperties () override
MLErrorCode fillSubImage (SubImage &dstSubImage) override
std::string getTagDump (const size_t maxNumBinaryEntries=8, const size_t maxNumStringEntries=20) override
void close () override
bool supportsFillingInReferenceCoordinates () const override
 Returns true if the loader instance support SubImage filling in reference coordinates, otherwise false.
Public Member Functions inherited from ml::FileReaderPluginsBase
 FileReaderPluginsBase ()
 Constructor.
virtual ~FileReaderPluginsBase ()
 Destructor cleaning up allocated structures and closing a possibly open file.
virtual double getPluginPriority () const
virtual std::string getCodedImageIndexString (unsigned int imgIdx)
virtual unsigned int extractImageIndexValue (const std::string &codedLoaderPluginString)
virtual void setSelectedImageIndex (size_t idx=0)
virtual size_t getSelectedImageIndex () const
 Returns the currently selected image from inside the loaded file.
virtual void setReferenceForFillingInReferenceCoordinates (const PagedImage *refImg=nullptr)
virtual const PagedImagegetReferenceForFillingInReferenceCoordinates () const
 Returns the recently set "enabled" state set with setSubImageFillingInReferenceCoordinates().

Static Public Member Functions

static std::string getStringIdentifier ()
 Returns the string identifier for this plugin.
Static Public Member Functions inherited from ml::FileReaderPluginsBase
static FileReaderPluginsBasecreateLoaderInstance (const std::string &fileName)

Additional Inherited Members

Protected Member Functions inherited from ml::FileReaderPluginsBase
ImageVector _determineWorldDifferenceAsVoxelShift (const PagedImage &destination) const

Detailed Description

Representation for the DM file as data structure.

Definition at line 31 of file mlDMFileReaderPlugin.h.

Constructor & Destructor Documentation

◆ DMFileReaderPlugin()

ml::DMFileReaderPlugin::DMFileReaderPlugin ( )

Constructor.

Referenced by supportsFillingInReferenceCoordinates().

◆ ~DMFileReaderPlugin()

ml::DMFileReaderPlugin::~DMFileReaderPlugin ( )
override

Destructor. If still open the the file will also be closed.

Member Function Documentation

◆ close()

void ml::DMFileReaderPlugin::close ( )
overridevirtual

Closes the file and cleans up data structures. Property requests and fillSubImage calls will not operate successfully any more after this call.

Implements ml::FileReaderPluginsBase.

◆ fillSubImage()

MLErrorCode ml::DMFileReaderPlugin::fillSubImage ( SubImage & dstSubImage)
overridevirtual

Copy overlapping regions in dstSubImage with image data from the loaded file; note that the calculation of the overlapping region depends on whether a PagedImage was set with setReferenceForFillingInReferenceCoordinates or not. Loaders which do not support filling in reference coordinates (which return false on supportsFillingInReferenceCoordinates()) will silently ignore the reference image.

Parameters
dstSubImageThe subimage to be filled with data from the loaded file where the image regions overlap. Non overlapping regions are left unchanged.
Returns
ML_RESULT_OK on success or an error or a descriptive code explaining the error. On error free operation and empty overlapping region also ML_RESULT_OK is returned.

Implements ml::FileReaderPluginsBase.

◆ getNumberOfImagesInFile()

size_t ml::DMFileReaderPlugin::getNumberOfImagesInFile ( )
overridevirtual

Returns the number of images which are accessible in the loaded file; normally one, but some formats can contain more than on image per file.

Implements ml::FileReaderPluginsBase.

◆ getPagedImageProperties()

const PagedImage & ml::DMFileReaderPlugin::getPagedImageProperties ( )
overridevirtual

Returns the properties of the currently loaded image. Validity can be determined with isValid() on returned object.

Implements ml::FileReaderPluginsBase.

◆ getStringIdentifier()

std::string ml::DMFileReaderPlugin::getStringIdentifier ( )
static

Returns the string identifier for this plugin.

◆ getTagDump()

std::string ml::DMFileReaderPlugin::getTagDump ( const size_t maxNumBinaryEntries = 8,
const size_t maxNumStringEntries = 20 )
overridevirtual

This function returns a tag dump of the loaded file or "" if not possible. If a binary value information is displayed then the number of shown values is controlled with maxNumBinaryEntries; if there are more then "..." is displayed instead. If a string value is displayed then the number of shown characters is controlled with maxNumStringEntries; if there are more then "..." is displayed instead.

Reimplemented from ml::FileReaderPluginsBase.

◆ isSupported()

bool ml::DMFileReaderPlugin::isSupported ( const std::string & fileName) const
overridevirtual

Applies a fast check whether the file is probably supported or not, for
example via the suffix. If false is returned then file is definitely not loadable; if true then opening with loadFile() is worth a try.

Implements ml::FileReaderPluginsBase.

◆ loadFile()

MLErrorCode ml::DMFileReaderPlugin::loadFile ( const std::string & fileName)
overridevirtual

Opens and loads a file such that getPagedImageProperties() and fillSubImage() can be used to retrieve information from the file. Corresponding close is performed with close() or the destructor.

Parameters
fileNameThe absolute path to the file to be loaded.
Returns
ML_RESULT_OK on successfully opened file or a descriptive code explaining the error.

Implements ml::FileReaderPluginsBase.

◆ supportsFillingInReferenceCoordinates()

bool ml::DMFileReaderPlugin::supportsFillingInReferenceCoordinates ( ) const
overridevirtual

Returns true if the loader instance support SubImage filling in reference coordinates, otherwise false.

Reimplemented from ml::FileReaderPluginsBase.

References DMFileReaderPlugin().


The documentation for this class was generated from the following file: