IOFormat 1.12.0
Loading...
Searching...
No Matches
ioformat::StackReader Class Reference

#include <ioformat/StackReader.h>

Public Member Functions

 StackReader ()=delete
 

Static Public Member Functions

static std::shared_ptr< iolink::ImageView > openImageFromPattern (const std::string &pattern, iolink::ImageDimension newDim)
 
static std::shared_ptr< iolink::ImageView > openImageFromPattern (const std::string &pattern)
 
static std::shared_ptr< iolink::ImageView > readImageFromPattern (const std::string &pattern, iolink::ImageDimension newDim)
 
static std::shared_ptr< iolink::ImageView > readImageFromPattern (const std::string &pattern)
 
static std::shared_ptr< iolink::ImageView > openImageFromListFile (const std::string &filePath, iolink::ImageDimension newDim)
 
static std::shared_ptr< iolink::ImageView > openImageFromListFile (const std::string &filePath)
 
static std::shared_ptr< iolink::ImageView > readImageFromListFile (const std::string &filePath, iolink::ImageDimension newDim)
 
static std::shared_ptr< iolink::ImageView > readImageFromListFile (const std::string &filePath)
 
static std::shared_ptr< iolink::ImageView > openImageFromUriList (const std::string *listUri, size_t count, iolink::ImageDimension newDim, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > openImageFromUriList (const std::string *listUri, size_t count, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > openImageFromUriPattern (const std::string &pattern, iolink::ImageDimension newDim, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > openImageFromUriPattern (const std::string &pattern, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > readImageFromUriList (const std::string *listUri, size_t count, iolink::ImageDimension newDim, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > readImageFromUriList (const std::string *listUri, size_t count, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > readImageFromUriPattern (const std::string &pattern, iolink::ImageDimension newDim, const GeneralOptions &options={})
 
static std::shared_ptr< iolink::ImageView > readImageFromUriPattern (const std::string &pattern, const GeneralOptions &options={})
 

Detailed Description

A factory to read stacks of images.

Constructor & Destructor Documentation

◆ StackReader()

ioformat::StackReader::StackReader ( )
delete

Remove constructor, as this class is a static factory.

Member Function Documentation

◆ openImageFromListFile() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromListFile ( const std::string &  filePath)
static

Stack multiple files as described in a list file.

A list file is a file, usually with the "lst" extension, where each line is a path to a file, absolute, or relative to the list file.

Example of a list file:

some/path/to/a/file.ext
some/other/path/to/a/file.ext
...
Parameters
filePathThe path to the list file.
Exceptions
Errorif a file from the list is not found
Errorif stacking failed
Returns
An ImageView built by stacking all the images in the list file.
See also
IOFormat::stack

◆ openImageFromListFile() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromListFile ( const std::string &  filePath,
iolink::ImageDimension  newDim 
)
static

Stack multiple files as described in a list file.

A list file is a file, usually with the "lst" extension, where each line is a path to a file, absolute, or relative to the list file.

Example of a list file:

some/path/to/a/file.ext
some/other/path/to/a/file.ext
...
Parameters
filePathThe path to the list file.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif a file from the list is not found
Errorif stacking failed
Returns
An ImageView built by stacking all the images in the list file.
See also
IOFormat::stack

◆ openImageFromPattern() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromPattern ( const std::string &  pattern)
static

Open multiple files to stack them.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

Example:

/some/dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

As there is no dimension specified in this version, the ImageType of the output image will be ImageTYpeId::UNKNOWN

Parameters
patternThe pattern to use to open files.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, and stacked.
See also
IOFormat::stack

◆ openImageFromPattern() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromPattern ( const std::string &  pattern,
iolink::ImageDimension  newDim 
)
static

Open multiple files to stack them.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

Example:

/some/dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to open files.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, and stacked.
See also
IOFormat::stack

◆ openImageFromUriList() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromUriList ( const std::string *  listUri,
size_t  count,
const GeneralOptions options = {} 
)
static

Open multiple URI from a list to stack them.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

Parameters
listUriA pointer to an array of URIs, each URI being a path to a file.
countThe number of URIs in the list.
Exceptions
InvalidArgumentif the list is empty or null
InvalidArgumentif a URI cannot be parsed correctly
InvalidArgumentif a URI does not have an extension
Errorif a URI cannot be opened
Errorif stacking failed
Returns
An ImageView containing the images loaded using the given list, and stacked.
See also
IOFormat::stack

◆ openImageFromUriList() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromUriList ( const std::string *  listUri,
size_t  count,
iolink::ImageDimension  newDim,
const GeneralOptions options = {} 
)
static

Open multiple URI from a list to stack them.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

Parameters
listUriA pointer to an array of URIs, each URI being a path to a file.
countThe number of URIs in the list.
newDimThe interpretation of the stacking dimension.
Exceptions
InvalidArgumentif the list is empty or null
InvalidArgumentif a URI cannot be parsed correctly
InvalidArgumentif a URI does not have an extension
Errorif a URI cannot be opened
Errorif stacking failed
Returns
An ImageView containing the images loaded using the given list, and stacked following given new dimension.
See also
IOFormat::stack

◆ openImageFromUriPattern() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromUriPattern ( const std::string &  pattern,
const GeneralOptions options = {} 
)
static

Open multiple URI to stack them.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

Example:

scheme:///.../dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to select Uris.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, and stacked.
See also
IOFormat::stack

◆ openImageFromUriPattern() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::openImageFromUriPattern ( const std::string &  pattern,
iolink::ImageDimension  newDim,
const GeneralOptions options = {} 
)
static

Open multiple URI to stack them.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

Example:

scheme:///.../dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to select Uris.
newDimThe interpretation of the stacking dimension.
Exceptions
InvalidArgumentif a URI matching with pattern cannot be parsed correctly
InvalidArgumentif a URI matching with pattern does not have aan extension
Errorif a URI cannot be opened as an image
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, and stacked following given new dimension.
See also
IOFormat::stack

◆ readImageFromListFile() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromListFile ( const std::string &  filePath)
static

Stack multiple files as described in a list file and load the result in memory.

A list file is a file, usually with the "lst" extension, where each line is a path to a file, absolute, or relative to the list file.

Example of a list file:

some/path/to/a/file.ext
some/other/path/to/a/file.ext
...
Parameters
filePathThe path to the list file.
Exceptions
Errorif a file from the list is not found
Errorif stacking failed
Returns
An ImageView built by stacking all the images in the list file and loading it in memory.
See also
IOFormat::stack

◆ readImageFromListFile() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromListFile ( const std::string &  filePath,
iolink::ImageDimension  newDim 
)
static

Stack multiple files as described in a list file and load the result in memory.

A list file is a file, usually with the "lst" extension, where each line is a path to a file, absolute, or relative to the list file.

Example of a list file:

some/path/to/a/file.ext
some/other/path/to/a/file.ext
...
Parameters
filePathThe path to the list file.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif a file from the list is not found
Errorif stacking failed
Returns
An ImageView built by stacking all the images in the list file and loading it in memory.
See also
IOFormat::stack

◆ readImageFromPattern() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromPattern ( const std::string &  pattern)
static

Stack multiple files following a pattern and load the stacked ImageView in memory.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

The stack will be loaded in memory after construction.

Example:

/some/dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

As there is no dimension specified in this version, the ImageType of the output image will be ImageTYpeId::UNKNOWN

Parameters
patternThe pattern to use to open files.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images opened using the pattern, stacked, and loaded in memory.
See also
IOFormat::stack

◆ readImageFromPattern() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromPattern ( const std::string &  pattern,
iolink::ImageDimension  newDim 
)
static

Stack multiple files following a pattern and load the stacked ImageView in memory.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

The stack will be loaded in memory after construction.

Example:

/some/dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to open files.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images opened using the pattern, stacked, and loaded in memory.
See also
IOFormat::stack

◆ readImageFromUriList() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromUriList ( const std::string *  listUri,
size_t  count,
const GeneralOptions options = {} 
)
static

Stack multiple Uris from a list and load the stacked ImageView in memory.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

The stack will be loaded in memory after construction.

Parameters
listUriA pointer to an array of URIs, each URI being a path to a file.
countThe number of URIs in the list.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the given list, stacked and loaded in memory.
See also
IOFormat::stack

◆ readImageFromUriList() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromUriList ( const std::string *  listUri,
size_t  count,
iolink::ImageDimension  newDim,
const GeneralOptions options = {} 
)
static

Stack multiple Uris from a list and load the stacked ImageView in memory.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

The stack will be loaded in memory after construction.

Parameters
listUriA pointer to an array of URIs, each URI being a path to a file.
countThe number of URIs in the list.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the given list, stacked following given new dimension, and loaded in memory.
See also
IOFormat::stack

◆ readImageFromUriPattern() [1/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromUriPattern ( const std::string &  pattern,
const GeneralOptions options = {} 
)
static

Stack multiple Uris following a pattern and load the stacked ImageView in memory.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

The stack will be loaded in memory after construction.

Example:

scheme:///.../dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to select Uris.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, stacked and loaded in memory.
See also
IOFormat::stack

◆ readImageFromUriPattern() [2/2]

static std::shared_ptr< iolink::ImageView > ioformat::StackReader::readImageFromUriPattern ( const std::string &  pattern,
iolink::ImageDimension  newDim,
const GeneralOptions options = {} 
)
static

Stack multiple Uris following a pattern and load the stacked ImageView in memory.

The pattern must be written using the character "*" as a wildcard for any number of characters. The wildcard must only be present on the last segment of the path, the filename part.

To be stacked, each URI must point to a image that can be read by the IOFormat, and whose shape and datatype are compatible.

The stack will be loaded in memory after construction.

Example:

scheme:///.../dir/img_*.png will load all files following this pattern, ands stack them, using lexicographic order.

Parameters
patternThe pattern to use to select Uris.
newDimThe interpretation of the stacking dimension.
Exceptions
Errorif stacking failed
Returns
An ImageView containing the images loaded using the pattern, stacked following given new dimension, and loaded in memory.
See also
IOFormat::stack

The documentation for this class was generated from the following file: