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
23ML_START_NAMESPACE
24
25// Forward of internally used classes.
26class MLImageFormat;
27class ProgressLogger;
28
29//----------------------------------------------------------------------------------
31//----------------------------------------------------------------------------------
34public:
41
44
71 virtual MLErrorCode loadWithMLImageFormat(const std::string &pageFileName,
72 SubImage &outSubImg,
73 const ImageVector &corrOffset,
74 MLImageFormat **loader,
75 bool loadFullImage=false) = 0;
76
93 const std::string &outFileName,
94 const std::string &mliCompress,
95 bool updateMinMaxAfterSave) = 0;
96
109 virtual void getDCMTreeFromMLImageFile(const std::string &mlImageFileName,
110 DCMTree::Const_TreePtr &treePtr,
111 size_t &numVols,
112 MLErrorCode &fileLoadError,
113 MLErrorCode &treeExtractError) = 0;
114
144 virtual MLErrorCode loadWithImgFileLoader(const std::string &pageFileName,
145 SubImage &outSubImg,
146 const ImageVector &corrOffset,
147 MLint dcmTiffExtZ,
148 const bool isDCMTiff,
149 bool loadFullImage=false) = 0;
150
162 virtual MLErrorCode saveSubImgInFile(const SubImage &srcSubImg,
163 const std::string &outFileName) = 0;
164
181 const std::string &outFile,
182 MLint ext,
183 bool useMiddleSlice=true,
184 bool buildNoPreviewImageOnInvalidImage=false) = 0;
185
253 virtual MLErrorCode loadWithMLItkImageFileReader(const std::string &pageFileName,
254 SubImage &outSubImg,
255 const ImageVector &corrOffset,
256 MLDataType fileDataType,
257 Module **loader,
258 DCMTree::Const_TreePtr constTreePtr,
259 bool dstIsRGB,
260 std::string *metaDataDump=nullptr,
261 bool loadFullImage=false,
262 size_t itkLoadDim=3,
263 bool hideErrorPosts=false,
264 const SubImageBox &expectedImageExtent=SubImageBox()) = 0;
265
304 virtual MLErrorCode loadWithHistoLoad(const std::string &fileName,
305 SubImage &outSubImg,
306 const ImageVector &corrOffset,
307 Module **loaderToCreate,
308 bool loadFullImage,
309 PagedImage *pagedImg=nullptr,
310 MLint level=0) = 0;
311
316
320 virtual std::string getImagePropertiesWithImgFileReader(const std::string &fileName,
321 PagedImage &pImgProps,
322 std::string &fileFormat) = 0;
323
326 virtual MLErrorCode getImagePropertiesWithMLImageFormatReader(const std::string &fileName,
327 PagedImage &pImgProps) = 0;
328
331};
332
333ML_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...
CoreModuleLoaderBackendInterface(const CoreModuleLoaderBackendInterface &)=default
Default copy constructor.
virtual ~CoreModuleLoaderBackendInterface()
Virtual destructor to make derived versions correctly deleted.
CoreModuleLoaderBackendInterface & operator=(const CoreModuleLoaderBackendInterface &)=default
Default assignment operator.
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 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 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.
CoreModuleLoaderBackendInterface()=default
Default constructor.
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.
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
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