Bsoft  2.1.0
Bernard's software package
rwmgIMOD.h
Go to the documentation of this file.
1 
9 #include "mg_processing.h"
10 
11 #define IMODSIZE 232
12 #define OBJTSIZE 176
13 #define CONTSIZE 16
14 
15 struct IMOD {
16  char name[128]; // Name of model file.
17  int xmax; // Maximum values for x,y and z. These are usually
18  int ymax; // set to the image dimensions.
19  int zmax;
20 
21  int objsize; // Number of objects in model.
22 
23  uint flags; // Model flags (IMODF_FLAG...)
24  // Bit 12 on : multiple clip planes are possible
25  // Bit 13 on : mat1 and mat3 are stored as bytes
26  // Bit 14 on : otrans has image origin values
27  // Bit 15 on : current tilt angles are stored correctly
28  // Bit 16 on : model last viewed on Y/Z flipped image
29  int drawmode; // 1 to draw model, -1 not to
30  int mousemode; // Mouse editing mode. (0=movie,1=model)
31 
32  int blacklevel; // Contrast adjustment. (0-256) Default = 0.
33  int whitelevel; // Contrast adjustment. (0-256) Default = 255.
34 
35  float xoffset; // Offsets used for display & conversion,
36  float yoffset; // should be set to 0.
37  float zoffset; // (unused, superceded by MINX information)
38 
39  float xscale; // Scaling for pixel size. xscale and yscale should
40  float yscale; // be 1.0 and zscale should be adjusted to account
41  float zscale; // for the image thickness.
42 
43  int object; // Current object, contour and point, used for
44  int contour; // model editing.
45  int point;
46 
47  int res; // Minimum number of pixels between points when adding
48  // points by dragging mouse with middle button down.
49  int thresh; // Threshold level for auto contour generator.
50 
51  float pixsize; // Size of one pixel, in the units given next
52  int units; // 0 = pixels, 3 = km, 1 = m, -2 = cm, -3 = mm,
53  // -6 = microns, -9 = nm, -10 = Angstroms, -12 = pm
54 
55  int csum; // Checksum storage. Used for autosave only.
56 
57  float alpha; // Angles used for orientation of the model with
58  float beta; // image. Should be set to 0.0
59  float gamma; // (unused, superceded by MINX information)
60 };
61 
62 struct OBJT {
63  char name[64]; // Name of Object. Null terminated string.
64  uint extra[16]; // Extra data for future use, indexed by IOBJ_EX_ defines
65  // 0 (PNT_LIMIT): Limit on number of points per contour
66 
67  int contsize; // Number of Contours in object.
68  uint flags; // bit flags for object (IMOD_OBJFLAG...).
69  // Bit 1 on : Off - turns off display
70  // Bit 2 on : Draw using depth cue
71  // Bit 3 on : Open - contours are not closed
72  // Bit 4 on : Wild - contours not constrained in Z
73  // Bit 5 on : Inside-out - light inside surface
74  // Bit 6 on : Use fill color for spheres
75  // Bit 7 on : Draw spheres on central section only
76  // Bit 8 on : Fill - draw filled polygons
77  // Bit 9 on : Scattered - contours have scattered points
78  // Bit 10 on : Mesh - draw mesh data in 3D
79  // Bit 11 on : Lines - do not draw contours in 3D
80  // Bit 12 on : Use stored values to modify drawing
81  // Bit 13 on : Keep contours planar in open object
82  // Bit 14 on : Fill color - use instead of regular color
83  // Bit 15 on : Anti-aliasing on
84  // Bit 16 on : Normals have magnitudes
85  // Bit 17 on : Draw stored values with false color
86  // Bit 18 on : Time - contours have time indexes
87  // Bit 19 on : Light both sides of surface
88  // Bit 20 on : Draw current contour thicker in model view
89  // Bit 21 on : Draw extra object in model view
90  // Bit 22 on : Allow extra object editing in model view
91  // Bit 23 on : Do not draw spheres in model view
92  // Bit 24 on : Draw extra object only in model view
93  // Bit 31 reserved for temporary use
94 
95  // In 3dmodv, Draw Data Type - Contour = Mesh flag off,
96  // Mesh = Mesh flag on
97  // Drawing Style - Points = Lines flag on, Fill flag off
98  // Lines = Lines flag off, Fill flag off
99  // Fill = Lines flag on, Fill flag on
100  // Fill Outline = Lines flag off, Fill flag on
101 
102  int axis; // Z = 0, X = 1, Y = 2. (unused)
103  int drawmode; // Tells type of scattered points to draw (unused)
104 
105  float red; // Color values, range is (0.0 - 1.0)
106  float green;
107  float blue;
108 
109  int pdrawsize; // Default radius in pixels of scattered points in 3D.
110 
111  unsigned char symbol; // Point Draw symbol in 2D, default is 1.
112  // 0 = circle, 1 = none, 2 = square, 3 = triangle,
113  // 4 = star.
114  unsigned char symsize; // Size of 2D symbol; radius in pixels.
115  unsigned char linewidth2; // Linewidth in 2-D view.
116  unsigned char linewidth; // Linewidth in 3-D view.
117  unsigned char linesty; // Line draw style, 0 = solid; 1 = dashed (unused).
118  unsigned char symflags; // Bit 0 on : Fill the symbol.
119  // Bit 1 on : Draw beginning and end symbols.
120  unsigned char sympad; // Set to 0, for future use.
121  unsigned char trans; // Transparency, range is (0 to 100), maps to
122  // (1.0 to 0.0) in call to glColor4f or glMaterialfv
123 
124  int meshsize; // Number of meshes in object.
125  int surfsize; // Max surfaces in object.
126 };
127 
128 struct CONT {
129  int psize; // Number of points in contour.
130  uint flags; // Bit 3 on : open, do not connect endpoints
131  // Bit 4 on : wild, not in one Z plane
132  // Bit 5 on : draw stippled lines
133  // Bit 6 on : draw if mouse in window, ignore Z
134  // Bit 7 on : draw on all planes, regardless of Z
135  // Bit 8 on : draw only in model mode
136  // Bit 17 on : contour has pairs of scan lines
137  // Bits 18, 19, 20, 31: reserved for temporary use
138  int time; // The time index used by this contour.
139  int surf; // The surface index used by this contour.
140 // float* pt; // Array of point triplets.
141 };
142 
143 // Function prototypes
144 int read_imod_tlt(Bstring& filename, Bproject* project);
145 int read_project_imod(Bstring* file_list, Bproject* project, int flag);
146 int write_project_imod(Bstring& imodfile, Bproject* project);
147 
OBJT::red
float red
Definition: rwmgIMOD.h:105
OBJT::symsize
unsigned char symsize
Definition: rwmgIMOD.h:114
IMOD::drawmode
int drawmode
Definition: rwmgIMOD.h:29
OBJT::drawmode
int drawmode
Definition: rwmgIMOD.h:103
OBJT::axis
int axis
Definition: rwmgIMOD.h:102
CONT
Definition: rwmgIMOD.h:128
Bstring
Definition: Bstring.h:29
OBJT::flags
uint flags
Definition: rwmgIMOD.h:68
IMOD::res
int res
Definition: rwmgIMOD.h:47
OBJT::sympad
unsigned char sympad
Definition: rwmgIMOD.h:120
IMOD::pixsize
float pixsize
Definition: rwmgIMOD.h:51
IMOD::point
int point
Definition: rwmgIMOD.h:45
IMOD::xoffset
float xoffset
Definition: rwmgIMOD.h:35
CONT::time
int time
Definition: rwmgIMOD.h:138
CONT::flags
uint flags
Definition: rwmgIMOD.h:130
IMOD::yscale
float yscale
Definition: rwmgIMOD.h:40
OBJT::symflags
unsigned char symflags
Definition: rwmgIMOD.h:118
OBJT::surfsize
int surfsize
Definition: rwmgIMOD.h:125
IMOD::name
char name[128]
Definition: rwmgIMOD.h:16
IMOD::flags
uint flags
Definition: rwmgIMOD.h:23
project
Bproject * project
Definition: bshow.cpp:33
IMOD::xscale
float xscale
Definition: rwmgIMOD.h:39
read_imod_tlt
int read_imod_tlt(Bstring &filename, Bproject *project)
Definition: rwmgIMOD.cpp:48
OBJT::green
float green
Definition: rwmgIMOD.h:106
OBJT::pdrawsize
int pdrawsize
Definition: rwmgIMOD.h:109
OBJT::symbol
unsigned char symbol
Definition: rwmgIMOD.h:111
Bproject
Definition: mg_processing.h:336
IMOD
Definition: rwmgIMOD.h:15
IMOD::mousemode
int mousemode
Definition: rwmgIMOD.h:30
OBJT::meshsize
int meshsize
Definition: rwmgIMOD.h:124
OBJT::name
char name[64]
Definition: rwmgIMOD.h:63
OBJT::linewidth
unsigned char linewidth
Definition: rwmgIMOD.h:116
OBJT
Definition: rwmgIMOD.h:62
OBJT::extra
uint extra[16]
Definition: rwmgIMOD.h:64
IMOD::yoffset
float yoffset
Definition: rwmgIMOD.h:36
CONT::psize
int psize
Definition: rwmgIMOD.h:129
IMOD::blacklevel
int blacklevel
Definition: rwmgIMOD.h:32
OBJT::linewidth2
unsigned char linewidth2
Definition: rwmgIMOD.h:115
IMOD::zscale
float zscale
Definition: rwmgIMOD.h:41
OBJT::trans
unsigned char trans
Definition: rwmgIMOD.h:121
OBJT::contsize
int contsize
Definition: rwmgIMOD.h:67
IMOD::objsize
int objsize
Definition: rwmgIMOD.h:21
IMOD::units
int units
Definition: rwmgIMOD.h:52
IMOD::whitelevel
int whitelevel
Definition: rwmgIMOD.h:33
OBJT::linesty
unsigned char linesty
Definition: rwmgIMOD.h:117
IMOD::xmax
int xmax
Definition: rwmgIMOD.h:17
IMOD::object
int object
Definition: rwmgIMOD.h:43
IMOD::ymax
int ymax
Definition: rwmgIMOD.h:18
mg_processing.h
Header file for micrograph processing.
write_project_imod
int write_project_imod(Bstring &imodfile, Bproject *project)
Creates IMOD parameter files from a project structure.
Definition: rwmgIMOD.cpp:452
read_project_imod
int read_project_imod(Bstring *file_list, Bproject *project, int flag)
Creates a project structure using IMOD parameters.
Definition: rwmgIMOD.cpp:242
IMOD::contour
int contour
Definition: rwmgIMOD.h:44
IMOD::alpha
float alpha
Definition: rwmgIMOD.h:57
IMOD::gamma
float gamma
Definition: rwmgIMOD.h:59
IMOD::beta
float beta
Definition: rwmgIMOD.h:58
IMOD::zoffset
float zoffset
Definition: rwmgIMOD.h:37
IMOD::zmax
int zmax
Definition: rwmgIMOD.h:19
IMOD::csum
int csum
Definition: rwmgIMOD.h:55
CONT::surf
int surf
Definition: rwmgIMOD.h:139
IMOD::thresh
int thresh
Definition: rwmgIMOD.h:49
OBJT::blue
float blue
Definition: rwmgIMOD.h:107