ImageCacheForNetworkLoops¶
-
MacroModule
¶ genre File
author Jan-Martin Kuhnigk
package FMEstable/ReleaseMeVis
definition ImageCacheForNetworkLoops.def see also ImageCache
,PageCache
,ImageFileCache
,MLImageFormatFileCache
,MemoryCache
keywords File
,Image
,Page
,Memory
,Cache
,Buffer
,Loop
,Iterati
,Accumul
Purpose¶
The ImageCacheForNetworkLoops module works exactly like the ImageCache
module except that it keeps its output valid during Update from Loop
, supporting network loops (i. e. the output being connected to its input, see example network).
The loop support comes at a price, namely additional memory/time consumption (internally, a temporary secondary cache of the same type is used), and no auto-update/auto-clear support.
Thus:
- Use this module (ImageCacheForNetworkLoops) if you have a loop in your network
- Use
ImageCache
in all other cases
Usage¶
Select any caching mode via the field In Mode
, then initialize the cache via the inInitializationImage
input. Then connect the output to your image processing pipeline that you would like to process iteratively, and then to inLoopImage
. Press Update from Loop
for each processing step.
Input Fields¶
Output Fields¶
Parameter Fields¶
Field Index¶
(Re-)Initialize : Trigger |
In Mode : Enum |
[] : Trigger |
Last Update Time : Double |
Cached Image Extent : Vector6 |
Preserve Cache Files : Bool |
Cached Image File: : String |
Status Code : Enum |
Cached Image Type : String |
Status Message : String |
Clear : Trigger |
Update from Loop : Trigger |
Custom Cache File Name : String |
Use Automatic Filename : Bool |
Has Valid Output : Bool |
Visible Fields¶
(Re-)Initialize¶
-
name:
initialize
, type:
Trigger
¶ Initializes the cache from the left input (
inInitializationImage
). If successful, the cached image will be made available at the output. After the initialization attempt (no matter if successful or not), the field[]
will be triggered.
Update from Loop¶
-
name:
update
, type:
Trigger
¶ Initiates update of the cache from the right input (
inLoopImage
). During the update, the output image atoutImage
will remain valid, so that it is allowed and possible to iteratively change the image in an image processing loop as in the example network. If the update is successful, the cached image will be made available at the output. After an update (no matter if successful or not), the field[]
will be triggered.
In Mode¶
-
name:
inMode
, type:
Enum
, default:
PageCache
¶ Caching mode
Values:
Title | Name | Description |
---|---|---|
Memory Caching (Pages) | PageCache | Cache the input image in memory internally using the PageCache module. That module requests the entire input image and then locks the ML image cache pages until Clear is pressed. |
Memory Caching (Memory Image) | MemoryCache | Cache the input image in memory internally using the MemoryCache module. That module requests the entire input image and then stores it in a so-called MemoryImage (see also MemoryImage Concept ), which in contrast to PageCache mode requires a free memory chunk of the entire image size. |
File Cache (MLImageFormat LZ4) | FileCache | Cache the input image in memory internally using the MLImageFormatFileCache module. That module requests the entire input image and then stores it in a temporary file using fast LZ4 compression (if available on your system). |
Use Automatic Filename¶
-
name:
inFileCache_useAutoFilename
, type:
Bool
, default:
TRUE
¶ If enabled, no cache file prefix or name has to be provided, the module automatically selects a non-existing one in your temp folder.
Custom Cache File Name¶
-
name:
inFileCache_customFilenameBase
, type:
String
, deprecated name:
inFileCache\_filenameBase
¶ FileCache mode only: Prefix (path + filename prefix) for the cache file (used if
Use Automatic Filename
is off). If you provide a path without any file prefix, you have to append a path separator (“/”) at the end to indicate that.
Preserve Cache Files¶
Cached Image Extent¶
-
name:
outCachedImageExtent
, type:
Vector6
, default:
0 0 0 0 0 0
¶ Displays the image extent of the currently cached image.
Cached Image Type¶
-
name:
outCachedImageType
, type:
String
, default:
unknown
¶ Displays the voxel type of the currently cached image.
Cached Image File:¶
-
name:
outFileCache_cachedImageFilename
, type:
String
, default:
n/a
¶ File name of the cached image if in FileCache mode. If invalid, the value is “n/a”.
Status Code¶
-
name:
statusCode
, type:
Enum
, persistent:
no
¶ Reflects module’s status (successful or failed computations) as one of some predefined enumeration values.
Values:
Title | Name |
---|---|
Ok | Ok |
Busy | Busy |
Invalid input image | InvalidInputObject |
Invalid input parameter | InvalidInputParameter |
Internal error | InternalError |
Last Update Time¶
-
name:
updateTime_s
, type:
Double
, persistent:
no
¶ Displays the time required for caching the input image (in seconds).
[]¶
-
name:
updateDone
, type:
Trigger
, persistent:
no
¶ Notifies that an initialization or update was performed (check status interface fields to identify success or failure).