ImageFileCache¶
-
MacroModule
¶ authors Felix Patzelt
,Jan-Martin Kuhnigk
package FMEwork/ReleaseMeVis
definition ImageFileCache.def see also MemoryCache
,ImageSave
,ImageLoad
keywords open
,input
,data
,load
,memory
,cache
,caching
,ram
,global
,cache
,memory
,buffer
,file
,FileCache2
,ImageCache
Purpose¶
The ImageFileCache macro can be used to buffer an image in a cache file on the hard disk (e.g. in the temp directory). This makes it possible to simply replace memory consuming MemCache modules with the ImageCache macro.
Usage¶
Connect an input image. Select the required update mode. The cached picture is available on the output connector.
Details¶
The cache files are stored in the directory provided by MLAB.getTmpDir()
and are named “cache” + uniquenumber + ext (ext = “.dcm” or “.tif”). Beside using files, there is one difference to the behavior of MemoryCache
: a new file is created once the cache is updated and the old file is deleted. This makes it possible to use ImageFileCache
in loops that incrementally change.
When clear is pressed, the module is deleted, the network closed, or MeVisLab is normally terminated, the current cache file is automatically deleted from the disk.
Parameter Fields¶
Field Index¶
autoDeleteCacheFile : Bool |
Custom Path : String |
Update : Trigger |
Bypass cache : Bool |
Duration : Float |
Use custom directory : Bool |
Cache file is valid : Bool |
Enable output : Bool |
Use custom name : Bool |
Cache Update Mode : Enum |
File Name : String |
|
Clear : Trigger |
forceDeleteCacheFile : Trigger |
|
Create if necessary : Bool |
Output is valid : Bool |
|
Create renamed file on failed overwrite : Bool |
Overwrite existing files : Bool |
|
Custom Name : String |
progress : Float |
Visible Fields¶
Cache file is valid¶
-
name:
cacheValid
, type:
Bool
, persistent:
no
¶ Indicates if the current cache file is valid (output only)
Output is valid¶
-
name:
outputValid
, type:
Bool
, persistent:
no
, deprecated name:
valid
¶ Indicates if the current output is valid (output only)
Cache Update Mode¶
-
name:
updateMode
, type:
Enum
, default:
AutoUpdate
¶ Select if you want to automatically or manually update the cache or to invalidate the cache once the input image has changed (default: auto).
Values:
Title | Name |
---|---|
Off | Off |
Auto Update | AutoUpdate |
Auto Clear | AutoClear |
Enable output¶
-
name:
enableOutput
, type:
Bool
, default:
TRUE
¶ If disabled, the output is invalidated independent from the cache content or the bypass setting (default: on).
Bypass cache¶
-
name:
bypass
, type:
Bool
, default:
FALSE
¶ If enabled, the input is directly relayed to the output, bypassing a possibly existing cache file (default: off).
Overwrite existing files¶
-
name:
overwrite
, type:
Bool
, default:
FALSE
¶ If enabled, the cache file name is not modified when a file already exists. It is still possible to use the module in a loop (as long as the file is not locked by another module or application), since internally, a temp file will be created in the same directory first before deleting the old file and renaming the temp file to the desired file name (default: off).
Create renamed file on failed overwrite¶
-
name:
createNewFileIfOverwriteFailed
, type:
Bool
, default:
FALSE
¶ If ‘overwrite’ is on and the target file already exists, but cannot be overwritten for whatever reason (possibly because the file is locked), the cache update fails if this flag is disabled. If this flag is enabled, the module falls back to non-overwrite mode and saves the cache file under some unique name (default: off).
Create if necessary¶
-
name:
createNewDirIfNotExisting
, type:
Bool
, default:
TRUE
¶ Create new directory if not previously existing. Note that the created directory will not be removed on ‘clear cache’. If not checked and the custom path is invalid, the default temp directory is selected.
Use custom directory¶
-
name:
useCustomPath
, type:
Bool
, default:
FALSE
¶ Enable to use a user-defined path for the cache file storage. If disabled, the user’s system temp directory is used (default: off).
Custom Path¶
-
name:
customPath
, type:
String
¶ User-defined path for the cache file storage (used if
Use custom directory
is enabled)
Use custom name¶
-
name:
useCustomName
, type:
Bool
, default:
FALSE
¶ Enable to use a user-defined name for the cache file. If disabled, ‘cache’ is used (default: off).
Custom Name¶
-
name:
customName
, type:
String
, default:
cache
¶ User-defined name for the cache file (used if
Use custom name
is enabled)