Creates a dataset from a text file or another dataset. More...
#include <DatasetWriter.hpp>
Public Member Functions | |
string | getInput () const |
string | getOutput () const |
int | getJump () const |
void | setInput (const string &filename) |
void | setOutput (const string &filename) |
void | setJump (int) |
void | write () |
Protected Member Functions | |
void | writeHeader (ostream &file) |
void | writeAsUnsignedShort (ofstream &file) |
Private Attributes | |
Dataset * | dataset |
DatasetHeader * | header |
string | input |
string | output |
int | jump |
Static Private Attributes | |
static float | USHRT_SCALE = ((float)1)/USHRT_MAX*UCHAR_MAX |
Creates a dataset from a text file or another dataset.
The text file should follow the basic form of a VLB file, except the data is human readable. In fact, the header is exactly the same, and DatasetHeader is even used to process it. The data meanwhile is read in one slice at a time from front to back. Each slice starts with the bottom left row and then proceeds upwards through the rows. Each value should be separated by spaces, and line breaks do not matter within the data section, so feel free to format the data as you wish. Data is written out as unsigned bytes with no spaces.