Subversion Repositories gelsvn

Rev

Rev 191 | Rev 382 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
61 jab 1
#include <fstream>
2
#include "Geometry/load_raw.h"
3
 
4
using namespace CGLA;
5
using namespace std;
6
 
7
namespace Geometry
8
{
9
 
10
	template<class T>
11
	bool load_raw(const string& file, RGrid<T>& grid)
12
	{
13
			int sz = grid.get_size();
14
			ifstream f(file.c_str(),ios::binary);
15
			if(f)
16
			{
17
					f.read(reinterpret_cast<char*>(grid.get()),sz*sizeof(T));
18
					return true;
19
			}
20
			cout << "Could not open volume" << endl;
21
			return false;
22
	}
23
 
24
		template bool load_raw(const string&, RGrid<unsigned char>& grid);
191 jab 25
		template bool load_raw(const string&, RGrid<unsigned short>& grid);
214 jab 26
		template bool load_raw(const string&, RGrid<short>& grid);
191 jab 27
		template bool load_raw(const string&, RGrid<float>& grid);
61 jab 28
 
29
}