---------------------------------------
--- Morphological Attribute Profile ---
---------------------------------------

Description
-----------
This routine computes an Attribute Profile (AP) of a 2D image as presented in [1]. 
An AP is an array of images resulting from filtering the input image with a sequence of morphological attribute filters.
The AP is composed by the concatenation of an attribute thinning and attribute thickening profile.
The attribute thinning (thickening) profile is generated by the sequential application of attribute thinning (thickening) filters with progressively relaxed criteria (i.e., progressively coarser effect on the image).
This approach leads to a increasing simplification of the input image obtained by removing either bright (in the thinning profile) or dark  (in the thickening profile) regions. Dark and bright with respect to the surrounding gray-level. This effect is due to the sequence of thresholds (lambdas) used by the filters.
The AP is composed by the concatenation of the attribute thickening profile computed in decreasing order (the coarser image is the first), the original input image, and the attribute thickening profile in increasing order.
Thus if N is the number of thresholds considered in the analysis, the AP will be composed by 2N+1 images.
For further information on APs please refer to [1].
The code computing the attribute profiles was implemented using the C++ library Olena 1.0 (available at http://www.lrde.epita.fr/cgi-bin/twiki/view/Olena/Olena100).


[1] 	M. Dalla Mura, J. A. Benediktsson, B. Waske, and L. Bruzzone, 
	"Morphological attribute profiles for the analysis of very high resolution images," 
	IEEE Transactions on Geoscience and Remote Sensing, vol.48, no.10, pp.3747-3762, Oct. 2010.


Installation
------------
Note: The routine is provided as precompiled mex file. Supported platforms are: Win32, Linux32, Linux64.

Include the directory containing the compiled mex file in a location where Matlab can find it.
For a quick test, set the folder as the Current Directory of Matlab.
For a more extensive use, it is suggested to include the folder in the Matlab search path (in Matlab, File->Set path->Add folder...).

Usage
-----

   AP = ATTRIBUTE_PROFILE(I, A, L)
   AP = ATTRIBUTE_PROFILE(I, A, L, C)
   AP = ATTRIBUTE_PROFILE(I, A, L, C, F)

 INPUT
     I:  2D input image. Data type supported: uint8, int8, uint16, int16, uint32, int32, uint64, int64.
     A:  Attribute type. String.
         Attribute supported:
             Area: 'a', 'area';
             Length of the diagonal of the bounding box: 'd', 'diagonal';
             Moment of inertia: 'i', 'inertia';
             Standard deviation: 's', 'std'.
     L:  Values of lambda. Array of double.
     C:  Connectivity. Scalar. Either 4 (default) or 8.
     F:  Filtering rule. String.
         Rules supported:
             Min: 'min' (default for attributes 'a', 'd');
             Max: 'max';
             Direct: 'direct';
             Sub: 'sub' (default for attributes 'i', 's').

 OUTPUT
     AP: Attribute Profile. Array of 2D images of the same data type of the input image.

--
 Version 1.0
 14 May 2010
 
 Mauro Dalla Mura - dallamura<at>disi.unitn.it
 
	Remote Sensing Laboratory
	Dept. of Information Engineering and Computer Science
	University of Trento
	
	Faculty of Electrical Engineering and Computer Science
	University of Iceland
