http://cmpdartsvr3-v.uea.ac.uk/wiki/BanghamLab/index.php?title=VolViewer_msr_file_specification&feed=atom&action=historyVolViewer msr file specification - Revision history2024-03-28T10:59:27ZRevision history for this page on the wikiMediaWiki 1.35.5http://cmpdartsvr3-v.uea.ac.uk/wiki/BanghamLab/index.php?title=VolViewer_msr_file_specification&diff=5867&oldid=prevAndrewBangham at 21:32, 1 March 20122012-03-01T21:32:45Z<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:32, 1 March 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[VolViewer Scripting in more detail|Back to VolViewer Scripting in more detail]]<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[VolViewer|Back to VolViewer]]<br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= <span style="color: Navy">Concepts represented in the MSR file</span> =</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>= <span style="color: Navy">Concepts represented in the MSR file</span> =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>AndrewBanghamhttp://cmpdartsvr3-v.uea.ac.uk/wiki/BanghamLab/index.php?title=VolViewer_msr_file_specification&diff=5868&oldid=prevAndrewBangham: Created page with '= <span style="color: Navy">Concepts represented in the MSR file</span> = An MSR file represents objects (geometry and growth) associated to a unique data file (for example a 3D…'2012-03-01T21:31:20Z<p>Created page with '= <span style="color: Navy">Concepts represented in the MSR file</span> = An MSR file represents objects (geometry and growth) associated to a unique data file (for example a 3D…'</p>
<p><b>New page</b></p><div>= <span style="color: Navy">Concepts represented in the MSR file</span> =<br />
<br />
An MSR file represents objects (geometry and growth) associated to a unique data file (for example a 3D stack).<br />
<br />
The file is a succession of directives. Directives are either global (in the header) or per object (in the body). All directives are mandatory, unless stated otherwise.<br />
<br />
= <span style="color: Navy">General Syntax Overview</span> =<br />
MSR files are simple text files (ASCII), whose general structure is :<br />
<br />
FIELDNAME = FIELDVALUE # Comment<br />
<br />
All field names are case insensitive.<br />
Comments start with a '#' and end at the end of the line. The file should be parsed after removing the comments from the file.<br />
<br />
When parsing, empty lines (i.e. truly empty or with only spaces and comments) must be skipped.<br />
<br />
Except for version 0, that shouldn't be used anymore, the first line shoud be:<br />
<br />
MSR_VERSION = major.minor<br />
<br />
The file should be readable in one pass. To help, each list of fields is preceded with a list count with the syntax:<br />
<br />
fieldnameCOUNT = count<br />
fieldname = value1<br />
fieldname = value2<br />
...<br />
<br />
==Number and String values==<br />
<br />
Numbers can be either in decimal or scientific notation format:<br />
<br />
0.001<br />
1e-3<br />
1E-3<br />
<br />
are all accepted numbers. <br />
<br />
<br />
String are represented using a character delimiter to allow for spaces, numbers etcs.. in the string and easy reading. This special character is the single quote (''' ' ''').<br />
<br />
<nowiki>'hello this is my 1st string'</nowiki><br />
<br />
is a valid string. This however means we require special handling of the single quote character in a string. This is represented by using two single quote characters as follows:<br />
<br />
<nowiki>'hello it''s my first string'</nowiki><br />
<br />
is a valid string to represent: '''<nowiki>hello it's my first string</nowiki>'''. <br />
<br />
''(NB)'' Note that newlines are not accepted in strings.<br />
<br />
= Field names and specifications =<br />
<br />
=='''FILE HEADER:''' Global Directives==<br />
<br />
These directives define the header of the file.<br />
<br />
=== File version ===<br />
<br />
MSR_VERSION = major.minor<br />
<br />
This field has to be the first one of the file. If not present, it means the file is a legacy version 0, which is not covered by this document.<br />
<br />
'''Version:''' &ge;0.1 | '''Mandatory''' <br />
<br />
=== Location of the original data ===<br />
<br />
ORIGINALDATA = TYPE SPEC<br />
<br />
Reference to the original data.<br />
<br />
'''Version:''' &ge;0.1 | '''Mandatory'''<br />
<br />
==== Supported reference types ====<br />
<br />
* NONE<br />
<br />
ORIGINALDATA = NONE<br />
<br />
This is when no original image is specified.<br />
<br />
<br />
'''Version:''' &ge;1.1 | '''Mandatory'''<br />
<br />
* PATH<br />
<br />
ORIGINALDATA = PATH '/path/to/someimage'<br />
<br />
The path to some data ie: an image is stored using '/' as the directory separator. The path may be absolute or relative. If relative, it is expressed relative to the position of the MSR file.<br />
<br />
'''Version:''' &ge;0.1 | '''Mandatory'''<br />
<br />
* OMEROID<br />
<br />
ORIGINALDATA = OMEROID 'serveraddress:port/imageid'<br />
<br />
Example:<br />
<br />
ORIGINALDATA = OMEROID 'cmpdartsvr1.cmp.uea.ac.uk:4063/456215'<br />
<br />
Where SERVERADDRESS can be either the IP address or the host name of the server, PORT is the port used by the OMERO server and IMAGEID is the unique id within the database.<br />
<br />
'''Version:''' &ge;0.1 | '''Mandatory'''<br />
<br />
=== Scale ===<br />
<br />
SCALE = sx sy sz<br />
<br />
Size of a unit in meters. The three component correspond to the size of a unit square along the X, Y and Z axes. If not present, it is assumed be equivalent to:<br />
<br />
SCALE = 1 1 1<br />
<br />
'''Version:''' &ge;0.1<br />
<br />
=== Time of the data ===<br />
<br />
Can be either TIME or DATE.<br />
<br />
TIME = time<br />
<br />
The time is expressed in hours from an unspecified reference.<br />
<br />
DATE = 'YYYY/MM/DD hh:mm:sec'<br />
<br />
The time and day the image has been taken. The seconds may be a floating point value.<br />
<br />
'''Version:''' &ge;0.1 | '''Mandatory'''<br />
<br />
=== Algorithm identification ===<br />
<br />
String that uniquely identifies the algorithm used to generate that file, and its version.<br />
<br />
ALGORITHM = STRING<br />
<br />
Example:<br />
<br />
ALGORITHM = 'measure_growth.py 1539'<br />
<br />
'''Version:''' &ge;0.1 | '''Optional'''<br />
<br />
=== Number of objects ===<br />
<br />
''NB'' This field must be the last one of the header!<br />
<br />
OBJECTCOUNT = number_of_objects <br />
<br />
'''Version:''' &ge;0.1<br />
<br />
=='''FILE BODY:''' Structured Directives ==<br />
<br />
These are directives defining objects that can be labelled, used in lists, ...<br />
<br />
=== Objects ===<br />
<br />
OBJECTCOUNT = count<br />
OBJECT = 'name'<br />
<br />
Defines objects by their name. This element must be right after the header. Actually, OBJECTCOUNT defines when the header ends.<br />
<br />
'''Version:''' &ge;1.1 | '''Mandatory''' <br />
<br />
=== Vertices ===<br />
<br />
VERTCOUNT = count<br />
VERT = Vx Vy Vz<br />
<br />
Defines the list of vertices of an object, and their positions. Vx, Vy and Vz should be floating point values.<br />
<br />
'''Version:''' &ge;1.1 | '''Contained in OBJECT''' | '''Mandatory'''<br />
<br />
=== Edges ===<br />
<br />
EDGECOUNT = count<br />
EDGE = source target<br />
<br />
Defines the list of edges of an object. Source and target are 0-based indices in the list of vertices.<br />
<br />
<br />
'''Version:''' &ge;1.1 | '''Contained in OBJECT''' | '''Optional''' | '''Requires VERT'''<br />
<br />
=== Faces ===<br />
<br />
FACECOUNT = count<br />
FACE = v1 v2 v3 ... vn<br />
<br />
Defines the list of faces of an object. The vertices are specified by 0-based index in the list of vertices.<br />
<br />
<br />
'''Version:''' &ge;1.1 | '''Contained in OBJECT''' | '''Optional''' | '''Requires VERT'''<br />
<br />
=== Volumes ===<br />
<br />
VOLCOUNT = count<br />
VOL = face1 face2 face3 ... facen<br />
<br />
Defines the list of volumes of an object. The faces are specified by 0-based index in the list of faces.<br />
<br />
<br />
'''Version:''' &ge;1.1 | '''Contained in OBJECT''' | '''Optional''' | '''Requires FACE'''<br />
<br />
===Structured Directive Properties ===<br />
<br />
This contains the elements that can be contained within a structured directive.<br />
<br />
==== Render Type ====<br />
<br />
RENDERTYPE = 'type'<br />
<br />
This defines how an object should be rendered. This is only a hint that is application-specific.<br />
<br />
'''Version:''' &ge;0.1 | '''Contained in OBJECT''' | '''Optional'''<br />
<br />
<br />
<br />
==== Normals ====<br />
<br />
xxxxNORMAL = Nx Ny Nz<br />
<br />
Normals are 3D normalized vectors and xxxx is to be replaced by the parent directive. Note that normals can only be specified after the directive count has been specified.<br />
<br />
Example:<br />
<br />
FACENORMAL = 0.0 1.0 0.0<br />
<br />
'''Version:''' &ge;1.1 | '''Contained in VERT, EDGE, FACE''' | '''Optional'''<br />
<br />
==== Colours ====<br />
<br />
xxxxCOLOUR = R G B<br />
<br />
Colours are specified as an R,G,B vector with values from 0 to 255, xxxx is to be replaced by the parent directive. Note that colours can only be specified after the directive count has been specified.<br />
<br />
Example:<br />
<br />
FACECOLOUR = 0 255 0<br />
<br />
'''Version:''' &ge;1.2 | '''Contained in VERT, EDGE, FACE, VOLUME''' | '''Optional'''<br />
<br />
==== Morphogens ====<br />
<br />
Morphogens are scalar values associated with vertices. Each morphogen has a name and each morphogen is defined for every vertex.<br />
Morphogen names are specified by a directive of the form:<br />
<br />
VERTMGENNAMES = name name name...<br />
<br />
listing the names of all of the morphogens as quoted strings.<br />
The values for the morphogens are specified by directives of the form:<br />
<br />
VERTMGEN = amount amount amount...<br />
<br />
The amounts are listed in the same order as their names were. There is one VERTMGEN line for each vertex.<br />
<br />
'''Version:''' &ge;1.2 | '''Contained in VERT''' | '''Optional''' | '''Requires: VERTCOUNT'''<br />
<br />
==== Growth ====<br />
===== Face Growth =====<br />
<br />
This is a list of growths specifications for all faces. As the number has to be the same as the number of faces, it is not re-specified. The start of the list is given by:<br />
<br />
FACEGROWTHDT = dt<br />
<br />
Where dt is the difference in time between this object and the object used as reference for this growth. Note that, if dt is negative, it means the growth represent the growth from the previous time to the current one, but expressed in the current reference frame.<br />
<br />
Next, the growth parameters are given by:<br />
<br />
FACEGROWTH = kmax kmin Vx Vy Vz<br />
<br />
Where kmax is the relative elemental growth rate of growth along the major axis, kmin the relative elemental growth rate of growth along the minor axis, and (Vx,Vy,Vz) is a unit vector defining the major axis. The minor axis can be found with the cross-product between the major axis and the normal to the face. Note that kmax is taken as the largest absolute value of the two growth rates. <br />
<br />
Note, there might be many growth specified for a same object, but only one per dt.<br />
<br />
'''Version:''' &ge;0.1 | '''Optional''' | '''Requires: FACECOUNT'''<br />
<br />
===== Edge Growth =====<br />
<br />
This is a list of growths specifications for all edges. As the number has to be the same as the number of edges, it is not re-specified. The start of the list is given by:<br />
<br />
EDGEGROWTHDT = dt<br />
<br />
Where dt is the difference in time between this object and the object used as reference for this growth. Note that, if dt is negative, it means the growth represent the growth from the previous time to the current one, but expressed in the current reference frame.<br />
<br />
Next, the growth parameters are given by:<br />
<br />
EDGEGROWTH = k<br />
<br />
Where k is the relative growth rate along the edge.<br />
<br />
Note, there might be many growth specified for a same object, but only one per dt.<br />
<br />
'''Version:''' &ge;0.1 | '''Optional''' | '''Requires: EDGECOUNT'''<br />
<br />
<br />
==== Labels ====<br />
<br />
xxxxLABEL = n 'label1' 'label2' .... 'labeln'<br />
<br />
This is a list of labels attached to some directive. If a directive is labelled, every element of it must be. <br />
<br />
Labels start with the count for the number of labels followed by the label strings. The xxxx is to be replaced by the labelled directive. Note that a directive can be labelled only after the directive count has been specified.<br />
<br />
Example:<br />
<br />
VERTLABEL = 2 'petiole' 'cell corner'<br />
<br />
Empty labels are represented by:<br />
<br />
VERTLABEL = 0<br />
<br />
'''Version:''' &ge;1.2 | '''Contained in VERT, EDGE, FACE, VOLUME''' | '''Optional'''<br />
<br />
==== Lists ====<br />
<br />
Lists are a named ordered series of indices attached to some directive. Note that a list can be only after the directive count has been specified. Lists start with a xxxxLISTCOUNT field to facilitate reading followed by the xxxxLIST directive that starts with a sting name label followed by the indices making up the list. The number of indices in the list must match the xxxxLISTCOUNT.<br />
<br />
xxxxLISTCOUNT = N<br />
xxxxLIST = 'name' idx1 idx2 idx3 ... idxN<br />
<br />
example:<br />
<br />
EDGELISTCOUNT 5 <br />
EDGELIST 'lamina outer edge' 5 6 4 8 2 <br />
<br />
'''Version:''' &ge;1.2 | '''Contained in VERT, EDGE, FACE, VOLUME''' | '''Optional'''<br />
<br />
=Examples=<br />
<br />
==A Triangle==<br />
<br />
[[Image:Simple_triangle.svg|thumb]]<br />
<br />
MSR_VERSION = 1.2<br />
ORIGINALDATA = PATH '/path/to/image'<br />
SCALE = 1 1 1<br />
TIME = 0<br />
OBJECTCOUNT = 1<br />
OBJECT = 'Triangle' <br />
VERTCOUNT = 3<br />
VERT = -10 0 0<br />
VERT = 10 0 0<br />
VERT = 0 10 0<br />
EDGECOUNT = 3<br />
EDGE = 0 1<br />
EDGE = 1 2<br />
EDGE = 2 0<br />
FACECOUNT = 1<br />
FACE = 0 1 2<br />
<br />
==Two Triangles as different objects==<br />
<br />
[[Image:Twotriangles.svg|thumb]]<br />
<br />
MSR_VERSION = 1.2<br />
ORIGINALDATA = PATH '/path/to/image'<br />
SCALE = 1 1 1<br />
TIME = 0<br />
OBJECTCOUNT = 2<br />
OBJECT = 'Triangle1' <br />
VERTCOUNT = 3<br />
VERT = -10 0 0<br />
VERT = 10 0 0<br />
VERT = 0 10 0<br />
EDGECOUNT = 3<br />
EDGE = 0 1<br />
EDGE = 1 2<br />
EDGE = 2 0<br />
FACECOUNT = 1<br />
FACE = 0 1 2<br />
OBJECT = 'Triangle2' <br />
VERTCOUNT = 3<br />
VERT = -10 0 10<br />
VERT = 10 0 10<br />
VERT = 0 10 10<br />
EDGECOUNT = 3<br />
EDGE = 0 1<br />
EDGE = 1 2<br />
EDGE = 2 0<br />
FACECOUNT = 1<br />
FACE = 0 1 2<br />
<br />
== Triangle with labels ==<br />
<br />
[[Image:Triangle_labelled.svg|thumb]]<br />
<br />
MSR_VERSION = 1.2<br />
ORIGINALDATA = PATH '/path/to/image'<br />
SCALE = 1 1 1<br />
TIME = 0<br />
OBJECTCOUNT = 1<br />
OBJECT = 'Triangle'<br />
VERTCOUNT = 3<br />
VERT = -10 0 0<br />
VERT = 10 0 0<br />
VERT = 0 10 0<br />
VERTLABEL = 0<br />
VERTLABEL = 0<br />
VERTLABEL = 1 'Tip' <br />
EDGECOUNT = 3<br />
EDGE = 0 1<br />
EDGE = 1 2<br />
EDGE = 2 0<br />
EDGELABEL = 1 'Base'<br />
EDGELABEL = 0<br />
EDGELABEL = 0 <br />
FACECOUNT = 1<br />
FACE = 0 1 2<br />
<br />
==A Leaf with Labels and Lists==<br />
<br />
[[Image:LeafLabelsandList.svg|thumb]]<br />
<br />
MSR_VERSION = 1.2<br />
ORIGINALDATA = PATH '/path/to/image'<br />
SCALE = 1 1 1<br />
TIME = 0<br />
OBJECTCOUNT = 1<br />
OBJECT = 'ShapeModelLeaf' <br />
VERTCOUNT = 15<br />
VERT = 54 144 0<br />
VERT = 120 143 0<br />
VERT = 157 164 0<br />
VERT = 201 204 0<br />
VERT = 254 221 0<br />
VERT = 325 208 0<br />
VERT = 385 171 0<br />
VERT = 422 127 0<br />
VERT = 374 82 0<br />
VERT = 318 62 0<br />
VERT = 255 36 0<br />
VERT = 200 50 0<br />
VERT = 154 72 0<br />
VERT = 120 100 0<br />
VERT = 47 97 0<br />
VERTLABEL = 1 'Primary'<br />
VERTLABEL = 1 'Primary'<br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Primary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 2 'Primary' 'Tip' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Primary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Secondary' <br />
VERTLABEL = 1 'Primary' <br />
VERTLABEL = 1 'Primary'<br />
VERTLISTCOUNT = 13<br />
VERTLIST = 'Lamina' 1 2 3 4 5 6 7 8 9 10 11 12 13<br />
VERTLISTCOUNT = 4<br />
VERTLIST = 'Petiole' 1 0 14 13<br />
EDGECOUNT = 15<br />
EDGE = 0 1<br />
EDGE = 1 2<br />
EDGE = 2 3<br />
EDGE = 3 4<br />
EDGE = 4 5<br />
EDGE = 5 6<br />
EDGE = 6 7<br />
EDGE = 7 8<br />
EDGE = 8 9<br />
EDGE = 9 10<br />
EDGE = 10 11<br />
EDGE = 11 12<br />
EDGE = 12 13<br />
EDGE = 13 14<br />
EDGE = 14 0</div>AndrewBangham