Inherits from
- AbstractDataSource: enthought.chaco.abstract_data_source.AbstractDataSource
Attributes
- data
Holds the grid data that forms the image. The shape of the array is (N, M, D) where:
- D is 1, 3, or 4.
- N is the length of the y-axis.
- M is the length of the x-axis.
Thus, data[0,:,:] must be the first row of data. If D is 1, then the array must be of type float; if D is 3 or 4, then the array must be of type uint8.
NOTE: If this ImageData was constructed with a transposed data array, then internally it is still transposed (i.e., the x-axis is the first axis and the y-axis is the second), and the data array property might not be contiguous. If contiguousness is required and calling copy() is too expensive, use the raw_value attribute. Also note that setting this trait does not change the value of transposed, so be sure to set it to its proper value when using the same ImageData instance interchangeably to store transposed and non-transposed data.
data = Property(ImageTrait)
- raw_value
A read-only attribute that exposes the underlying array.
raw_value = Property(ImageTrait)
- transposed
Is raw_value, the actual underlying image data array, transposed from value? (I.e., does the first axis correspond to the x-direction and the second axis correspond to the y-direction?)
Rather than transposing or swapping axes on the data and destroying continuity, this class exposes the data as both value and raw_value.
transposed = Bool(False)
- value_depth
Depth of the values at each i,j. Values that are used include:
- 3: color images, without alpha channel
- 4: color images, with alpha channel
value_depth = Int(1)
Inherited from base classes
Traits
- dimension
The dimensionality of the data.
dimension = ReadOnly(DimensionTrait('image'))
Inherited from base classes
Method summary
- fromfile(cls, filename)
- get_array_bounds(self)
- get_bounds(self)
- get_data(self)
- get_height(self)
- get_size(self)
- get_width(self)
- is_masked(self)
- set_data(self, data)
Inherited from base classes
- __deepcopy__(self, memo)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- fromfile(cls, filename)
Alternate constructor to create an ImageData from an image file on disk. 'filename' may be a file path or a file object.
- get_array_bounds(self)
Always returns ((0, width), (0, height)) for x-bounds and y-bounds.
- get_bounds(self)
Returns the minimum and maximum values of the data source's data.
Implements AbstractDataSource.
- get_data(self)
Returns the data for this data source.
Implements AbstractDataSource.
- get_height(self)
Returns the shape of the y-axis.
- get_size(self)
get_size() -> int
Implements AbstractDataSource.
- get_width(self)
Returns the shape of the x-axis.
- is_masked(self)
is_masked() -> False
Implements AbstractDataSource.
- set_data(self, data)
Sets the data for this data source.
Parameters
- data : array
- The data to use.