ReFlex Logo
ReFlex (Title)
Documentation
Navigation

reflex-layers

Table-of-contents

  1. User Interface
  2. Textures
  3. Example Data
  4. Generating KTX files
  5. using powershell scripts
  6. Sources for Additional Content
  7. Electron
  8. Keyboard Shortcuts
  9. Key Bindings for loading Datasets
  10. Interaction Modes
  11. Project Setup and Development
  12. Known Issues

User Interface

The application features basically three visualization / interaction modes (see also Interaction Modes).

Magic Lens (single touch and multi-touch)

Displays a lens containing the layer content of the depth of the deformation at the finger position.

Magic Lens

Single Touch (only one lens for the finger causing the highest deformation) and Multi-Touch (one lens for each finger) modes can be selected separately.

Lens Options include the size of the lens, an optional offset from the finger and the specification whether additional information should be displayed on the lens itself.

Layer Navigation

Displays the layer mapped to the current maximum deformation.

Layer Navigation

Pixel Blending

Maps the depth information associated to each pixel on the surface to the displayed content by blending images based on the depth value.

Pixel Blending

Pixel Blending Options include developer / debugging options, whether to interpolate depth values for smoother blending and if the sensor calibration should be applied to the depth image.

Textures

Texture Formats

  1. Texture2D
    • multiple images in common file formats (preferably png and jpg)
    • constraint: maximum 15 images can be used
  2. TextureArray:
    • Number of images of equal size provided ina single file
    • either in RAW format (raw bit data) or in Khronos KTX texture format, could contain 256 or more images
  3. Texture3D:
    • number of images of equal size, encoded as volumetric data structure
    • either in DDS format (raw bit data) or in Khronos KTX texture format
    • REMARK: currently not working / not implemented as three.js can read and load DDS textures, but binding to a Texture3d is not working (it seems that three.js focuses on Texture Arrays)

Common Properties for TextureResource

Specific properties for TextureArrays

App Configuration

There is an optional parameter config that can be set for each dataset. It specifies the default settings applied when loading the dataset:


    "config": {
      // default interaction mode: 
      //    0: Pixel Blending, 
      //    1: Magic Lens (single touch)
      //    2: Magic Lens (multi touch)
      //    3: Layer Navigation
      "interaction": 1,          
      "interpolateColor": true,
      // show layers and layer information at the lens
      "showLenseUI": true,
      // show position in the current layer on the side
      "showLayerUI": false,
      // selected mask for Magic Lens (only 3D Textures)
      "defaultLensMaskIdx": 1,
      // selected border color for Magic Lens (only 3D Textures) - RGBA (Hex)
      "lensBorderColor": "#ffff00",
      // scaling factor of lens
      "lensSize": 1.0,
      // horizontal lens offset from finger (Pixel)
      "lensOffsetX": 0.0,
      // vertical lens offset from finger (Pixel)
      "lensOffsetY": 0.0,
      // only for multi-touch Magic lenses: constrain number of available lenses
      "maxNumLenses": 1
    }

Example Data

Visible Human

CT Head Raw TextureArray

Generating KTX files

    "C:\Program Files\KTX-Software\bin\toktx.exe" --t2 --encode etc1s --layers 10 output_texArray @files.txt

  // conversion from Linear color space to sRGB
  vec4 fromLinear(vec4 linearRGB)
  {
    bvec4 cutoff = lessThan(linearRGB, vec4(0.0031308));
    vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);
    vec4 lower = linearRGB * vec4(12.92);

    return mix(higher, lower, cutoff);
  }

  // conversion from Linear color space to sRGB
  vec4 toLinear(vec4 sRGB)
  {
    bvec4 cutoff = lessThan(sRGB, vec4(0.04045));
    vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));
    vec4 lower = sRGB/vec4(12.92);

    return mix(higher, lower, cutoff);
  }

using powershell scripts

There are two PowerShell scripts provided which automate the creation of the file list and creating the ktx command.


  .\create-file-list.ps1 -Path "textures\" -Output "output.txt"

to create the file list with the following optional parameters:

Both parameters are optional.

Remarks: Files are sorted by name (string sort)


  .\create-ktx.ps1 -Path ".\test" -NumLayers 141 -ToolPath "C:\Program Files\KTX-Software\bin\toktx.exe"

with the following optional parameters:

Sources for Additional Content

Additional Content Link
Dresden Hochwasser (2D/3D) Dresden Hochwasser (arcGis)
Dresden Themenstadtplan Dresden Themenstadtplan (cardo.Map)
Historische Karten Europa 1500 - 2008 Digitaler Atlas zur Geschichte Europas
Altar von Ghent (van Eyck) [nicht freigegeben !] Closer to van Eyck
Visible Human Head National Library of Medicine
CT Head Raw CodeProject article

Electron

Keyboard Shortcuts

The app starts in full screen mode. The following shortcuts are available:

Shortcut Description
S Toggle Settings Panel
Esc Close the application
STRG + Shift + I open dev tools
STRG + R reload app
STRG + M minimize app
F1 - F10 load specific Configurations (if defined, see Key Bindings)

Key Bindings for loading Datasets

It is possible to assign Keys to specific datasets. This can be done in the assets/data/keybindings.json file. So far, only assigning keys F1 to F10 has been tested; other might work as well.

Just add a (unique) mapping between key and dataset id in the form { "key": "F6", "dataset": 8 } to the keyBindings array.

Example Config:

  {
    "keyBindings": [
      { "key": "F1", "dataset": 14 },
      { "key": "F2", "dataset": 51 },
      { "key": "F3", "dataset": 60 },
      { "key": "F4", "dataset": 4 },
      { "key": "F5", "dataset": 5 },
      { "key": "F6", "dataset": 8 },
      { "key": "F7", "dataset": 9 },
      { "key": "F8", "dataset": 15 },
      { "key": "F9", "dataset": 1 }
    ]
  }

Interaction Modes

Pixel Blending

Magic Lens (Single or Multi-Touch)

Layer Navigation

When using KTX-Arrays, Lens Modes offer an additional option to specify the lens mask. his can be customized to achieve effects such as a fisheye effect. Also, the border color of the lens can be specified.

Project Setup and Development

This project was generated with Angular CLI version 17.3.11.

Run npm install in directory reflex-layers to install node packages.

Code Scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

NPM Commands

Command Description
start starts the Angular app on port 4302
start:electron starts the app as packaged electron application
watch starts the Angular app on port 4302 in watch mode
build builds the Angular app
build:electron builds and packages the app as electron application (Target: Win)
test executes unit tests via Karma

Further Help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

Known Issues