Package topo :: Package pattern :: Module image :: Class FileImage
[hide private]
[frames] | no frames]

Class FileImage

source code


2D Image generator that reads the image from a file.

The image at the supplied filename is converted to grayscale if it is not already a grayscale image. See Image's Image class for details of supported image file formats.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
Create the last_filename attribute, used to hold the last filename.
source code
 
_get_image(self, p)
If necessary as indicated by the parameters, get a new image, assign it to self._image and return True.
source code

Inherited from GenericImage: __getstate__, __setstate__, function

Inherited from base.patterngenerator.PatternGenerator: __call__

Inherited from param.parameterized.Parameterized: __repr__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, set_default, set_dynamic_time_fn, set_param, state_pop, state_push, verbose, warning

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  filename = param.Filename(default= 'images/ellen_arthur.pgm', ...
File path (can be relative to Topographica's base path) to a bitmap image.
  name = <param.parameterized.String object at 0xb58996c>
String identifier for this object.

Inherited from GenericImage: aspect_ratio, cache_image, pattern_sampler, size

Inherited from base.patterngenerator.PatternGenerator: bounds, mask, mask_shape, offset, orientation, output_fns, position, scale, x, xdensity, y, ydensity

Inherited from param.parameterized.Parameterized: print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 
Create the last_filename attribute, used to hold the last filename. This allows reloading an existing image to be avoided.
Overrides: object.__init__

_get_image(self, p)

source code 
If necessary as indicated by the parameters, get a new image, assign it to self._image and return True. If no new image is needed, return False.
Overrides: GenericImage._get_image

Class Variable Details [hide private]

filename

File path (can be relative to Topographica's base path) to a bitmap image. The image can be in any format accepted by PIL, e.g. PNG, JPG, TIFF, or PGM.
Value:
param.Filename(default= 'images/ellen_arthur.pgm', precedence= 0.9, doc= """
        File path (can be relative to Topographica's base path) to a bitmap image.
        The image can be in any format accepted by PIL, e.g. PNG, JPG, TIFF, or PG\
M.
        """)