From 9c70dfa1c6ae9c53aae92226722ce47f81c3d1c6 Mon Sep 17 00:00:00 2001
From: andreas <andreas@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Tue, 13 Apr 2010 16:16:52 +0000
Subject: [PATCH] added some documentation for the img module

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1986 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 website/raw/docs/index.mkdown          |  5 ++
 website/raw/docs/tut/imgalg.mkdown     |  6 +-
 website/raw/docs/tut/imgalglist.mkdown | 80 ++++++++++++++++++++++++++
 website/raw/docs/tut/intro.mkdown      | 55 ++++++++++++++++++
 website/raw/docs/tutorials.mkdown      |  2 +
 5 files changed, 147 insertions(+), 1 deletion(-)
 create mode 100644 website/raw/docs/tut/imgalglist.mkdown

diff --git a/website/raw/docs/index.mkdown b/website/raw/docs/index.mkdown
index cffa08dc5..d678a7c3a 100644
--- a/website/raw/docs/index.mkdown
+++ b/website/raw/docs/index.mkdown
@@ -28,6 +28,11 @@ The following links provide direct access to the API documentation.
 
  * dox[ost::gfx::Scene|Scene] | [Graphical Entity](dox/html/gfx_ent.html)
 
+### Image Manipulation
+
+
+ * dox[ost::img::ImageHandle|ImageHandle] 
+
 ### Global Data Structure Index
  * [Data Structure index](dox/html/classes.html)
 
diff --git a/website/raw/docs/tut/imgalg.mkdown b/website/raw/docs/tut/imgalg.mkdown
index 82918fcfd..8b2d4eeeb 100644
--- a/website/raw/docs/tut/imgalg.mkdown
+++ b/website/raw/docs/tut/imgalg.mkdown
@@ -46,7 +46,11 @@ Similar to ModOP, except that no information can be stored beyond the
 application of the algorithm itself. Example: rotation around an arbitrary angle. Implemented
 as dox[ost::img::ConstModOPAlgorithm|ConstModOPAlgorithm].
 
-## Custom Algorithms
+## Implemented algorithms
+
+A list of implemented algorithms can be found [here](docs/tut/imgalglist.html)
+
+## Custom Algorithms (for developers)
 
 Writing custom algorithms for the 'img' module is fairly straightforward, in view of the fact that the final
 algorithm will integrate seamlessly into the build environment, both at the C++ and Python runtime
diff --git a/website/raw/docs/tut/imgalglist.mkdown b/website/raw/docs/tut/imgalglist.mkdown
new file mode 100644
index 000000000..cdcfcb171
--- /dev/null
+++ b/website/raw/docs/tut/imgalglist.mkdown
@@ -0,0 +1,80 @@
+title: List of image algorithms
+
+[TOC]
+
+# General Algorithms
+
+* dox[ost::img::alg::Clear|Clear]
+* dox[ost::img::alg::Fill|Fill]
+* dox[ost::img::alg::Stat|Stat]
+* dox[ost::img::alg::StatMinMax|StatMinMax]
+* dox[ost::img::alg::Negate|Negate]
+* dox[ost::img::alg::Polar|Polar]
+* dox[ost::img::alg::Randomize|Randomize]
+* dox[ost::img::alg::AutoCorrelate|AutoCorrelate]
+* dox[ost::img::alg::Conjugate|Conjugate]
+* dox[ost::img::alg::Convolute|Convolute]
+* dox[ost::img::alg::Correlate|Correlate]
+* dox[ost::img::alg::CrossCorrelate|CrossCorrelate]
+* dox[ost::img::alg::HighestPeakSearch3D|HighestPeakSearch3D]
+* dox[ost::img::alg::Histogram|Histogram]
+* dox[ost::img::alg::RsCrosscorr|RsCrosscorr]
+* dox[ost::img::alg::LineAverage|LineAverage]
+* dox[ost::img::alg::LineIterator|LineIterator]
+
+# Fourier Transforms
+
+* dox[ost::img::alg::FFT|FFT]
+* dox[ost::img::alg::DFT|DFT]
+* dox[ost::img::alg::PowerSpectrum|PowerSpectrum]
+
+
+# Transformations
+
+* dox[ost::img::alg::Mirror|Mirror]
+* dox[ost::img::alg::Shift|Shift]
+* dox[ost::img::alg::Transform|Transform]
+* dox[ost::img::alg::FractionalShift|FractionalShift]
+* dox[ost::img::alg::DiscreteShrink|DiscreteShrink]
+
+
+# Masking
+
+* dox[ost::img::alg::MaskImage|MaskImage]
+* dox[ost::img::alg::SmoothMaskImage|SmoothMaskImage]
+
+
+# Normalizer
+
+* dox[ost::img::alg::LinearNormalizer|LinearNormalizer]
+* dox[ost::img::alg::LogNormalizer|LogNormalizer]
+* dox[ost::img::alg::ODNormalizer|ODNormalizer]
+
+
+# Thresholding
+
+* dox[ost::img::alg::ClipMinMax|ClipMinMax]
+* dox[ost::img::alg::DensitySlice|DensitySlice]
+* dox[ost::img::alg::Threshold|Threshold]
+* dox[ost::img::alg::LocalSigmaThreshold|LocalSigmaThreshold]
+
+
+# General filters
+
+* dox[ost::img::alg::Anisotropic|Anisotropic]
+* dox[ost::img::alg::Gaussian|Gaussian]
+* dox[ost::img::alg::GaussianGradientMagnitude|GaussianGradientMagnitude]
+* dox[ost::img::alg::GaussianLaplacian|GaussianLaplacian]
+
+
+# High/low pass filters
+
+* dox[ost::img::alg::LowPassFilter|LowPassFilter]
+* dox[ost::img::alg::HighPassFilter|HighPassFilter]
+* dox[ost::img::alg::GaussianLowPassFilter|GaussianLowPassFilter]
+* dox[ost::img::alg::GaussianHighPassFilter|GaussianHighPassFilter]
+* dox[ost::img::alg::FermiLowPassFilter|FermiLowPassFilter]
+* dox[ost::img::alg::FermiHighPassFilter|FermiHighPassFilter]
+* dox[ost::img::alg::ButterworthLowPassFilter|ButterworthLowPassFilter]
+* dox[ost::img::alg::ButterworthHighPassFilter|ButterworthHighPassFilter]
+
diff --git a/website/raw/docs/tut/intro.mkdown b/website/raw/docs/tut/intro.mkdown
index 5f202c360..fe654c1fc 100644
--- a/website/raw/docs/tut/intro.mkdown
+++ b/website/raw/docs/tut/intro.mkdown
@@ -184,3 +184,58 @@ to save the full view. To save only the backbone atoms, we can first select the
      ::::python
      io.SavePDB(fragment.Select('aname=CA,C,N,O'), 'backbone.pdb')
 
+
+## Loading  images and density maps
+
+Openstructure features a img module that is dedicated to the manipulation of images / density maps. The images or density maps can either be one-, two- or three-dimensional. The most common formats used in x-ray and electron crystallography and atomic force microscope are supported in addition to several general purpose image formats. See (feature list)[feature_list.html] for details.
+The img module was originally developed as part of the Image Processing Library & Toolbox IPLT. More documentation and examples can also be found on the (IPLT website)[http://www.iplt.org].
+
+Before using the load functionality for an image, you have to import the io module. This is done by typing the following command in the python shell:
+
+    from ost import io
+
+To load a density map, type
+
+    fragment_map=io.LoadImage('OST_INSTALLATION_PATH/share/openstructure/examples/misc/fragment.map')
+
+This will load the fragment density map from the specified file 'fragment.map' and store the result in fragment_map.
+
+Now let's inspect what we just loaded:
+
+    print fragment_map.GetSampling()
+    # todo add more
+
+We can see that the sampling is set to 1 Angstroem in all three dimensions.
+
+## Manipulating  images and density maps
+
+The algorithms used for manipulation of an image are found in the img module. Therefore before using an algorithm we first have to import the img module.
+
+    from ost import img
+
+
+The img module provides a wide range of algorithm to manipulate image data. Here for the example we use a LowPassFilter to restrict the resolution of the density map.
+
+    fragment_map_filtered=fragment_map.Apply(img.alg.LowPassFilter(3.0))
+
+The filtered map is stored in a new variable called fragment_map_filtered.
+
+
+## Displaying images and density maps
+
+
+Now that we have a filtered map it's time to have a look at it.
+
+todo: explain iso contouring
+
+    go=gfx.MapIso("filtered", fragment_map_filtered,0.5)
+    scene.Add(go)
+
+
+
+todo: explain data viewer
+
+    gui.CreateDataViewer(fragment_map_filtered)
+
+
+Are more detailed explanation of the img module can be found in the (tutorial section for images and density maps)[tut/imgintro.html].
diff --git a/website/raw/docs/tutorials.mkdown b/website/raw/docs/tutorials.mkdown
index 7cde7f8bb..11b73983f 100644
--- a/website/raw/docs/tutorials.mkdown
+++ b/website/raw/docs/tutorials.mkdown
@@ -25,3 +25,5 @@ title: Tutorials
 ## For Developers
  * [Expanding OpenStructure - Creating a New Module](docs/tut/newmodule.html)
  * [Using External Programs within OpenStructure](docs/tut/external.html)
+ * [Creating new algorithms for Images and Density Maps](docs/tut/imgalgdata.html)
+ * [Creating new image state algorithms](docs/tut/imgalgdistate.html)
-- 
GitLab