You are reading the documentation for version 1.6 of OpenStructure. You may also want to read the documentation for: 1.1 1.2 1.3 1.4 1.5 devel
For the course of this tutorial, we assume that you have DNG up and running.
Loading Images and Density Maps¶
OpenStructure features an
To load a density map, type
map = io.LoadImage('/path/to/examples/code_fragments/map/1ppt.map')
This will load the fragment density map from the specified file ‘fragment.map’ and store the result in map.
Now let’s inspect what we just loaded:
print map.GetPixelSampling(), map.GetSize()
We can see that the sampling is set to 1.0 Angstrom in all three dimensions. The loaded map is an instance of
Manipulating Images and Density Maps¶
from ost.img import alg
map_filtered = map.Apply(alg.LowPassFilter(3.0))
The filtered map is stored in a new variable called map_filtered. A complete list of algorithms is available on the img.alg - Image Processing Algorithms page.
Displaying Images and Density Maps¶
Now that we have a filtered map it’s time to have a look at it. There are fundamentally two ways to visualize 3-dimensional density maps. One is by drawing isocontour surfaces. These are conceptually similar to contour lines used in cartography: every point on an isosurface has the same density value. Isosurfaces are easy to create in OpenStructure:
go = gfx.MapIso("filtered", map_filtered,0.5) scene.Add(go)
The other way to visualize a 3-dimensional map is by showing one 2-dimensional density slice at a time, allowing the user to move through the slices. In OpenStructure this is achieved using a DataViewer). A DataViewer showing the filtered map is created using the following command:
This command displays a panel showing one slice of the density map lying on a particular (x,y) plane in the coordinate reference system. The z and x keys can be used to move to slices lying at a lower or higher coordinate along the z axis, allowing the examination of the full 3-dimensional volume.
Continue with part three of the tutorial.
Enter search terms or a module, class or function name.
You are here