These are modules that are not central to the functioning of MorphoCut, but are nevertheless useful in its application context.
Read and write EcoTaxa archives.
“EcoTaxa is a web application dedicated to the visual exploration and the taxonomic annotation of images that illustrate the beauty of planktonic biodiversity.”
Stream Read an archive of images and metadata that is importable to EcoTaxa.
archive_fn (str, Variable) – Location of the archive file.
img_rank (int, Variable, or a tuple thereof, optional) – One or more image ranks.
(image, meta) – A tuple of image(s) and metadata.
To read multiple image ranks, provide a tuple of ints as
img_rank. The first output will then be a tuple of images.
The TSV file needs at least an
img_file_namecolumn that provides the name of the image file. Other columns are read from
The TSV file MAY contain a row of types after the header (
"[f]"for numeric columns,
with Pipeline() as p: image, meta = EcotaxaReader("path/to/archive.zip") p.transform_stream()
EcotaxaWriter(archive_fn, fnames_images, meta, meta_fn='ecotaxa_export.tsv', store_types=True)[source]¶
Create an archive of images and metadata that is importable to EcoTaxa.
archive_fn (str) – Location of the output file.
fnames_images (Tuple, Variable, or a list thereof) – Tuple of
(filename, image)or a list of such tuples.
filenameis the name in the archive.
imageis a NumPy array. The file extension has to be one of
".gif"to meet the specifications of EcoTaxa.
meta (Mapping or Variable) – Metadata to store in the TSV file.
meta_fn (str, optional) – TSV file. Must start with
store_types (bool, optional) – Whether to add a row with types after the header. Defaults to True, according to EcoTaxa’s specifications.
If multiple images are provided,
image_namemust be tuples of the same length.
The TSV file will have the following columns by default:
img_file_name: Name of the image file (including extension)
img_rank: Rank of image to be displayed. Starts at 1.
Other columns are read from
with Pipeline() as pipeline: image_fn = ... image = ImageReader(image_fn) meta = ... # Calculate some meta-data EcotaxaWriter("path/to/archive.zip", (image_fn, image), meta) pipeline.transform_stream()
Feature calculation like in ZooProcess.
Zooprocess is a suite of routines in ImageJ macro language for Plankton image analysis.
CalculateZooProcessFeatures(regionprops, meta=None, prefix=None)[source]¶
Calculate descriptive features similar to ZooProcess using
regionprops (RegionProperties or Variable) –
RegionPropertiesinstance returned by
meta (dict or Variable, optional) – Meta-data dictionary to update.
prefix (str or Variable, optional) – Prefix for all keys.
with Pipeline() as p: image = ... mask = ... regionprops = FindRegions(mask, image) features = CalculateZooProcessFeatures(regionprops)