iRoCS Toolbox  1.1.0
BlitzAnalyzeFile.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2010 Robert Bensch
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  * -----------------------------
22  * - Copyright Acknowledgement -
23  * -----------------------------
24  *
25  * The Analyze header type definitions in "BlitzAnalyzeType.hh" and
26  * the method "saveArrayWithElemSize" in "BlitzAnalyzeFile.icc"
27  * are mainly based on the Analyze 7.5 File Format document
28  * http://www.mayo.edu/bir/PDF/ANALYZE75.pdf
29  * (.../libBlitzAnalyze/docs/ANALYZE75.pdf)
30  *
31  * It contains the following copyright notice regarding the
32  * header file format:
33  *
34  * ANALYZE TM Header File Format
35  * (c) Copyright, 1986-1995
36  * Biomedical Imaging Resource
37  * Mayo Foundation
38  *
39  **************************************************************************/
40 
41 #ifndef BLITZANALYZEFILE_HH
42 #define BLITZANALYZEFILE_HH
43 
44 #ifdef HAVE_CONFIG_H
45 #include <config.hh>
46 #endif
47 
48 #include <string>
49 #include <fstream>
50 #include <blitz/array.h>
51 
52 #include "BlitzAnalyzeType.hh" // lib's type definitions for Analyze header
53 #include "BlitzAnalyzeError.hh" // lib's own error class
54 #include "BlitzAnalyzeTraits.hh" // lib's type traits
55 
56  /*======================================================================*/
67  /*======================================================================*/
68 
70 
71 public:
72 
73  /*======================================================================*/
79  /*======================================================================*/
80  BlitzAnalyzeFile(const std::string& fName);
81 
82  /*-----------------------------------------------------------------------
83  * Destructor
84  *-----------------------------------------------------------------------*/
86 
87  /*-----------------------------------------------------------------------
88  * data methods
89  *-----------------------------------------------------------------------*/
90 
91  /*======================================================================*/
103  /*======================================================================*/
104  template<typename T>
106  const blitz::Array<T, 3>& inArray,
107  const blitz::TinyVector<float, 3>& element_size_um);
108 
109 private:
110 
111  /*-------------------------------------------------------------------------
112  * private vars
113  *-------------------------------------------------------------------------*/
114 
115  const std::string _fName;
116  std::string _datatype;
117  bool _saveArrayWithElemSize_called;
118 
119 };
120 
121 #include "BlitzAnalyzeFile.icc"
122 
123 #endif
void saveArrayWithElemSize(const blitz::Array< T, 3 > &inArray, const blitz::TinyVector< float, 3 > &element_size_um)
Writes a three dimensional data set.
BlitzAnalyzeFile(const std::string &fName)
Creates an AnalyzeFile, opening the given file.
The BlitzAnalyzeFile class provides a function for saving of voxel blocks to the Analyze file format...