26 #ifndef MLN_IO_FITS_LOAD_HH
27 # define MLN_IO_FITS_LOAD_HH
38 # include <mln/core/image/image2d.hh>
39 # include <mln/value/int_u8.hh>
60 void load(image2d<float>& ima,
61 const std::string& filename);
69 image2d<float>
load(
const std::string& filename);
71 # ifndef MLN_INCLUDE_ONLY
74 void fits_exit(
int status)
78 fits_report_error(stderr, status);
87 trace::entering(
"mln::io::fits::load");
90 int status, nfound, anynull;
95 if (fits_open_file(&fptr, filename.c_str(), READONLY, &status))
98 char NAXIS[] =
"NAXIS";
99 if (fits_read_keys_lng(fptr, NAXIS, 1, 2, naxes, &nfound, &status))
102 const int ncols = naxes[0], nrows = naxes[1];
110 for (p.row() = 0; p.row() < nrows; ++p.row())
112 if (fits_read_img(fptr,
123 if (fits_close_file(fptr, &status))
126 trace::exiting(
"mln::io::fits::load");
133 const std::string& filename)
135 ima =
load(filename);
138 # endif // ! MLN_INCLUDE_ONLY
147 #endif // ! MLN_IO_FITS_LOAD_HH