@@ -451,16 +451,20 @@ def __str__(self):
451
451
def get_data (self , caching = 'fill' ):
452
452
""" Return image data from image with any necessary scalng applied
453
453
454
- If the image data is an array proxy ( an object that knows how to load
455
- the image data from disk) then the default behavior (`caching` ==
456
- "fill") is to read the data from the proxy, and store in an internal
457
- cache. Future calls to ``get_data `` will return the cached array.
454
+ The image ``dataobj`` property can be an array proxy or an array. An
455
+ array proxy is an object that knows how to load the image data from
456
+ disk. An image with an array proxy ``dataobj`` is a *proxy image*; an
457
+ image with an array in ``dataobj `` is an * array image* .
458
458
459
- Once the data has been cached and returned from an image array proxy,
460
- if you modify the returned array, you will also modify the cached
461
- array (because they are the same array). Regardless of the `caching`
462
- flag, this is always true of an in-memory image (where the image data
463
- is an array rather than an array proxy).
459
+ The default behavior for ``get_data()`` on a proxy image is to read the
460
+ data from the proxy, and store in an internal cache. Future calls to
461
+ ``get_data`` will return the cached array. This is the behavior
462
+ selected with `caching` == "fill"`.
463
+
464
+ Once the data has been cached and returned from an array proxy, if you
465
+ modify the returned array, you will also modify the cached array
466
+ (because they are the same array). Regardless of the `caching` flag,
467
+ this is always true of an array image.
464
468
465
469
Parameters
466
470
----------
@@ -494,19 +498,17 @@ def get_data(self, caching='fill'):
494
498
data. Images that have been loaded from files usually do not load the
495
499
array data from file immediately, in order to reduce image load time
496
500
and memory use. For these images, ``dataobj`` is an *array proxy*; an
497
- object that knows how to load the image array data from file. Images
498
- with an array proxy ``dataobj`` are called *proxy images*. In contrast,
499
- images created directly from numpy arrays carry a simple reference to
500
- their array data in ``dataobj``. These are *in-memory images*.
501
+ object that knows how to load the image array data from file.
501
502
502
503
By default (`caching` == "fill"), when you call ``get_data`` on a
503
504
proxy image, we load the array data from disk, store (cache) an
504
505
internal reference to this array data, and return the array. The next
505
506
time you call ``get_data``, you will get the cached reference to the
506
507
array, so we don't have to load the array data from disk again.
507
508
508
- In-memory images are already in memory, so there is no benefit to
509
- caching, and the `caching` keywords have no effect.
509
+ Array images have a ``dataobj`` property that already refers to an
510
+ array in memory, so there is no benefit to caching, and the `caching`
511
+ keywords have no effect.
510
512
511
513
For proxy images, you may not want to fill the cache after reading the
512
514
data from disk because the cache will hold onto the array memory until
@@ -518,7 +520,7 @@ def get_data(self, caching='fill'):
518
520
the cache full and returns the cached array reference.
519
521
520
522
The cache can effect the behavior of the image, because if the cache is
521
- full, or you have an in-memory image, then modifying the returned array
523
+ full, or you have an array image, then modifying the returned array
522
524
will modify the result of future calls to ``get_data()``. For example
523
525
you might do this:
524
526
0 commit comments