Difference between revisions of "Walkthrough on creation of 3d scenes"

From Dynamo
Jump to: navigation, search
Line 1: Line 1:
 
This walkthrough shows how to create graphic depictions of tomogram contents. Those include:
 
This walkthrough shows how to create graphic depictions of tomogram contents. Those include:
  
* Slices of tomograms
+
* Slices of tomograms.
* Objects loca
+
* Proteins located in the tomogram, with the orientations provided during the alignment.
* Geometrical objects (as membranes represented by triangulations)
+
* Geometrical objects (as membranes represented by triangulations).
  
 
  [[ File:Fhv3dAntialiasing.png |thumb|center| 600px| Goal of the tutorial. An antialiasing filter has been used.]]
 
  [[ File:Fhv3dAntialiasing.png |thumb|center| 600px| Goal of the tutorial. An antialiasing filter has been used.]]
Line 23: Line 23:
 
  <tt>wget  https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec </tt>
 
  <tt>wget  https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec </tt>
  
in a linux shell, or  
+
in a linux shell, or through:
  
 
<tt>curl -O  https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec </tt>
 
<tt>curl -O  https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec </tt>
Line 33: Line 33:
 
https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/membraneModel.omd</nowiki>
 
https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/membraneModel.omd</nowiki>
  
 +
=== From your previos work ===
  
=== From your previos work ===
 
 
Assuming you have done the  [[advanced starters guide| tutorial on the FHV]] data set, you can use the elements that you have already computed. Just extract them from the best project that you completed. Do not use a subboxing project: we want to get a template for the full crown. Examples below are given assuming that your best project was named <tt>localized</tt>, substitute if not.
 
Assuming you have done the  [[advanced starters guide| tutorial on the FHV]] data set, you can use the elements that you have already computed. Just extract them from the best project that you completed. Do not use a subboxing project: we want to get a template for the full crown. Examples below are given assuming that your best project was named <tt>localized</tt>, substitute if not.
  
Line 58: Line 58:
  
 
==== Membrane model ====
 
==== Membrane model ====
If you [[created manually a membrane model]], it should be inside your catalogue
+
If you [[created manually a membrane model]], it should be inside your catalogue with the name <tt>mySurface</tt> (or any other you put). You can check inside the catalogue <tt>fhv</tt>
 +
 
 +
<tt>dcmodels fhv -nc mySurf</tt>
 +
 
 +
Here <tt>-nc mySurf</tt> will look for models with the string "mySurf" in the name. You should get a reply as:
 +
 
 +
<nowiki>Volume 1. Matching models: 1 (total: 1)
 +
/Users/casdanie/dynamo/examples/fhvParis/fhv/tomograms/volume_1/models/mySurface.omd</nowiki>
 +
 
 +
So you can read the model into a new variable (arbitrarily called <tt>m</tt>)
 +
 
 +
<tt>m = drread('Users/casdanie/dynamo/examples/fhvParis/fhv/tomograms/volume_1/models/mySurface.omd');</tt>
 +
 
 +
and write it to disk
  
 
<tt>dwrite(m,'membraneModel.omd');</tt>
 
<tt>dwrite(m,'membraneModel.omd');</tt>
 
  
 
== Depicting a slice of a tomogram ==
 
== Depicting a slice of a tomogram ==
Line 69: Line 81:
 
<tt>s = dpktomo.volume.slices.Slice(); </tt>
 
<tt>s = dpktomo.volume.slices.Slice(); </tt>
  
Here <tt>s</tt> is just an object that will read data from a tomogram file to be defined.
+
Here <tt>s</tt> is just an object that will read data from a tomogram file to be defined, along with geometrical parameters as <tt>center</tt>, <tt>eulers</tt> (orientation), <tt>l</tt>, (sidelength)...
  
  <nowiki>s.source = 'çrop.rec;
+
  <nowiki>s.source = 'crop.rec';
 
s.center = 'center';
 
s.center = 'center';
 
s.l = [1000,1000];
 
s.l = [1000,1000];
Line 77: Line 89:
 
s.fetchData();</nowiki>
 
s.fetchData();</nowiki>
  
 +
=== The slice depictor object ===
  
=== The slice depictor object ===
+
We first create a figure with and empty axis </tt>
 +
<tt>f = figure; haxis = gca();hold on;</tt>
 +
 
 +
[[  File:Fhv3dEmptyAxis.png |thumb|center| 400px| Empty matlab figure with an empty axis.]]
 +
 
 +
Here, <tt>f</tt> are ''handles'' that will be used later to direct the graphical output to our figure.
 +
 +
Now, we initialize a depiction object associated with the slice <tt>s</tt>
 +
<tt>sz = dpktomo.volume.slices.SliceGraphic(s);</tt>
 +
Note that no graphical output has been created yet. We first inform the object <tt>sz</tt> in which axis it is to be created.
 +
 
 +
<tt>sz.axis.h = haxis;</tt>
 +
 
 +
and then create the slice in the available axis.
 +
 
 +
<tt>sz.create();</tt>
 +
 
 +
If the figure is below other windows in your system you can rise it through
 +
 
 +
<tt>shg; </tt>
 +
 
 +
or
  
  <nowiki>f = figure; haxis = gca();hold on;
+
<tt>figure(f);</tt>
sz = dpktomo.volume.slices.SliceGraphic(s);
 
sz.axis.h = haxis;
 
sz.create();
 
% then use h.update(); to
 
shg; </nowiki>
 
  
 
We can change the angle of view with the rotation icon or programmatically:
 
We can change the angle of view with the rotation icon or programmatically:
 
<tt>view([-38,60]);</tt>
 
<tt>view([-38,60]);</tt>
  
  [[ File:Fhv3dAntialiasing.png |thumb|center| 600px| View of the slice with the viewing perspective ([-38,60]).]]
+
  [[ File:Fhv3dSlice.png |thumb|center| 400px| View of the slice with the viewing perspective ([-38,60]).]]

Revision as of 10:59, 21 August 2017

This walkthrough shows how to create graphic depictions of tomogram contents. Those include:

  • Slices of tomograms.
  • Proteins located in the tomogram, with the orientations provided during the alignment.
  • Geometrical objects (as membranes represented by triangulations).
Goal of the tutorial. An antialiasing filter has been used.

The data set

This walkthrough works with the data set from the advanced starters guide. The goal is to depict:

  • One slice of the tomogram in 3D.


This requires a tomogram file.

  • The viruses placed an oriented along the directions found during a previous computed average.


This requires a template represe.

  • A sketch of the membrane

This requires a model object.

From the Dynamo web

The tomogram can get fetched through:

wget  https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec 

in a linux shell, or through:

curl -O https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/crop.rec under MacOS.

The table, template and membrane model can be fetched similarly with names

https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/alignmentLocalRefinement.tbl
https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/averagedLocalRefinement.em
https://wiki.dynamo.biozentrum.unibas.ch/w/doc/data/fhv/membraneModel.omd

From your previos work

Assuming you have done the tutorial on the FHV data set, you can use the elements that you have already computed. Just extract them from the best project that you completed. Do not use a subboxing project: we want to get a template for the full crown. Examples below are given assuming that your best project was named localized, substitute if not.

Table

Recover the last computed refined table in the data base of your project

ddb localized:rt -r t

and write it to a file

dwrite(t,'alignmentLocalRefinement.tbl')

Template

Fetch the last computed average

<tt>ddb localizedFullAngle:rt -r a

and write it into disk

dwrite(t,'averagedLocalRefinement.tbl');

Membrane model

If you created manually a membrane model, it should be inside your catalogue with the name mySurface (or any other you put). You can check inside the catalogue fhv

dcmodels fhv -nc mySurf

Here -nc mySurf will look for models with the string "mySurf" in the name. You should get a reply as:

Volume 1. Matching models: 1 (total: 1) /Users/casdanie/dynamo/examples/fhvParis/fhv/tomograms/volume_1/models/mySurface.omd

So you can read the model into a new variable (arbitrarily called m)

m = drread('Users/casdanie/dynamo/examples/fhvParis/fhv/tomograms/volume_1/models/mySurface.omd');

and write it to disk

dwrite(m,'membraneModel.omd');

Depicting a slice of a tomogram

The slice object

s = dpktomo.volume.slices.Slice();

Here s is just an object that will read data from a tomogram file to be defined, along with geometrical parameters as center, eulers (orientation), l, (sidelength)...

s.source = 'crop.rec';
s.center = 'center';
s.l = [1000,1000];
s.eulers =  'z';
s.fetchData();

The slice depictor object

We first create a figure with and empty axis </tt> f = figure; haxis = gca();hold on;

Empty matlab figure with an empty axis.

Here, f are handles that will be used later to direct the graphical output to our figure.

Now, we initialize a depiction object associated with the slice s sz = dpktomo.volume.slices.SliceGraphic(s); Note that no graphical output has been created yet. We first inform the object sz in which axis it is to be created.

sz.axis.h = haxis;

and then create the slice in the available axis.

sz.create();

If the figure is below other windows in your system you can rise it through

shg;

or

figure(f);

We can change the angle of view with the rotation icon or programmatically: view([-38,60]);

View of the slice with the viewing perspective ([-38,60]).