SOPT
Sparse OPTimisation
tiffwrappers.cc
Go to the documentation of this file.
1 #include <fstream>
2 
3 #include "tools_for_tests/directories.h"
5 #include "sopt/types.h"
6 #include "sopt/utilities.h"
7 
8 namespace sopt::tools {
9 Image<> read_standard_tiff(std::string const &name) {
10  std::string const stdname = sopt::tools::data_directory() + "/" + name + ".tiff";
11  bool const is_std = std::ifstream(stdname).good();
12  return sopt::utilities::read_tiff(is_std ? stdname : name);
13 }
14 } // namespace sopt::tools
Image read_standard_tiff(std::string const &name)
Reads tiff image from sopt data directory if it exists.
Definition: tiffwrappers.cc:9
std::string data_directory()
Holds images and such.
Definition: directories.in.h:9
Image read_tiff(std::string const &filename)
Reads tiff image.
Definition: utilities.cc:38
Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic > Image
A 2-dimensional list of elements of given type.
Definition: types.h:39