Difference between revisions of "Importing models"
(9 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
==With the GUI== | ==With the GUI== | ||
− | When importing models with the GUIs of the catalogue, the resulting models get automatically assigned to a catalogued volume. | + | When importing models with the GUIs of the catalogue, the resulting models get automatically assigned to a catalogued volume. The number of models assigned to a volume in the catalogue is one of the columns in the row corresponding to that tomogram in the [[dcm GUI]]. If you see that after addition of a model into the tomogram the number of assigned models doesn't change, refresh the GUI pressing the {{t|list volumes}} button. |
== From the command line== | == From the command line== | ||
− | === | + | === Import with {{t|dmiport}} === |
The basic command is {{t|dynamo_model_import}}. | The basic command is {{t|dynamo_model_import}}. | ||
− | |||
<tt> | <tt> | ||
m = dmimport(myFormat,mySource); | m = dmimport(myFormat,mySource); | ||
</tt> | </tt> | ||
− | Here,{{t|mySource}} can be different objects or files that contain coordinates or angles. You specify the format of the source with {{t|myFormat}}. | + | Here, {{t|mySource}} can be different objects or files that contain coordinates or angles. You specify the format of the source with {{t|myFormat}}. |
Different options are | Different options are | ||
#{{t|'xyz'}} for inputs formatted as columns of coordinates. | #{{t|'xyz'}} for inputs formatted as columns of coordinates. | ||
− | #{{t | + | #{{t|'table'}} if the input is a ''Dynamo'' table |
#{{t|'motl'}} for AV3 motl files or variables. | #{{t|'motl'}} for AV3 motl files or variables. | ||
+ | #{{t|'star'}} for star files defined inside jsubtomo. | ||
− | + | === Manual creation === | |
− | == Manual creation == | ||
Alternatively, you can generate a model from scratch and then fill it with coordinates and angles. In this case, you would write: | Alternatively, you can generate a model from scratch and then fill it with coordinates and angles. In this case, you would write: | ||
Line 32: | Line 31: | ||
<tt> | <tt> | ||
− | r = dread(someFile.txt); | + | r = dread(someFile.txt); |
− | m.addPoint(r); | + | <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 | ||
+ | </tt> | ||
+ | |||
+ | If you have angles that you have computed externally (but parametrised with the ''Dynamo'' convention), you can also put them inside the model. | ||
+ | <tt> | ||
+ | r = dread(someOtherFile.txt); | ||
+ | <nowiki>#</nowiki> now myAngles sould be a matrix with three columns defined in workspace | ||
+ | m.crop_angles = myAngles | ||
</tt> | </tt> | ||
+ | |||
When you are finished adding points, you close the model with {{t|updateCrop}}: | When you are finished adding points, you close the model with {{t|updateCrop}}: | ||
Line 43: | Line 51: | ||
to ensure that {{t|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. | to ensure that {{t|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. | ||
+ | |||
+ | === Including the model into the catalog === | ||
+ | |||
+ | Remember that you need to [[Adding_models_to_catalogued_volumes| link and save a model into the catalogue]] if you want to access it later through the catalogue. |
Latest revision as of 10:51, 12 March 2020
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.
Contents
With the GUI
When importing models with the GUIs of the catalogue, the resulting models get automatically assigned to a catalogued volume. The number of models assigned to a volume in the catalogue is one of the columns in the row corresponding to that tomogram in the dcm GUI. If you see that after addition of a model into the tomogram the number of assigned models doesn't change, refresh the GUI pressing the list volumes button.
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
- 'xyz' for inputs formatted as columns of coordinates.
- 'table' if the input is a Dynamo table
- 'motl' for AV3 motl files or variables.
- '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
If you have angles that you have computed externally (but parametrised with the Dynamo convention), you can also put them inside the model.
r = dread(someOtherFile.txt);
# now myAngles sould be a matrix with three columns defined in workspace
m.crop_angles = myAngles
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.
Including the model into the catalog
Remember that you need to link and save a model into the catalogue if you want to access it later through the catalogue.