![]() |
ImFusion SDK 4.3
|
Support for loading and saving MetaImage files. More...
Support for loading and saving MetaImage files.
MetaImage files are either split into header (.mhd) and data (.raw) files, or stored in a single (.mha) file containing the combined header information and image data.
Classes | |
| class | MetaImageHeader |
| struct | SaveOptions |
| Most properties of a MetaImage header can be deduced from a SharedImageSet, the ones in SaveOptions can not. More... | |
Functions | |
| bool | save (const std::string &headerFileName, const SharedImageSet &img, SaveOptions opts={}) |
| Save a SharedImageSet in MetaImage format. | |
| std::unique_ptr< SharedImageSet > | load (const std::string &headerFileName, MetaImageHeader *outHeader=nullptr, bool prepare=false, bool strictSyntax=false, bool ignoreHalfPixelOffset=false, SharedImageSet *outContainer=nullptr, bool *outSuccess=nullptr, Progress *prog=nullptr) |
| Load a MetaImage file into a SharedImageSet. | |
| bool | save (const std::string &headerFileName, const SharedImage &img, SaveOptions opts={}) |
| Convenience functions: | |
| bool | save (const std::string &headerFileName, const MemImage &img, SaveOptions opts={}) |
| std::shared_ptr< SharedImage > | loadSharedImage (const std::string &headerFileName, MetaImageHeader *outHeader=nullptr, bool prepare=false, bool strictSyntax=false, bool ignoreHalfPixelOffset=false, bool *outSuccess=nullptr) |
Variables | |
| const int | currentImFusionMetaImageVersion = 1 |
| Version of this loader. | |
| bool save | ( | const std::string & | headerFileName, |
| const SharedImageSet & | img, | ||
| SaveOptions | opts = {} ) |
Save a SharedImageSet in MetaImage format.
| headerFileName | Filename extension determines whether to use .mha or .mhd format, if no extension is given .mhd extension appended. |
| img | image(s) to save. |
| std::unique_ptr< SharedImageSet > load | ( | const std::string & | headerFileName, |
| MetaImageHeader * | outHeader = nullptr, | ||
| bool | prepare = false, | ||
| bool | strictSyntax = false, | ||
| bool | ignoreHalfPixelOffset = false, | ||
| SharedImageSet * | outContainer = nullptr, | ||
| bool * | outSuccess = nullptr, | ||
| Progress * | prog = nullptr ) |
Load a MetaImage file into a SharedImageSet.
| headerFileName | The absolute path of the MetaImage header file. |
| header | Store the read MetaImageHeader in *outHeader if not nullptr. |
| prepare | If (prepare || m_msb), call MemImage::prepare on the result, |
| outContainer | An optional SharedImageSet into which to load the data. In this case (if outSuccess != nullptr), *outSuccess = true on success and nullptr is returned. |
| strictSyntax | determines whether or not to fail when unexpected data is encountered (such as trailing non-whitespace characters after numbers). |
| ignoreHalfPixelOffset | should be set if no half-pixel offset to the Position/Orientation provided should be applied. Returns nullptr on failure. |
| std::shared_ptr< SharedImage > loadSharedImage | ( | const std::string & | headerFileName, |
| MetaImageHeader * | outHeader = nullptr, | ||
| bool | prepare = false, | ||
| bool | strictSyntax = false, | ||
| bool | ignoreHalfPixelOffset = false, | ||
| bool * | outSuccess = nullptr ) |
| outSuccess | If more than one image is present in the dataset, outSuccess is set to false and first image returned. |