MeVisLab Toolbox Reference
|
Representation for the DM file as data structure. More...
#include <mlXYLibReaderPlugin.h>
Public Member Functions | |
XYLibReaderPlugin () | |
Constructor. | |
~XYLibReaderPlugin () override | |
Destructor. If still open the the file will also be closed. | |
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. | |
double | getPluginPriority () const override |
XYLibReaderPlugin might detect a loadable file which actually is of another format. | |
MLErrorCode | loadFile (const std::string &fileName) override |
Opens and loads a file such that getPagedImageProperties() and fillSubImage() can be used to retrieve information from the file. | |
size_t | getNumberOfImagesInFile () override |
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. | |
const PagedImage & | getPagedImageProperties () override |
Returns the image properties of the currently loaded image. | |
MLErrorCode | fillSubImage (SubImage &dstSubImage) override |
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. | |
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. | |
void | close () override |
Closes the file and cleans up data structures. | |
bool | supportsFillingInReferenceCoordinates () const override |
Returns true if the loader instance support SubImage filling in reference coordinates, otherwise false. | |
virtual const XYLibHeader & | getHeader () const |
For convenience allow access to _header. | |
Public Member Functions inherited from ml::FileReaderPluginsBase | |
FileReaderPluginsBase () | |
Constructor. | |
virtual | ~FileReaderPluginsBase () |
Destructor cleaning up allocated structures and closing a possibly open file. | |
virtual std::string | getCodedImageIndexString (unsigned int imgIdx) |
If getNumberOfImagesInFile() is <=1 then the plugin string id getTypeId()->getName() is returned, otherwise the string getTypeId()->getName() plus "*#" and the imgIdx. | |
virtual unsigned int | extractImageIndexValue (const std::string &codedLoaderPluginString) |
From a string of the format "LoaderPluginName+#IDX" extract "IDX" as unsigned int, check whether it is smaller than the number of images in getNumberOfImagesInFile() and if yes then return it. | |
virtual void | setSelectedImageIndex (size_t idx=0) |
Selects which image from inside the loaded file shall be used. | |
virtual size_t | getSelectedImageIndex () const |
Returns the currently selected image from inside the loaded file. | |
virtual void | setReferenceForFillingInReferenceCoordinates (const PagedImage *refImg=nullptr) |
If a valid PagedImage pointer is passed then each fillSubImage operation will take into account the difference between the world origin of the given reference PagedImage and ensure that the copySubImage operation fills dstSubImg in world coordinates of refImg; if nullptr is passed then subimage data will be copied from the file assuming that it is located at voxel coordinates (0,0,0,0,0,0) Loaders which do not support world coordinates will silently ignore the given reference image. | |
virtual const PagedImage * | getReferenceForFillingInReferenceCoordinates () 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 FileReaderPluginsBase * | createLoaderInstance (const std::string &fileName) |
Factory functionality: Instantiate a loader for the file name fileName and return a new instance of it or return nullptr if no loader can be created. | |
Additional Inherited Members | |
Protected Member Functions inherited from ml::FileReaderPluginsBase | |
ImageVector | _determineWorldDifferenceAsVoxelShift (const PagedImage &destination) const |
Determines a translation vector for SubImages boxes which represents the world difference between the given two PagedImage. | |
Representation for the DM file as data structure.
Definition at line 33 of file mlXYLibReaderPlugin.h.
ml::XYLibReaderPlugin::XYLibReaderPlugin | ( | ) |
Constructor.
|
override |
Destructor. If still open the the file will also be closed.
|
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.
|
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.
dstSubImage | The subimage to be filled with data from the loaded file where the image regions overlap. Non overlapping regions are left unchanged. |
Implements ml::FileReaderPluginsBase.
|
virtual |
For convenience allow access to _header.
|
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.
|
overridevirtual |
Returns the image properties of the currently loaded image.
Validity can be determined with isValid() on returned object.
Implements ml::FileReaderPluginsBase.
|
overridevirtual |
XYLibReaderPlugin might detect a loadable file which actually is of another format.
Known collisions are, for example, that .raw files of DMFileReaderPlugin are recognized as readable. Therefore use this plugin only if no other loader is found and return the smallest possible priority value. [0,1] is the allowed range, i.e. use 0.
Reimplemented from ml::FileReaderPluginsBase.
|
static |
Returns the string identifier for this plugin.
|
overridevirtual |
This function returns a tag dump of the loaded file or "" if not possible.
Parameters maxNumBinaryEntries and maxNumStringEntries are ignored by this loader.
Reimplemented from ml::FileReaderPluginsBase.
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.
|
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.
fileName | The absolute path to the file to be loaded. |
Implements ml::FileReaderPluginsBase.
|
overridevirtual |
Returns true if the loader instance support SubImage filling in reference coordinates, otherwise false.
Reimplemented from ml::FileReaderPluginsBase.