Purpose

The module MLImageFormatFileCache stores the content of a connected input image in a cache file and passes it to the output.

This is possible even if the input connection is disconnected or invalidated after caching. Thus it is comparable to the MemCache module which caches the input image in memory.

The MLImageFormatFileCache is especially useful to cache images which are too large to be stored in memory and therefore cannot be handled by the module MemoryCache.

See also the BitImageArithmetic module which can be configured to cache a BitImage and the general documentation about the MLImageFormat and MLDataCompressors.

Tips

There are some useful and different modes for which the MLImageFormatFileCache modules can be used.

  1. The first mode is to store a large image temporarily in a file instead of storing it in a MemoryCache module to reduce the memory usage of an application. Since output pages and the file system also caches output information, access times often are nearly as fast as if a MemoryCache module is used.
  2. The second mode is useful to handle and compose very large images with this module. This approach first creates an empty image with the result extent, e.g. with the TestPattern module and to store it by using Update. Since pages with unique values are packed, those files are created and stored very fast while the file remains very small.In the next step with the Update Region functionality subregions or slices can be written step by step into that file. Since everything works page based there is no limitation about the file size, even file sizes of many hundred giga bytes can be composed in this way even on 32 bit systems with little memory.
  3. The third operation mode is similar to the second one. It allows opening an existing .mlimage file with the Preserve Cache File flag enabled. This file can then be updated, partially overwritten or changed with the Update Region functionality.

Windows

Default Panel

../../../Modules/ML/MLImageFormat/mhelp/Images/Screenshots/MLImageFormatFileCache._default.png

Input Fields

input0

name: input0, type: Image

The module has one input which is optional.

Therefore an already cached file remains up to date when Update Mode is set to Off or Auto Update, even if the connection to the input is removed or the input is invalidated.

Output Fields

output0

name: output0, type: Image

The module has one image output which is invalid if no data is cached; otherwise it provides the internally cached image.

Parameter Fields

Field Index

boolHintVal6: Bool dblHintVisible8: Bool progress: Float
boolHintVal7: Bool dblHintVisible9: Bool Region Offset: String
boolHintVal8: Bool hintName0: String Remove: Trigger
boolHintVal9: Bool hintName1: String status: String
boolHintVisible0: Bool hintName2: String Stop: Trigger
boolHintVisible1: Bool hintName3: String strHintVal6: String
boolHintVisible2: Bool hintName4: String strHintVal7: String
boolHintVisible3: Bool hintName5: String strHintVal8: String
boolHintVisible4: Bool hintName6: String strHintVal9: String
boolHintVisible5: Bool hintName7: String strHintVisible0: Bool
boolHintVisible6: Bool hintName8: String strHintVisible1: Bool
boolHintVisible7: Bool hintName9: String strHintVisible2: Bool
boolHintVisible8: Bool intHintVal6: Integer strHintVisible3: Bool
boolHintVisible9: Bool intHintVal7: Integer strHintVisible4: Bool
Clear: Trigger intHintVal8: Integer strHintVisible5: Bool
Compression: Enum intHintVal9: Integer strHintVisible6: Bool
dblHintVal6: Double intHintVisible0: Bool strHintVisible7: Bool
dblHintVal7: Double intHintVisible1: Bool strHintVisible8: Bool
dblHintVal8: Double intHintVisible2: Bool strHintVisible9: Bool
dblHintVal9: Double intHintVisible3: Bool Suppress World Pos: Bool
dblHintVisible0: Bool intHintVisible4: Bool Tag List: String
dblHintVisible1: Bool intHintVisible5: Bool Tmp File Prefix: String
dblHintVisible2: Bool intHintVisible6: Bool trueFileName: String
dblHintVisible3: Bool intHintVisible7: Bool Update: Trigger
dblHintVisible4: Bool intHintVisible8: Bool Update Mode: Enum
dblHintVisible5: Bool intHintVisible9: Bool Update Region: Trigger
dblHintVisible6: Bool isSaving: Bool Valid: Bool
dblHintVisible7: Bool Preserve Cache File: Bool  

Visible Fields

Compression

name: compression, type: Enum, default: None

Defines the progression algorithm.

See MLDataCompressors for more information.

Values:

Title Name
None None
MLCTComp2 MLCTComp2
Lzf LZF
Zlib ZLIB
Lzma LZMA
BZip2 BZip2

Update Mode

name: updateMode, type: Enum, default: AutoUpdate

Off: Changes of parameters or input image do not influence the output image. Auto Update: Changes of parameters or input image update the cache to the input image. Auto Clear: Changes of parameters or input image clear the cached image.

Values:

Title Name
Off Off
Auto Update AutoUpdate
Auto Clear AutoClear

Remove

name: remove, type: Trigger

If pressed, the cached image file is being deleted (even in preserve file mode) and the output image is being disabled.

Stop

name: stop, type: Trigger

If pressed, the file storing is termintated and the cached image invalidated.

Tag List

name: tagList, type: String

Shows a list of tags in the file.

Region Offset

name: regionOffset, type: String, default: 0 0 0 0 0 0

Sets a 6D offset vector that is added to the position where an input region is written on Update Region.

The destination of the updated input region is ccalculated as follows: The origin of the input region in world coordinates is taken and the corresponding voxel coordinate in the cached image is determined. Then Region Offset is added and the input region is written at that position.

Suppress World Pos

name: suppressWorldPos, type: Bool, default: FALSE

Determines whether world coordinates of an input region are used to determine the destination position in target image if 'Update Region' is used. If this field is off then the world coordinates of the origin of the input image + Region Offset are used as target position for subimages written into already written files. If this field is on then only the position given by Region Offset will be used as target position for written subimages.

Valid

name: valid, type: Bool, default: FALSE

Indicates whether a file is cached

Preserve Cache File

name: preserveCacheFile, type: Bool, default: FALSE

If enabled then an existing cache file is used and modified, but never cleared. If false then a cache file is automatically cleared/removed.

Clear

name: clear, type: Trigger

Clears the cached image file or - in preserve file mode - only disables the output image.

Update

name: update, type: Trigger

In preserve file mode with a valid cache file loads the data from the cache file and passes it to the output. If the cache file does not exist or if preserved file mode is off then it stores the input image in the cache file. Note: To update the content of an existing preserved cache file use 'Remove' to delete the file and then 'Update' to save new data.

Update Region

name: updateRegion, type: Trigger

If pressed, the cached file is being overwritten with data from the input image at its world location.

Tmp File Prefix

name: tmpFileNamePrefix, type: String

Sets a preserved cache file name or prefix for automatic file name while using file buffering.

Hidden Fields

hintName0

name: hintName0, type: String

dblHintVisible0

name: dblHintVisible0, type: Bool, default: FALSE

intHintVisible0

name: intHintVisible0, type: Bool, default: FALSE

strHintVisible0

name: strHintVisible0, type: Bool, default: FALSE

boolHintVisible0

name: boolHintVisible0, type: Bool, default: FALSE

hintName1

name: hintName1, type: String

dblHintVisible1

name: dblHintVisible1, type: Bool, default: FALSE

intHintVisible1

name: intHintVisible1, type: Bool, default: FALSE

strHintVisible1

name: strHintVisible1, type: Bool, default: FALSE

boolHintVisible1

name: boolHintVisible1, type: Bool, default: FALSE

hintName2

name: hintName2, type: String

dblHintVisible2

name: dblHintVisible2, type: Bool, default: FALSE

intHintVisible2

name: intHintVisible2, type: Bool, default: FALSE

strHintVisible2

name: strHintVisible2, type: Bool, default: FALSE

boolHintVisible2

name: boolHintVisible2, type: Bool, default: FALSE

hintName3

name: hintName3, type: String

dblHintVisible3

name: dblHintVisible3, type: Bool, default: FALSE

intHintVisible3

name: intHintVisible3, type: Bool, default: FALSE

strHintVisible3

name: strHintVisible3, type: Bool, default: FALSE

boolHintVisible3

name: boolHintVisible3, type: Bool, default: FALSE

hintName4

name: hintName4, type: String

dblHintVisible4

name: dblHintVisible4, type: Bool, default: FALSE

intHintVisible4

name: intHintVisible4, type: Bool, default: FALSE

strHintVisible4

name: strHintVisible4, type: Bool, default: FALSE

boolHintVisible4

name: boolHintVisible4, type: Bool, default: FALSE

hintName5

name: hintName5, type: String

dblHintVisible5

name: dblHintVisible5, type: Bool, default: FALSE

intHintVisible5

name: intHintVisible5, type: Bool, default: FALSE

strHintVisible5

name: strHintVisible5, type: Bool, default: FALSE

boolHintVisible5

name: boolHintVisible5, type: Bool, default: FALSE

hintName6

name: hintName6, type: String

dblHintVal6

name: dblHintVal6, type: Double, default: 0

intHintVal6

name: intHintVal6, type: Integer, default: 0

strHintVal6

name: strHintVal6, type: String

boolHintVal6

name: boolHintVal6, type: Bool, default: FALSE

dblHintVisible6

name: dblHintVisible6, type: Bool, default: FALSE

intHintVisible6

name: intHintVisible6, type: Bool, default: FALSE

strHintVisible6

name: strHintVisible6, type: Bool, default: FALSE

boolHintVisible6

name: boolHintVisible6, type: Bool, default: FALSE

hintName7

name: hintName7, type: String

dblHintVal7

name: dblHintVal7, type: Double, default: 0

intHintVal7

name: intHintVal7, type: Integer, default: 0

strHintVal7

name: strHintVal7, type: String

boolHintVal7

name: boolHintVal7, type: Bool, default: FALSE

dblHintVisible7

name: dblHintVisible7, type: Bool, default: FALSE

intHintVisible7

name: intHintVisible7, type: Bool, default: FALSE

strHintVisible7

name: strHintVisible7, type: Bool, default: FALSE

boolHintVisible7

name: boolHintVisible7, type: Bool, default: FALSE

hintName8

name: hintName8, type: String

dblHintVal8

name: dblHintVal8, type: Double, default: 0

intHintVal8

name: intHintVal8, type: Integer, default: 0

strHintVal8

name: strHintVal8, type: String

boolHintVal8

name: boolHintVal8, type: Bool, default: FALSE

dblHintVisible8

name: dblHintVisible8, type: Bool, default: FALSE

intHintVisible8

name: intHintVisible8, type: Bool, default: FALSE

strHintVisible8

name: strHintVisible8, type: Bool, default: FALSE

boolHintVisible8

name: boolHintVisible8, type: Bool, default: FALSE

hintName9

name: hintName9, type: String

dblHintVal9

name: dblHintVal9, type: Double, default: 0

intHintVal9

name: intHintVal9, type: Integer, default: 0

strHintVal9

name: strHintVal9, type: String

boolHintVal9

name: boolHintVal9, type: Bool, default: FALSE

dblHintVisible9

name: dblHintVisible9, type: Bool, default: FALSE

intHintVisible9

name: intHintVisible9, type: Bool, default: FALSE

strHintVisible9

name: strHintVisible9, type: Bool, default: FALSE

boolHintVisible9

name: boolHintVisible9, type: Bool, default: FALSE

trueFileName

name: trueFileName, type: String, deprecated name: autoFileName

progress

name: progress, type: Float, default: 0

Shows the amount of stored image data in percent.

isSaving

name: isSaving, type: Bool, default: FALSE

status

name: status, type: String, default: Cache is off.