EMAN2
vtkio.h
Go to the documentation of this file.
1/*
2 * Author: Steven Ludtke, 04/10/2003 (sludtke@bcm.edu)
3 * Copyright (c) 2000-2006 Baylor College of Medicine
4 *
5 * This software is issued under a joint BSD/GNU license. You may use the
6 * source code in this file under either license. However, note that the
7 * complete EMAN2 and SPARX software packages have some GPL dependencies,
8 * so you are responsible for compliance with the licenses of these packages
9 * if you opt to use BSD licensing. The warranty disclaimer below holds
10 * in either instance.
11 *
12 * This complete copyright notice must be included in any revised version of the
13 * source code. Additional authorship citations may be added, but existing
14 * author citations must be preserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *
30 * */
31
32#ifndef eman__vtkio_h__
33#define eman__vtkio_h__ 1
34
35#include "imageio.h"
36
37namespace EMAN
38{
39
72 class VtkIO : public ImageIO
73 {
74 public:
75 explicit VtkIO(const string & fname, IOMode rw_mode = READ_ONLY);
76 ~VtkIO();
77
79 static bool is_valid(const void *first_block);
80
81 private:
82 static const char *MAGIC;
83
85 {
89 };
90
92 {
104 DOUBLE
105 };
106
108 {
115 };
116
117 int to_em_datatype(int vtk_datatype);
118 int get_mode_size(DataType d);
119
120 void read_dataset(DatasetType dstype);
121 DataType get_datatype_from_name(const string& datatype_name);
122 DatasetType get_datasettype_from_name(const string& dataset_name);
123
126
129 int nx;
130 int ny;
131 int nz;
132 float originx;
133 float originy;
134 float originz;
135 float spacingx;
136 float spacingy;
137 float spacingz;
139
140 };
141
142}
143
144#endif //eman__vtkio_h__
ImageIO classes are designed for reading/writing various electron micrography image formats,...
Definition: imageio.h:127
IOMode rw_mode
Definition: imageio.h:353
VtkIO reads/writes VTK image file.
Definition: vtkio.h:73
off_t file_offset
Definition: vtkio.h:138
float originx
Definition: vtkio.h:132
@ VTK_UNKNOWN
Definition: vtkio.h:86
@ VTK_BINARY
Definition: vtkio.h:88
@ VTK_ASCII
Definition: vtkio.h:87
@ STRUCTURED_GRID
Definition: vtkio.h:111
@ STRUCTURED_POINTS
Definition: vtkio.h:110
@ UNSTRUCTURED_GRID
Definition: vtkio.h:113
@ POLYDATA
Definition: vtkio.h:114
@ RECTILINEAR_GRID
Definition: vtkio.h:112
@ DATASET_UNKNOWN
Definition: vtkio.h:109
float spacingx
Definition: vtkio.h:135
bool is_new_file
Definition: vtkio.h:125
VtkIO(const string &fname, IOMode rw_mode=READ_ONLY)
Definition: vtkio.cpp:43
float spacingy
Definition: vtkio.h:136
float originz
Definition: vtkio.h:134
DataType datatype
Definition: vtkio.h:127
DataType get_datatype_from_name(const string &datatype_name)
Definition: vtkio.cpp:394
float originy
Definition: vtkio.h:133
DatasetType get_datasettype_from_name(const string &dataset_name)
Definition: vtkio.cpp:427
@ DOUBLE
Definition: vtkio.h:104
@ DATATYPE_UNKNOWN
Definition: vtkio.h:93
@ SHORT
Definition: vtkio.h:98
@ UNSIGNED_SHORT
Definition: vtkio.h:97
@ CHAR
Definition: vtkio.h:96
@ UNSIGNED_LONG
Definition: vtkio.h:101
@ UNSIGNED_CHAR
Definition: vtkio.h:95
@ UNSIGNED_INT
Definition: vtkio.h:99
int nx
Definition: vtkio.h:129
VtkType filetype
Definition: vtkio.h:128
int ny
Definition: vtkio.h:130
int get_mode_size(DataType d)
Definition: vtkio.cpp:368
static const char * MAGIC
Definition: vtkio.h:82
bool is_big_endian
Definition: vtkio.h:124
DEFINE_IMAGEIO_FUNC
Definition: vtkio.h:78
void read_dataset(DatasetType dstype)
Definition: vtkio.cpp:448
float spacingz
Definition: vtkio.h:137
int to_em_datatype(int vtk_datatype)
Definition: vtkio.cpp:353
static bool is_valid(const void *first_block)
Definition: vtkio.cpp:160
int nz
Definition: vtkio.h:131
E2Exception class.
Definition: aligner.h:40