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 
25 ML_START_NAMESPACE
26 
27 // Forward of internally used classes.
28 class MLImageFormat;
29 class ProgressLogger;
30 
34 public:
37 
39  static bool loadIfAllowed();
40 
42  static bool isLoaded();
43 
45  static void allow(bool allowUsage);
46 
49 };
50 
51 //----------------------------------------------------------------------------------
53 //----------------------------------------------------------------------------------
54 namespace ModuleLoaderBackends {
55 
57  enum {
59  };
60 
63  SubImage &outSubImg,
64  const ImageVector &corrOffset,
65  MLImageFormat **loader,
66  bool loadFullImage=false);
67 
70  const std::string &outFileName,
71  const std::string &mliCompress,
72  bool updateMinMaxAfterSave);
73 
75  MLMODULE_LOADER_BACKENDS_EXPORT void getDCMTreeFromMLImageFile(const std::string &mlImageFileName,
76  DCMTree::Const_TreePtr &treePtr,
77  size_t &numVols,
78  MLErrorCode &fileLoadError,
79  MLErrorCode &treeExtractError);
80 
83  SubImage &outSubImg,
84  const ImageVector &corrOffset,
85  MLint dcmTiffExtZ,
86  const bool isDCMTiff,
87  bool loadFullImage=false);
88 
91  const std::string &outFileName);
92 
95  const std::string &outFile,
96  MLint ext,
97  bool useMiddleSlice=true,
98  bool buildNoPreviewImageOnInvalidImage=false);
99 
102  SubImage &outSubImg,
103  const ImageVector &corrOffset,
104  MLDataType fileDataType,
105  Module **loader,
106  DCMTree::Const_TreePtr constTreePtr,
107  bool dstIsRGB,
108  std::string *metaDataDump=nullptr,
109  bool loadFullImage=false,
110  size_t itkLoadDim=3,
111  bool hideErrorPosts=false,
112  const SubImageBox &expectedImageExtent=SubImageBox());
113 
116  const std::string &moduleName,
117  const std::vector<std::string> &expectedFields,
118  Module **module,
119  Module **moduleToUse);
120 
122  MLMODULE_LOADER_BACKENDS_EXPORT std::string getPreferredLoader(const std::string &fileName);
123 
126  SubImage &outSubImg,
127  const ImageVector &corrOffset,
128  Module **loaderToCreate,
129  bool loadFullImage,
130  PagedImage *pagedImg=nullptr,
131  MLint level=0);
132 
135 
138  PagedImage &pImgProps,
139  std::string &fileFormat);
140 
143  PagedImage &pImgProps);
144 
145 };
146 
147 ML_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.
Definition: mlImageFormat.h:36
Small class only used for script wrapper and to observe global ModuleLoaderBackends a bit,...
static bool isLoaded()
Global function to check whether a backend is loaded.
static void allow(bool allowUsage)
Globally disables/enables whether a 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 bool loadIfAllowed()
Global function to load a backend if not disallowed, returns true if successful or already loaded,...
Base class for an image processing module of the ML.
Definition: mlModule.h:156
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 MLDataType
MLDataType.
Definition: mlTypeDefs.h:684
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
MLCSO_EXPORT void level(CSO *cso)
Determines the normal and the center of gravity of the given CSO.
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)
See corresponding function in ModuleLoaderBackends::CoreInterface.
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)
See corresponding function in ModuleLoaderBackends::CoreInterface.
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.
TSubImageBox< MLint > SubImageBox
Define the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type.