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

Class FileImage

source code

                                  object --+            
                                           |            
base.parameterizedobject.ParameterizedObject --+        
                                               |        
          base.patterngenerator.PatternGenerator --+    
                                                   |    
                                        GenericImage --+
                                                       |
                                                      FileImage

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 PIL's Image class for details of supported image file formats.



Nested Classes [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
Create the last_filename and last_wiof attributes, used to hold the last filename and last whole_image_output_function.
source code
 
_get_image(self, params)
Get a new image, if necessary.
source code

Inherited from GenericImage: __getstate__, __setstate__, function

Inherited from base.patterngenerator.PatternGenerator: __call__

Inherited from base.parameterizedobject.ParameterizedObject: __repr__, __str__, as_uninitialized, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, verbose, warning

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

Class Methods [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: params, print_param_defaults

Class Variables [hide private]
  filename = Filename(default= 'examples/ellen_arthur.pgm', prec...
File path (can be relative to Topographica's base path) to a bitmap image.

Inherited from GenericImage: aspect_ratio, output_fn, pattern_sampler_type, size, size_normalization, whole_image_output_fn

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

Inherited from base.parameterizedobject.ParameterizedObject: name, print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 

Create the last_filename and last_wiof attributes, used to hold the last filename and last whole_image_output_function.

This allows reloading an existing image to be avoided.

Overrides: base.parameterizedobject.ParameterizedObject.__init__

_get_image(self, params)

source code 

Get a new image, if necessary.

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
(inherited documentation)

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:
Filename(default= 'examples/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.
        """)