MeVisLab Toolbox Reference
mlModuleLoaderBackendsInterface.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 
13 // Local includes
15 
16 // DICOM tree prototypes
17 #include <DCMTree_Lib.h>
18 
19 // ML includes
20 #include <mlModuleIncludes.h>
21 #include <mlAPI.h>
22 
23 ML_START_NAMESPACE
24 
25 // Forward of internally used classes.
26 class MLImageFormat;
27 class ProgressLogger;
28 
29 //----------------------------------------------------------------------------------
31 //----------------------------------------------------------------------------------
34 public:
35 
38 
65  virtual MLErrorCode loadWithMLImageFormat(const std::string &pageFileName,
66  SubImage &outSubImg,
67  const ImageVector &corrOffset,
68  MLImageFormat **loader,
69  bool loadFullImage=false) = 0;
70 
87  const std::string &outFileName,
88  const std::string &mliCompress,
89  bool updateMinMaxAfterSave) = 0;
90 
103  virtual void getDCMTreeFromMLImageFile(const std::string &mlImageFileName,
104  DCMTree::Const_TreePtr &treePtr,
105  size_t &numVols,
106  MLErrorCode &fileLoadError,
107  MLErrorCode &treeExtractError) = 0;
108 
138  virtual MLErrorCode loadWithImgFileLoader(const std::string &pageFileName,
139  SubImage &outSubImg,
140  const ImageVector &corrOffset,
141  MLint dcmTiffExtZ,
142  const bool isDCMTiff,
143  bool loadFullImage=false) = 0;
144 
156  virtual MLErrorCode saveSubImgInFile(const SubImage &srcSubImg,
157  const std::string &outFileName) = 0;
158 
175  const std::string &outFile,
176  MLint ext,
177  bool useMiddleSlice=true,
178  bool buildNoPreviewImageOnInvalidImage=false) = 0;
179 
247  virtual MLErrorCode loadWithMLItkImageFileReader(const std::string &pageFileName,
248  SubImage &outSubImg,
249  const ImageVector &corrOffset,
250  MLDataType fileDataType,
251  Module **loader,
252  DCMTree::Const_TreePtr constTreePtr,
253  bool dstIsRGB,
254  std::string *metaDataDump=nullptr,
255  bool loadFullImage=false,
256  size_t itkLoadDim=3,
257  bool hideErrorPosts=false,
258  const SubImageBox &expectedImageExtent=SubImageBox()) = 0;
259 
282  virtual MLErrorCode checkOrCreateReusableModule(const std::string &dllName,
283  const std::string &moduleName,
284  const std::vector<std::string> &expectedFields,
285  Module **module,
286  Module **moduleToUse) = 0;
287 
291  virtual std::string getPreferredLoader(const std::string &fileName) = 0;
292 
331  virtual MLErrorCode loadWithHistoLoad(const std::string &fileName,
332  SubImage &outSubImg,
333  const ImageVector &corrOffset,
334  Module **loaderToCreate,
335  bool loadFullImage,
336  PagedImage *pagedImg=nullptr,
337  MLint level=0) = 0;
338 
343 
347  virtual std::string getImagePropertiesWithImgFileReader(const std::string &fileName,
348  PagedImage &pImgProps,
349  std::string &fileFormat) = 0;
350 
353  virtual MLErrorCode getImagePropertiesWithMLImageFormatReader(const std::string &fileName,
354  PagedImage &pImgProps) = 0;
355 
358 };
359 
360 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLMODULE_LOADER_BACKENDS_EXPORT
DLL export macro definition.
A collection of some tool functions loading files with modules or other backends.
ML_ABSTRACT_ROOT_CLASS_HEADER(CoreModuleLoaderBackendInterface)
Registration in the ML runtime type system, ML_ABSTRACT_ROOT_CLASS_SOURCE is in ModuleLoadersBackends...
virtual ~CoreModuleLoaderBackendInterface()
Virtual destructor to make derived versions correctly deleted.
virtual void destroyMLImageFormatFileReaderInstance(MLImageFormat *&instance)=0
No-operation call if instance is nullptr, otherwise the MLImageFormat instance will be deleted and re...
virtual void getDCMTreeFromMLImageFile(const std::string &mlImageFileName, DCMTree::Const_TreePtr &treePtr, size_t &numVols, MLErrorCode &fileLoadError, MLErrorCode &treeExtractError)=0
Loads a Const_TreePtr from a valid .mlimage file given by the absolute file path fileName if possible...
virtual MLErrorCode loadWithImgFileLoader(const std::string &pageFileName, SubImage &outSubImg, const ImageVector &corrOffset, MLint dcmTiffExtZ, const bool isDCMTiff, bool loadFullImage=false)=0
Reads overlapping regions of the file pageFileName into outSubImg with the MFL interface.
virtual std::string getPreferredLoader(const std::string &fileName)=0
If it is possible to derive a preferred loader from the given fileName then the name of the loader is...
virtual MLErrorCode saveSubImgInFile(const SubImage &srcSubImg, const std::string &outFileName)=0
Write first 2D slice from srcSubImg in the file with name outFileName.
virtual MLErrorCode createAndSaveThumbNail(PagedImage &srcImg, const std::string &outFile, MLint ext, bool useMiddleSlice=true, bool buildNoPreviewImageOnInvalidImage=false)=0
Create a thumbnail with extent of extX * extY pixels from the ML image given with srcImg and writes i...
virtual 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())=0
Reads overlapping regions of the file pageFileName into outSubImg with the ML itkImageFileReader.
virtual MLErrorCode loadWithMLImageFormat(const std::string &pageFileName, SubImage &outSubImg, const ImageVector &corrOffset, MLImageFormat **loader, bool loadFullImage=false)=0
Reads overlapping regions of the file pageFileName into outSubImg with the MLImageFileFormat.
virtual MLErrorCode saveAsMLImageFormat(PagedImage &imgToSave, const std::string &outFileName, const std::string &mliCompress, bool updateMinMaxAfterSave)=0
Save the ML PagedImage given by the output of the ddiOutput as .mlimage file with the compression giv...
virtual std::string getImagePropertiesWithImgFileReader(const std::string &fileName, PagedImage &pImgProps, std::string &fileFormat)=0
If possible then retrieve pImgProps from file fileName by using ImgFileReader::open_ImageFile and Img...
virtual MLErrorCode checkOrCreateReusableModule(const std::string &dllName, const std::string &moduleName, const std::vector< std::string > &expectedFields, Module **module, Module **moduleToUse)=0
If module is non nullptr then it is checked for the name moduleName and whether it contains all field...
virtual MLErrorCode loadWithHistoLoad(const std::string &fileName, SubImage &outSubImg, const ImageVector &corrOffset, Module **loaderToCreate, bool loadFullImage, PagedImage *pagedImg=nullptr, MLint level=0)=0
Reads overlapping regions of the file pageFileName into outSubImg with the ML itkImageFileReader.
virtual MLErrorCode getImagePropertiesWithMLImageFormatReader(const std::string &fileName, PagedImage &pImgProps)=0
If possible then retrieve pImgProps from file fileName by using an MLImageFormat and ML_RESULT_OK is ...
File format class to store, load, and modify a PagedImage in a file.
Definition: mlImageFormat.h:36
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.
TSubImageBox< MLint > SubImageBox
Define the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type.