Newer
Older
#include "file_system.h"
// #if DEBUG
// printf("***DEBUG MODE***\n");
// if (argc == 1)
// {
// argv[1] = (char *)"/home/mor0146/gitlab/data_project/czi-format/data/MultiResolution-Mosaic.czi";
// argv[2] = (char *)"--dump-image-data";
// argv[3] = (char *)"imgdump/";
// }
// argc = 4;
// cziFile = argv[1];
// #else
// #endif
cziFile = (argc > 1) ? argv[1] : "/home/mor0146/gitlab/data_project/czi-format/data/CZT-Stack-Anno.czi"; //"/home/mor0146/gitlab/data_project/czi-format/data/m2/exampleSingleChannel.czi";
always_assert(is_file(cziFile));
std::string method = argc > 2 ? argv[2] : "";
std::string dumpName = argc > 3 ? argv[3] : "";
bool report = method == "--report";
bool reportAll = method == "--report-verbose";
bool dumpRawImageData = method == "--dump-raw-image-data";
bool dumpImageData = method == "--dump-image-data";
auto name = get_filename_without_extension(cziFile);
auto x = get_files_in_parent_directory(cziFile, true);
auto y = get_files_with_same_prefix(x, name);
CziParser parser;
auto parseResult = parser.parse_czi_file(cziFile);
if (reportAll)
parseResult.report_verbose();
else if (report)
parseResult.report();
parseResult.dump_image_data(dumpName);
{
auto imgMat = parseResult.get_image(0);
imgMat.save_as_ppm("matrix");
//TODO: Re-Enable it.
//parseResult.extract_images(dumpName);
}
printf("Finished.\n");