Skip to content

Commit

Permalink
doc(configuration_file): add separate page for JSON config
Browse files Browse the repository at this point in the history
Add segmentGroupSaveFormat section.
  • Loading branch information
PaulHax committed Dec 29, 2023
1 parent 6ae16e8 commit 12f770a
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 90 deletions.
141 changes: 141 additions & 0 deletions documentation/content/doc/configuration_file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Configuration JSON File

By loading a JSON file, you can set VolView's:

- Starting view layout (Axial Only, 3D Primary, etc).
- Labels for tools
- Visibility of Sample Data section
- Keyboard shortcuts

## Starting view layout

The `activeLayout` key has options (Axial Only, 3D Primary, etc.) defined in `config.ts`

```json
{
"layout": {
"activeLayout": "Axial Only"
}
}
```

## Labels for tools

Each tool type (Rectangle, Polygon, etc.) can have tool specific labels. To share labels
across tools, define the `defaultLabels` key and don't provide labels for a tool that
should use the default labels.

```json
{
"labels": {
"defaultLabels": {
"lesion": { "color": "#ff0000" },
"tumor": { "color": "green", "strokeWidth": 3 }
}
}
}
```

## Segment Group File Format

The `segmentGroupSaveFormat` key specifies the file extension of the segment group images
VolView will include in the volview.zip file.

```json
{
"io": {
"segmentGroupSaveFormat": "nii"
}
}
```

These are the supported file formats:

hdf5, iwi.cbor, mha, nii, nii.gz, nrrd, vtk

## Keyboard Shortcuts

Configure the keys to activate tools, change selected labels, and more.
All [shortcut actions](https://github.com/Kitware/VolView/blob/main/src/constants.ts#L53) are under the `ACTIONS` variable.

To configure a key for an action, add its action name and the key(s) under the `shortcuts` section. For key combinations, use `+` like `Ctrl+f`.

```json
{
"shortcuts": {
"polygon": "Ctrl+p",
"showKeyboardShortcuts": "t"
}
}
```

## Visibility of Sample Data section

Simplify the data browser by hiding the Sample Data expandable section.

```json
{
"dataBrowser": {
"hideSampleData": false
}
}
```

## Example JSON:

```json
{
"labels": {
"defaultLabels": {
"lesion": { "color": "#ff0000" },
"tumor": { "color": "green", "strokeWidth": 3 }
}
},
"layout": {
"activeLayout": "Axial Only"
}
}
```

## All options:

```json
{
"labels": {
"defaultLabels": {
"lesion": { "color": "#ff0000" },
"tumor": { "color": "green", "strokeWidth": 3 },
"innocuous": { "color": "white" }
},
"rulerLabels": {
"big": { "color": "#ff0000" },
"small": { "color": "white" }
},
"rectangleLabels": {
"red": { "color": "#ff0000", "fillColor": "transparent" },
"green": { "color": "green", "fillColor": "transparent" },
"white-yellow-fill": {
"color": "white",
"fillColor": "#00ff0030"
}
},
"polygonLabels": {
"poly1": { "color": "#ff0000" },
"poly2Label": { "color": "green" }
}
},
"layout": {
"activeLayout": "Axial Only"
},
"dataBrowser": {
"hideSampleData": false
},
"shortcuts": {
"polygon": "Ctrl+p",
"showKeyboardShortcuts": "t"
},
"io": {
"segmentGroupSaveFormat": "nrrd"
}
}
```
86 changes: 0 additions & 86 deletions documentation/content/doc/loading_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,92 +56,6 @@ page](https://github.com/Kitware/VolView/issues)!

In order for VolView to download and display your remote datasets, your server must be configured with the correct [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration. CORS is a browser security mechanism that restricts how web applications can access remote resources. Without proper CORS configuration, VolView will be unable to download and display your datasets. Configuring your web server with CORS is beyond the scope of this documentation; please refer to your server's documentation.

### Configuration JSON File

By loading a JSON file, you can set VolView's:

- Starting view layout (Axial Only, 3D Primary, etc).
- Labels for tools
- Visibility of Sample Data section
- Keyboard shortcuts

#### Starting view layout

The `activeLayout` key has options (Axial Only, 3D Primary, etc.) defined in `config.ts`

#### Labels for tools

Each tool type (Rectangle, Polygon, etc.) can have tool specific labels. To share labels
across tools, define the `defaultLabels` key and don't provide labels for a tool that
should use the default labels.

#### Visibility of Sample Data section

Simplify the data browser by hiding the Sample Data expandable section.

#### Keyboard Shortcuts

Configure the keys to activate tools, change selected labels, and more.
All [shortcut actions](https://github.com/Kitware/VolView/blob/main/src/constants.ts#L53) are under the `ACTIONS` variable.

To configure a key for an action, add its action name and the key(s) under the `shortcuts` section. For key combinations, use `+` like `Ctrl+f`.

#### Example JSON:

```json
{
"labels": {
"defaultLabels": {
"lesion": { "color": "#ff0000" },
"tumor": { "color": "green", "strokeWidth": 3 }
}
},
"layout": {
"activeLayout": "Axial Only"
}
}
```

#### All options:

```json
{
"labels": {
"defaultLabels": {
"lesion": { "color": "#ff0000" },
"tumor": { "color": "green", "strokeWidth": 3 },
"innocuous": { "color": "white" }
},
"rulerLabels": {
"big": { "color": "#ff0000" },
"small": { "color": "white" }
},
"rectangleLabels": {
"red": { "color": "#ff0000", "fillColor": "transparent" },
"green": { "color": "green", "fillColor": "transparent" },
"white-yellow-fill": {
"color": "white",
"fillColor": "#00ff0030"
}
},
"polygonLabels": {
"poly1": { "color": "#ff0000" },
"poly2Label": { "color": "green" }
}
},
"layout": {
"activeLayout": "Axial Only"
},
"dataBrowser": {
"hideSampleData": false
}
"shortcuts": {
"polygon": "Ctrl+p",
"showKeyboardShortcuts": "t"
}
}
```

## Layer Images

To overlay images in the 2D views, there is a layer button on image thumbnails. A PET image could be layered on top of a CT image. The layered image is resampled to the base image using the image's spatial metadata. If the spatial metadata does not place the images in the same coordinate system, the layer alignment will be incorrect.
Expand Down
2 changes: 1 addition & 1 deletion documentation/content/doc/state_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

VolView state files are a great way to save your scene and data to either be used later, or for distributing to collaborators and other users. These files store all of the information you need to restore the state of VolView: your data, annotations, camera positions, background colors, colormaps, and more.

State files can be saved by clicking on "Disk" icon in the top of the toolbar. This button will generate a `*.volview` file that can then be re-opened in VolView at any time.
State files can be saved by clicking on "Disk" icon in the top of the toolbar. This button will generate a `*.volview.zip` file that can then be re-opened in VolView at any time.

When saving VolView state, your data is saved along with the application state. This way, when you send a state file to a collaborator, they too can open the state file and load the previously saved data. However, this means that your state file will be as large as your dataset(s) and may contain patient identifying information. Please follow your institutes HIPAA, IRB and other regulatory and confidentiality requirements.

Expand Down
3 changes: 2 additions & 1 deletion documentation/tpl/__en__
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ sidebar:
mouse_controls: Mouse/Keyboard Controls
rendering: Cinematic Rendering
state_files: State Files
server: Remote Server Capabilities
server: Remote Server Capabilities
configuration_file: Configuration File
5 changes: 3 additions & 2 deletions documentation/tpl/__sidebar__
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
doc:
introduction:
introduction:
what_is_volview: index.html
quick_start_guide: quick_start_guide.html
details:
details:
welcome_screen: welcome_screen.html
loading_data: loading_data.html
toolbar: toolbar.html
mouse_controls: mouse_controls.html
rendering: rendering.html
state_files: state_files.html
server: server.html
configuration_file: configuration_file.html

0 comments on commit 12f770a

Please sign in to comment.