MeVisLab Toolbox Reference
mlModuleLoaderBackends.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
7
12//----------------------------------------------------------------------------------
13#pragma once
14
15// Local includes
17
18// DICOM tree prototypes
19#include <DCMTree_Lib.h>
20
21// ML includes
22#include <mlModuleIncludes.h>
23#include <mlAPI.h>
24
25ML_START_NAMESPACE
26
27// Forward of internally used classes.
28class MLImageFormat;
29class ProgressLogger;
30
66
67//----------------------------------------------------------------------------------
69//----------------------------------------------------------------------------------
70namespace ModuleLoaderBackends {
71
73 enum {
75 };
76
79 SubImage &outSubImg,
80 const ImageVector &corrOffset,
81 MLImageFormat **loader,
82 bool loadFullImage=false);
83
86 const std::string &outFileName,
87 const std::string &mliCompress,
88 bool updateMinMaxAfterSave);
89
91 MLMODULE_LOADER_BACKENDS_EXPORT void getDCMTreeFromMLImageFile(const std::string &mlImageFileName,
93 size_t &numVols,
94 MLErrorCode &fileLoadError,
95 MLErrorCode &treeExtractError);
96
99 SubImage &outSubImg,
100 const ImageVector &corrOffset,
101 MLint dcmTiffExtZ,
102 const bool isDCMTiff,
103 bool loadFullImage=false);
104
107 const std::string &outFileName);
108
111 const std::string &outFile,
112 MLint ext,
113 bool useMiddleSlice=true,
114 bool buildNoPreviewImageOnInvalidImage=false);
115
118 SubImage &outSubImg,
119 const ImageVector &corrOffset,
120 MLDataType fileDataType,
121 Module **loader,
122 DCMTree::Const_TreePtr constTreePtr,
123 bool dstIsRGB,
124 std::string *metaDataDump=nullptr,
125 bool loadFullImage=false,
126 size_t itkLoadDim=3,
127 bool hideErrorPosts=false,
128 const SubImageBox &expectedImageExtent=SubImageBox());
129
132 SubImage &outSubImg,
133 const ImageVector &corrOffset,
134 Module **loaderToCreate,
135 bool loadFullImage,
136 PagedImage *pagedImg=nullptr,
137 MLint level=0);
138
141
144 PagedImage &pImgProps,
145 std::string &fileFormat);
146
149 PagedImage &pImgProps);
150
151
176 const std::string &moduleName,
177 const std::vector<std::string> &expectedFields,
178 Module **module,
179 Module **moduleToUse);
180
185 MLMODULE_LOADER_BACKENDS_EXPORT std::string getPreferredLoader(const std::string &fileName);
186};
187
188ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLMODULE_LOADER_BACKENDS_EXPORT
DLL export macro definition.
File format class to store, load, and modify a PagedImage in a file.
Small class only used for script wrapper and to observe global ModuleLoaderBackends a bit,...
static const MLuint64 ML_MODULE_LOADER_ITK_IMAGE_FILE_READER_BACKEND
itkImageFileReader backend bit.
static const MLuint64 ML_MODULE_LOADER_NO_BACKENDS
Bit masks describing all, none or specific (ORable) backends.
static const MLuint64 ML_MODULE_LOADER_ALL_BACKENDS
Bits of all backends.
static void allow(bool allowUsage=true)
Same as setAllowed(MLuint64 mask=ML_NAMESPACE::ModuleLoaderBackendsControl::ML_MODULE_LOADER_ALL_BACK...
static const MLuint64 ML_MODULE_LOADER_HISTO_LOAD_BACKEND
HistoLoad backend bit.
static MLuint64 getAllowed()
Returns the ORed-mask of allowed loader backends which can can be used, enabled bits denote.
static void setAllowed(const MLuint64 backendsMask=ML_MODULE_LOADER_ALL_BACKENDS)
Globally disables/enables whether loader backend can be used or not.
ModuleLoaderBackendsControl()
Default constructor.
ML_MODULE_CLASS_HEADER(ModuleLoaderBackendsControl)
Implements interface for the runtime type system of the ML.
static const MLuint64 ML_MODULE_LOADER_ML_IMAGE_FORMAT_BACKEND
MLImageFormat backend bit.
static const MLuint64 ML_MODULE_LOADER_IMAGE_LOAD_BACKEND
ImageLoader backend bit.
~ModuleLoaderBackendsControl()
Denstructor.
Base class for an image processing module of the ML.
Definition mlModule.h:151
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
This class manages/represents a rectangular 6D image region that is organized linearly in memory.
Definition mlSubImage.h:75
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:595
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:715
UINT64 MLuint64
Introduce platform-independent 64-bit unsigned integer type.
Definition mlTypeDefs.h:424
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
MLMODULE_LOADER_BACKENDS_EXPORT void destroyMLImageFormatFileReaderInstance(MLImageFormat *&instance)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode createAndSaveThumbNail(PagedImage &srcImg, const std::string &outFile, MLint ext, bool useMiddleSlice=true, bool buildNoPreviewImageOnInvalidImage=false)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode getImagePropertiesWithMLImageFormatReader(const std::string &fileName, PagedImage &pImgProps)
See corresponding function in ModuleLoaderBackends::CoreInterface.
@ InterleavedPlanarConfig
The MFL planar config enumerator kMFLfmtPcnfContig for "continuous" or interleaved such as RGBRGBRGB.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode saveAsMLImageFormat(PagedImage &imgToSave, const std::string &outFileName, const std::string &mliCompress, bool updateMinMaxAfterSave)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT std::string getPreferredLoader(const std::string &fileName)
If it is possible to derive a preferred loader from the given fileName then the name of the loader is...
MLMODULE_LOADER_BACKENDS_EXPORT std::string getImagePropertiesWithImgFileReader(const std::string &fileName, PagedImage &pImgProps, std::string &fileFormat)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode saveSubImgInFile(const SubImage &srcSubImg, const std::string &outFileName)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode loadWithHistoLoad(const std::string &fileName, SubImage &outSubImg, const ImageVector &corrOffset, Module **loaderToCreate, bool loadFullImage, PagedImage *pagedImg=nullptr, MLint level=0)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT void getDCMTreeFromMLImageFile(const std::string &mlImageFileName, DCMTree::Const_TreePtr &treePtr, size_t &numVols, MLErrorCode &fileLoadError, MLErrorCode &treeExtractError)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode loadWithImgFileLoader(const std::string &pageFileName, SubImage &outSubImg, const ImageVector &corrOffset, MLint dcmTiffExtZ, const bool isDCMTiff, bool loadFullImage=false)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode loadWithMLImageFormat(const std::string &pageFileName, SubImage &outSubImg, const ImageVector &corrOffset, MLImageFormat **loader, bool loadFullImage=false)
See corresponding function in ModuleLoaderBackends::CoreInterface.
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode checkOrCreateReusableModule(const std::string &dllName, const std::string &moduleName, const std::vector< std::string > &expectedFields, Module **module, Module **moduleToUse)
If module is non nullptr then it is checked for the name moduleName and whether it contains all field...
MLMODULE_LOADER_BACKENDS_EXPORT MLErrorCode loadWithMLItkImageFileReader(const std::string &pageFileName, SubImage &outSubImg, const ImageVector &corrOffset, MLDataType fileDataType, Module **loader, DCMTree::Const_TreePtr constTreePtr, bool dstIsRGB, std::string *metaDataDump=nullptr, bool loadFullImage=false, size_t itkLoadDim=3, bool hideErrorPosts=false, const SubImageBox &expectedImageExtent=SubImageBox())
See corresponding function in ModuleLoaderBackends::CoreInterface.