Difference between revisions of "Importing models"

From Dynamo
Jump to navigation Jump to search
Line 32: Line 32:
 
<tt>
 
<tt>
 
  r = dread(someFile.txt);
 
  r = dread(someFile.txt);
<nowiki>#<nowiki> now r sould be a matrix with three columns defined in workspace
+
<nowiki>#</nowiki> now r sould be a matrix with three columns defined in workspace
 
  m.addPoint(r); % the matrix of points gets added into model m
 
  m.addPoint(r); % the matrix of points gets added into model m
 
</tt>
 
</tt>

Revision as of 12:06, 27 April 2016

Importing models refers to the creation of model objects based on coordinates and angles computed outside Dynamo. It might also imply the embedding of the resulting model into an existing catalogue entry.


With the GUI

When importing models with the GUIs of the catalogue, the resulting models get automatically assigned to a catalogued volume.

From the command line

Import with dmiport

The basic command is dynamo_model_import. m = dmimport(myFormat,mySource);

Here, mySource can be different objects or files that contain coordinates or angles. You specify the format of the source with myFormat. Different options are

  1. 'xyz' for inputs formatted as columns of coordinates.
  2. Template:T, if the input is a Dynamo table
  3. 'motl' for AV3 motl files or variables.
  4. 'star' for star files defined inside jsubtomo.

Manual creation

Alternatively, you can generate a model from scratch and then fill it with coordinates and angles. In this case, you would write:

m = dmodels.general();

This generates a general model where you can store coordinates with method addPoint. For instance, if you have a text file with three columns representing x,y,z coordinates, you can read it and feed the model with:

r = dread(someFile.txt);

# now r sould be a matrix with three columns defined in workspace

m.addPoint(r); % the matrix of points gets added into model m

When you are finished adding points, you close the model with updateCrop:

m.updateCrop();

to ensure that crop_points have been generated, and thus Dynamo will be able to produce a non-empty table when the model is invoked on a later stage.