| 1 |
//+********************************************************************** |
| 2 |
// |
| 3 |
// File: edf_reader.h |
| 4 |
// |
| 5 |
// Project: Fable data to NeXus translation |
| 6 |
// |
| 7 |
// Description: definition of a edf_reader class. It is a library, |
| 8 |
// which makes possible reading data from EDF format. |
| 9 |
// EDF file is read using the constructor of the class. |
| 10 |
// Every key-values pairs from the header are stored |
| 11 |
// in the one of two dictionaries(private members). |
| 12 |
// Image is read into the memory allocated dynamically, |
| 13 |
// and a pointer on that memory is a class's private |
| 14 |
// member. |
| 15 |
// |
| 16 |
// Author(s): Jaroslaw Butanowicz |
| 17 |
// |
| 18 |
// Original: April 2006 |
| 19 |
// |
| 20 |
//+********************************************************************** |
| 21 |
|
| 22 |
#ifndef EDF_READER_H |
| 23 |
#define EDF_READER_H |
| 24 |
|
| 25 |
#include <iostream> |
| 26 |
#include <fstream> |
| 27 |
#include <map> |
| 28 |
#include <string> |
| 29 |
#include <cstring> |
| 30 |
#include <cstdlib> |
| 31 |
|
| 32 |
using namespace std; |
| 33 |
|
| 34 |
|
| 35 |
class edf_reader |
| 36 |
{ |
| 37 |
private: |
| 38 |
|
| 39 |
int header_numbers[3]; |
| 40 |
map<string, double>key_double; |
| 41 |
map<string, string>key_string; |
| 42 |
int image_size; |
| 43 |
char *image; |
| 44 |
|
| 45 |
public: |
| 46 |
|
| 47 |
~edf_reader(); |
| 48 |
edf_reader(); |
| 49 |
edf_reader(ifstream &in); |
| 50 |
int get_current_headerID(); |
| 51 |
int get_previous_headerID(); |
| 52 |
int get_next_headerID(); |
| 53 |
int size_map_double(); |
| 54 |
int size_map_string(); |
| 55 |
char* get_image(); |
| 56 |
int get_image_size(); |
| 57 |
string get_key_double(int key_number, double &value); |
| 58 |
string get_key_string(int key_number, string &value); |
| 59 |
bool double_by_key(string key, double &value); |
| 60 |
bool string_by_key(string key, string &value); |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
#endif |
| 66 |
|