Classes/Modules

Images

class Images.Images(folder_name, image_file_ext=['tif', 'tiff'])[source]

This class is used as collection of images which will be loaded from a given folder name

count()
count_update(count)
item(i)[source]

image item

Image

class Image.Image(full_name)[source]

Class image containing the single image obtained from the collection Images

Example:
>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
file_name()[source]

file_name(…) return the full file name of the image

regions()[source]

regions(…) returns the Object Regions

>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
>>> regs = img.Regions()

Regions

class Regions.Regions(obj_regions)[source]

This class represent a collection of regions: segmented image elements It cannot be instanced directly. It is returned from the object Image through the function Regions(…)

Example:
>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
>>> regs = img.Regions()
count()
count_update(count)
get_features(features, class_value=None, class_name='class_name')[source]

get_features(…) returns a table with all values for the property names given in input, and supplies an additional parameter for feature classification

Parameters:
  • features (List) – list of property/measure names (e.g, ‘area’, ‘centroid’, etc )
  • class_value (int, string (default=None)) – classification label
Returns:

table cointaining all property values (columns) for all elements in the regions object (rows)

Return type:

Pandas.DataFrame

Example:
>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
>>> regs = img.Regions()
>>> df = regs.get_features(['label', 'area','perimeter', 'centroid'], class_value=1)
item(i)[source]

Item(..) returns the i-th image element of the regions.

Parameters:i (int) – the i-th element of the collection region
Returns:Region
Return type:object
Example:
>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
>>> regs = img.Regions()
>>> reg = regs.item(1)
prop_values(prop_name)[source]

prop_values(…) returns the values of the specified property/measure name (e.g., ‘area’) for all image elements contained in the object Regions. For a list of property names refer to “regionprops <http://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops>”_.

Parameters:prop_name (string) – name of the property to measure (e.g, ‘area’)
Returns:values of the property name in input
Return type:List
Example:
>>> import image_features_extraction as fe
>>> imgs = fe.Images(folder_name)
>>> img = imgs.item(1)
>>> regs = img.Regions()
>>> areas = regs.prop_values('area')

Region

class Region.Region(obj_region)[source]
area()[source]