informatics-isi-edu / mesh-viewer

3D mesh viewer
1 stars 1 forks source link

mesh-viewer

3D model viewer for rendering surface meshes and landmarks.

Features

Interface

The viewer is accessed view its view.html page and expects a set of parameters indicating web resource locations (URL) of the model specification. The parameters are passed as part of the fragment identifier (i.e., following the # of the URL).

Parameters

The model specification is a combination of JSON documents that describe what to render in the mesh viewer. The specification is loaded from one or more web resources indicated by the core parameters. These URLs should be URL-encoded in order to be safely passed to the mesh viewer.

Core Parameters

The core parameters for specifying the model specification are:

For example:

view.html#model=http%3A%2F%2Fexample.org%2Fpath%2Fto%2Fmodel&mesh=http%3A%2F%2Fexample.org%2Fpath%2Fto%2Fmeshes&resolver=http:%2F%2Fexample.org%2Fid%2F

Additional Parameters

In addition to the core parameters for specifying the model, meshes and landmarks, these extra options can be passed to modfy the viewer's behavior:

Example URL with query parameters:

<iframe 
  src="https://github.com/informatics-isi-edu/mesh-viewer/raw/master/view.html#model=http%3A%2F%2Fexample.org%2Fpath%2Fto%2Fmodel&mesh=http%3A%2F%2Fexample.org%2Fpath%2Fto%2Fmeshes&resolver=http:%2F%2Fexample.org%2Fid%2F&showmeshes=true&target=my-other-iframe">
</iframe>

Model Specification

A JSON singleton array of an object (if more than one object given only the first will be used). Valid properties for model object:

Example:

[
  {
    "RID": "1-43KT",
    "BG_Color_R": 0,
    "BG_Color_G": 0,
    "BG_Color_B": 0,
    "Bounding_Box_Color_R": 255,
    "Bounding_Box_Color_G": 255,
    "Bounding_Box_Color_B": 0,
    "Units": "mm",
    "Unit_Conversion": 1.0
  }
]

Mesh Specification

A JSON array of objects. Valid properties for mesh objects:

Example:

[
  {
    "RID": "1-444E",
    "URL": "http://mysite.org/my_meshes.obj.gz",
    "Label":"frontal suture",
    "Label_Alt": null,
    "Label_RID":"1-4FC4",
    "Color_R": 66,
    "Color_G": 137,
    "Color_B": 244,
    "Opacity": 1
  }
]

Landmark Specification

A JSON array of objects. Valid properties for landmark objects:

[
  {
    "RID": "1-4452",
    "Mesh": "1-43E0",
    "Label": null,
    "Label_Alt": "Inferior point of mandibular body",
    "Label_RID": null,
    "Point_X": 7.8618,
    "Point_Y": 2.5692,
    "Point_Z": 1.8701,
    "Color_R": 0,
    "Color_G": 0,
    "Color_B": 255,
    "Radius": 0.1,
  }
]