fast::ImageFileStreamer class

Stream a sequence of image files from disk.

Images has to be stored with an index before the file extension. E.g. some_name_0.mhd, some_name_1.mhd, some_name_2.mhd ... or some_name_0.png, some_name_1.png, some_name_2.png ...

This streamer uses the ImageFileImporter to read the images from disk.

Output ports

Base classes

class FileStreamer
Abstract file streamer class.

Constructors, destructors, conversion operators

ImageFileStreamer() protected

Public functions

auto create(std::string filenameFormat, bool loop, bool useTimestamps, int framerate, bool grayscale) -> std::shared_ptr<ImageFileStreamer>
Create a ImageFileStreamer instance.
auto create(std::vector<std::string> filenameFormats, bool loop, bool useTimestamps, int framerate, bool grayscale) -> std::shared_ptr<ImageFileStreamer>
Create a ImageFileStreamer instance.
void loadAttributes() override

Protected functions

auto getDataFrame(std::string filename) -> DataObject::pointer override

Protected variables

bool m_grayscale

Function documentation

std::shared_ptr<ImageFileStreamer> fast::ImageFileStreamer::create(std::string filenameFormat, bool loop, bool useTimestamps, int framerate, bool grayscale)

Create a ImageFileStreamer instance.

Parameters
filenameFormat String of path and format of images. E.g. /path/to/files/frame_#.mhd. The hash sign # will be replaced by an index
loop Whether to loop the recording or not
useTimestamps Whether to use timestamps in image files (if available) when streaming, or just stream as fast as possible
framerate If framerate is > 0, this framerate will be used for streaming the images
grayscale Convert images to grayscale if the source image is in color.
Returns instance

std::shared_ptr<ImageFileStreamer> fast::ImageFileStreamer::create(std::vector<std::string> filenameFormats, bool loop, bool useTimestamps, int framerate, bool grayscale)

Create a ImageFileStreamer instance.

Parameters
filenameFormats List of strings of paths and format of images. E.g. /path/to/files/frame_#.mhd. The hash sign # will be replaced by an index
loop Whether to loop the recording or not
useTimestamps Whether to use timestamps in image files (if available) when streaming, or just stream as fast as possible
framerate If framerate is > 0, this framerate will be used for streaming the images
grayscale Convert or not
Returns instance

This is only available in C++ for now.

Convert images to grayscale if the source image is in color