[frames] | no frames]

# Module measurements

source code

 Functions

 label(input, structure=None, output=None) Label an array of objects. source code

 find_objects(input, max_label=0) Find objects in a labeled array. source code

 sum(input, labels=None, index=None) Calculate the sum of the values of the array. source code

 mean(input, labels=None, index=None) Calculate the mean of the values of the array. source code

 variance(input, labels=None, index=None) Calculate the variance of the values of the array. source code

 standard_deviation(input, labels=None, index=None) Calculate the standard deviation of the values of the array. source code

 minimum(input, labels=None, index=None) Calculate the minimum of the values of the array. source code

 maximum(input, labels=None, index=None) Return the maximum input value. source code

 _index_to_position(index, shape) Convert a linear index to a position source code

 minimum_position(input, labels=None, index=None) Find the position of the minimum of the values of the array. source code

 maximum_position(input, labels=None, index=None) Find the position of the maximum of the values of the array. source code

 extrema(input, labels=None, index=None) Calculate the minimum, the maximum and their positions of the values of the array. source code

 center_of_mass(input, labels=None, index=None) Calculate the center of mass of of the array. source code

 histogram(input, min, max, bins, labels=None, index=None) Calculate a histogram of of the array. source code

 watershed_ift(input, markers, structure=None, output=None) Apply watershed from markers using a iterative forest transform algorithm. source code

 _broadcast(arr, sshape) Return broadcast view of arr, else return None. source code
 Variables
__package__ = `'ndimage'`

Imports: types, math, numpy, _ni_support, _nd_image, morphology

 Function Details

### label(input, structure=None, output=None)

source code

Label an array of objects.

The structure that defines the object connections must be symmetric. If no structuring element is provided an element is generated with a squared connectivity equal to one. This function returns a tuple consisting of the array of labels and the number of objects found. If an output array is provided only the number of objects found is returned.

### find_objects(input, max_label=0)

source code

Find objects in a labeled array.

The input must be an array with labeled objects. A list of slices into the array is returned that contain the objects. The list represents a sequence of the numbered objects. If a number is missing, None is returned instead of a slice. If max_label > 0, it gives the largest object number that is searched for, otherwise all are returned.

### sum(input, labels=None, index=None)

source code
```Calculate the sum of the values of the array.

:Parameters:
labels : array of integers, same shape as input
Assign labels to the values of the array.

index : scalar or array
A single label number or a sequence of label numbers of
the objects to be measured. If index is None, all
values are used where 'labels' is larger than zero.

Examples
--------

>>> input =  [0,1,2,3]
>>> labels = [1,1,2,2]
>>> sum(input, labels, index=[1,2])
[1.0, 5.0]

```

### mean(input, labels=None, index=None)

source code

Calculate the mean of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### variance(input, labels=None, index=None)

source code

Calculate the variance of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### standard_deviation(input, labels=None, index=None)

source code

Calculate the standard deviation of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### minimum(input, labels=None, index=None)

source code

Calculate the minimum of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### maximum(input, labels=None, index=None)

source code

Return the maximum input value.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### minimum_position(input, labels=None, index=None)

source code

Find the position of the minimum of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### maximum_position(input, labels=None, index=None)

source code

Find the position of the maximum of the values of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### extrema(input, labels=None, index=None)

source code
```Calculate the minimum, the maximum and their positions of the
values of the array.

The index parameter is a single label number or a sequence of
label numbers of the objects to be measured. If index is None, all
values are used where labels is larger than zero.

```

### center_of_mass(input, labels=None, index=None)

source code

Calculate the center of mass of of the array.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### histogram(input, min, max, bins, labels=None, index=None)

source code

Calculate a histogram of of the array.

The histogram is defined by its minimum and maximum value and the number of bins.

The index parameter is a single label number or a sequence of label numbers of the objects to be measured. If index is None, all values are used where labels is larger than zero.

### watershed_ift(input, markers, structure=None, output=None)

source code

Apply watershed from markers using a iterative forest transform algorithm.

Negative markers are considered background markers which are processed after the other markers. A structuring element defining the connectivity of the object can be provided. If none is provided an element is generated iwth a squared connecitiviy equal to one. An output array can optionally be provided.

 Generated by Epydoc 3.0.1 on Thu Jan 13 11:20:12 2011 http://epydoc.sourceforge.net