PYME.recipes.base module

class PYME.recipes.base.Add(parent=None, **kwargs)

Bases: PYME.recipes.base.ArithmaticFilter

Add two images

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data0, data1, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data0, data1, chanNum, i, image0)
class PYME.recipes.base.ArithmaticFilter(parent=None, **kwargs)

Bases: PYME.recipes.base.ModuleBase

Module with two image inputs and one image output

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
completeMetadata(im)
execute(namespace)
filter(image0, image1)
class PYME.recipes.base.BinaryOr(parent=None, **kwargs)

Bases: PYME.recipes.base.ArithmaticFilter

Perform a bitwise OR on images

Notes

This is actually implemented as \((A + B) > .5\)

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data0, data1, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data0, data1, chanNum, i, image0)
class PYME.recipes.base.Divide(parent=None, **kwargs)

Bases: PYME.recipes.base.ArithmaticFilter

Divide two images

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data0, data1, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data0, data1, chanNum, i, image0)
class PYME.recipes.base.ExtractChannel(parent=None, **kwargs)

Bases: PYME.recipes.base.ModuleBase

Extract one channel from an image

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

default_traits_view()
execute(namespace)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
execute(namespace)
class PYME.recipes.base.Filter(parent=None, **kwargs)

Bases: PYME.recipes.base.ModuleBase

Module with one image input and one image output

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

completeMetadata(im)
default_traits_view()
dsviewer_plugin_callback(dsviewer[, showGUI]) Implements a callback which allows this module to be used as a plugin for dsviewer.
execute(namespace)
filter(image)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
completeMetadata(im)
classmethod dsviewer_plugin_callback(dsviewer, showGUI=True, **kwargs)

Implements a callback which allows this module to be used as a plugin for dsviewer.

Parameters:

dsviewer : PYME.DSView.dsviewer.DSViewFrame instance

This is the current DSViewFrame instance. The filter will be run with the associated .image as input and display the output in a new window.

showGUI : bool

Should we show a GUI to set parameters (generated by calling configure_traits()), or just run with default parameters.

**kwargs : dict

Optionally, provide default values for parameters. Makes most sense when used with showGUI = False

execute(namespace)
filter(image)
class PYME.recipes.base.Invert(parent=None, **kwargs)

Bases: PYME.recipes.base.Filter

Invert image

This is implemented as \(B = (1-A)\). As such the results only really make sense for binary images / masks and for images which have been normalized such that the maximum value is 1.

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
dsviewer_plugin_callback(dsviewer[, showGUI]) Implements a callback which allows this module to be used as a plugin for dsviewer.
execute(namespace)
filter(image)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data, chanNum, i, image0)
class PYME.recipes.base.JoinChannels(parent=None, **kwargs)

Bases: PYME.recipes.base.ModuleBase

Join multiple channels to form a composite image

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

default_traits_view()
execute(namespace)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
execute(namespace)
class PYME.recipes.base.ModuleBase(parent=None, **kwargs)

Bases: traits.has_traits.HasTraits

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

default_traits_view()
execute(namespace) prototype function - should be over-ridden in derived classes
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
default_traits_view()
default_view
execute(namespace)

prototype function - should be over-ridden in derived classes

takes a namespace (a dictionary like object) from which it reads its inputs and into which it writes outputs

hide_in_overview
inputs
outputs
outputs_in_namespace(namespace)
pipeline_view
pipeline_view_min
remove_outputs()
trait_view(name=None, view_element=None)
class PYME.recipes.base.ModuleCollection(*args, **kwargs)

Bases: traits.has_traits.HasTraits

Attributes

inputs
module_outputs
outputs
pipeline_view

Methods

add_module(module)
dependancyGraph()
execute(**kwargs)
fromJSON(data)
fromMD(md)
fromYAML(data)
from_module_list(l)
get_cleaned_module_list()
invalidate_data()
loadInput(filename[, key]) Load input data from a file and inject into namespace
pruneDependanciesFromNamespace(keys_to_prune)
resolveDependencies()
reverseDependancyGraph()
save([context]) Find all OutputModule instances and call their save methods with the recipe context
toJSON()
toYAML()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
traits_init()
traits_inited([True])
update_from_module_list(l)
update_from_yaml(data)
add_module(module)
dependancyGraph()
execute(**kwargs)
classmethod fromJSON(data)
classmethod fromMD(md)
classmethod fromYAML(data)
classmethod from_module_list(l)
get_cleaned_module_list()
inputs
invalidate_data()
loadInput(filename, key='input')

Load input data from a file and inject into namespace

Currently only handles images (anything you can open in dh5view). TODO - extend to other types.

module_outputs
outputs
pipeline_view
pruneDependanciesFromNamespace(keys_to_prune)
resolveDependencies()
reverseDependancyGraph()
save(context={})

Find all OutputModule instances and call their save methods with the recipe context

Parameters:

context : dict

A context dictionary used to substitute and create variable names.

toJSON()
toYAML()
update_from_module_list(l)
update_from_yaml(data)
class PYME.recipes.base.Multiply(parent=None, **kwargs)

Bases: PYME.recipes.base.ArithmaticFilter

Multiply two images

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data0, data1, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data0, data1, chanNum, i, image0)
class PYME.recipes.base.Normalize(parent=None, **kwargs)

Bases: PYME.recipes.base.Filter

Normalize an image so that the maximum is 1

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
dsviewer_plugin_callback(dsviewer[, showGUI]) Implements a callback which allows this module to be used as a plugin for dsviewer.
execute(namespace)
filter(image)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data, chanNum, i, image0)
class PYME.recipes.base.NormalizeMean(parent=None, **kwargs)

Bases: PYME.recipes.base.Filter

Normalize an image so that the mean is 1

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
dsviewer_plugin_callback(dsviewer[, showGUI]) Implements a callback which allows this module to be used as a plugin for dsviewer.
execute(namespace)
filter(image)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data, chanNum, i, image0)
class PYME.recipes.base.OutputModule(parent=None, **kwargs)

Bases: PYME.recipes.base.ModuleBase

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

default_traits_view()
execute(namespace) Output modules be definition do nothing when executed - they act as a sink and implement a save method instead.
generate(namespace) Function to be called from within dh5view (rather than batch processing).
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
execute(namespace)

Output modules be definition do nothing when executed - they act as a sink and implement a save method instead.

generate(namespace)

Function to be called from within dh5view (rather than batch processing). Some outputs are ignored, in which case this function returns None.

Parameters:namespace
class PYME.recipes.base.Scale(parent=None, **kwargs)

Bases: PYME.recipes.base.Filter

Scale an image intensities by a constant

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
dsviewer_plugin_callback(dsviewer[, showGUI]) Implements a callback which allows this module to be used as a plugin for dsviewer.
execute(namespace)
filter(image)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data, chanNum, i, image0)
class PYME.recipes.base.Subtract(parent=None, **kwargs)

Bases: PYME.recipes.base.ArithmaticFilter

Subtract two images

Attributes

default_view
hide_in_overview
inputs
outputs
pipeline_view
pipeline_view_min

Methods

applyFilter(data0, data1, chanNum, i, image0)
completeMetadata(im)
default_traits_view()
execute(namespace)
filter(image0, image1)
outputs_in_namespace(namespace)
remove_outputs()
trait_items_event(event_trait,name,items_event)
trait_property_changed(...)
trait_view([name, view_element])
traits_init()
traits_inited([True])
applyFilter(data0, data1, chanNum, i, image0)
PYME.recipes.base.register_legacy_module(moduleName)

Permits a module to be accessed by an old name

PYME.recipes.base.register_module(moduleName)