Open Items in VolView with a "Open in VolView" button. The button is located in the top right, on an Item's page.
- DICOM
.dcm - Nrrd
.nrrd - NIFTI
.nii - VTK image
.vti - And many more. Try dragging and dropping the file(s) on the VolView Demo Site
Using the client YAML file, anyone can change:
- The default view layout
- Associate files to layer or apply as segmentations via file name
- Default window and level
- Default labels for vector annotation tools
Add a .volview_config.yaml file higher in the folder hierarchy. Example file:
layouts:
Axial:
gridSize: ["axial"]
labels:
defaultLabels:
artifact:
color: "gray"
strokeWidth: 3
needs-review:
color: "#FFBF00"To merge with .volview_config.yamls higher in the folder hierarchy, include __inherit__: true
in the child .volview_config.yaml file. Example:
Child .volview_config.yaml
__inherit__: true
shortcuts:
polygon: "Ctrl+p"
rectangle: "b"Parent .volview_config.yaml
layouts:
Axial:
gridSize: ["axial"]Result
shortcuts:
polygon: "Ctrl+p"
rectangle: "b"
layouts:
Axial:
gridSize: ["axial"]Define one or more named layouts using the layouts key.
VolView will use the first layout as the default.
Each named layout will appear in the layout selector menu.
Use a 2D array of view type strings to specify both the grid layout and which views appear in each position:
layouts:
Four Slice Views:
- [axial, coronal]
- [sagittal, axial]Available view types: axial, coronal, sagittal, volume, oblique
For complex layouts, use this nested structure:
layouts:
Axial Primary:
direction: row
items:
- axial
- direction: column
items:
- coronal
- sagittalDirection values:
row- items arranged horizontallycolumn- items stacked vertically
View object properties:
- 2D views:
type: 2D,orientation: Axial|Coronal|Sagittal,name(optional) - 3D views:
type: 3D,viewDirection(optional),viewUp(optional),name(optional) - Oblique views:
type: Oblique,name(optional)
Define multiple named layouts that users can switch between:
layouts:
Three Slice Views:
- [axial, coronal]
- [sagittal, axial]
Axial Focus:
direction: row
items:
- axial
- direction: column
items:
- coronal
- sagittalAlternatively, use gridSize to set the layout grid as [width, height]:
layouts:
Two by Two:
gridSize: [2, 2]Prevent certain view types from appearing in the view type switcher with this config option. The 3D and Oblique types are disabled by default:
disabledViewTypes:
- 3D
- ObliqueTo enable 3D and Oblique views, use an empty list:
disabledViewTypes: []Valid values: 2D, 3D, Oblique
To assign labels and their properties, add a .volview_config.yaml file higher in the folder hierarchy.
Example .volview_config.yaml file:
# defaultLabels are shared by polygon, ruler and rectangle tool
labels:
defaultLabels:
artifact:
color: "gray"
strokeWidth: 3
needs-review:
color: "#FFBF00"Labels can be configured per tool:
labels:
rectangleLabels:
lesion: # label name
color: "#ff0000"
fillColor: "transparent"
innocuous:
color: "white"
fillColor: "#00ff0030"
tumor:
color: "green"
fillColor: "transparent"
rulerLabels:
big:
color: "#ff0000"
small:
color: "white"Label sections could be empty to disable labels for a tool.
labels:
rulerLabels:
rectangleLabels:
lesion:
color: "#ff0000"
fillColor: "transparent"
innocuous:
color: "white"
fillColor: "#00ff0030"Configure the keys to activate tools, change selected labels, and more.
Names for shortcut actions are in constants.ts 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.
shortcuts:
polygon: "Ctrl+p"
rectangle: "b"In VolView, show a dialog with the configured keyboard shortcuts by pressing the ? key.
Edited segment groups are saved as separate files within session.volview.zip files. By default the segment group file format is nii.gz.
io:
segmentGroupSaveFormat: "nii.gz" # default is nii.gzWhen loading multiple non DICOM image files, VolView can automatically associate related images based on file naming patterns. The extension must appear anywhere in the filename after splitting by dots, and the filename must start with the same prefix as the base image (everything before the first dot).
For example, with a base image patient.nrrd:
- Layers:
patient.layer.1.pet.nii,patient.layer.2.ct.mha - Segment groups:
patient.seg.1.tumor.nii.gz,patient.seg.2.lesion.mha
When multiple layers or segment groups match a base image, they are sorted alphabetically by filename and added in that order.
Use segmentGroupExtension to automatically convert matching non-DICOM images to segment groups.
For example, myFile.seg.nrrd becomes a segment group for myFile.nii. Defaults to "seg". To disable set to "".
io:
segmentGroupExtension: "seg" # "seg" is the defaultUse layerExtension to automatically layer matching non-DICOM images on top of the base image.
For example, myImage.layer.nii is layered on top of myImage.nii. Defaults to "layer" .To disable set to "".
io:
layerExtension: "layer" # "layer" is the defaultWill force the window level for all loaded volumes.
windowing:
level: 100
width: 50Generate VolView sessions programmatically with Python. Create sessions with annotations or labelmaps from analysis pipelines.
See session_builder/README.md for API docs and examples.
A .large_image_config.yaml file can change how images are grouped
and display columns with image metadata.
The VolView plugin proxies request to download files from S3 by default. This avoids a CORS error when loading a file from an S3 bucket asset store without CORS configuration. To speed up downloading of files from S3, the Girder admin can:
- Configure CORS in the S3 bucket for the Girder server.
- Change the global Girder configuration to add
a
[volview]section with aproxy_assetstores = Falseoption. See below:
[volview]
# Workaround CORS configuration errors in S3 assetstores.
# If True, the Girder server will proxy file download requests from
# VolView clients to the S3 assetstore. This will use more server bandwidth.
# If False, VolView client requests to download files are redirected to S3.
# Defaults to True.
proxy_assetstores = False
- GET folder/:id/volview?items=[itemIds]&folders=[folderIds] -> download JSON with URLS to files or the latest
*.volview.zipfile in the folder - GET item/:id/volview -> download JSON with URLs to all files in item or the latest
*.volview.zipfile - POST item/:id/volview -> upload file to Item with cookie authentication
- GET file/:id/proxiable/:name -> download a file with option to proxy
- GET folder/:id/volview_config/:name -> download JSON with VolView config properties
- Deprecated: GET item/:id/volview/datasets -> download all files in item except the
*.volview.zip
- User clicks Open in VolView for Item - Plugin checks if
*volview.zipfile exists in Item, finds none: Opens VolView with file download urlitem/:id/volview/datasets - VolView opens, fetches from
item/:id/volview/datasets, receives zip of all files in Item except files ending in*volview.zip - In VolView, User clicks the Save button - VolView POSTs session.volview.zip to
item/:id/volview - girder_volview plugin saves new session.volview.zip in Item.
- User clicks Open in VolView for Item - Plugin finds a
*volview.zipin the Item. Opens VolView with file download URL pointing toitem/:id/volview - VolView opens, fetches from
item/:id/volview, receives most recently created*volview.zipfile in Item.
VolView creates a new session.volview.zip file in the Girder Item every time the Save button is clicked.
- User checks a set of items or folders. Clicks "Open Checked in VolView".
- Browser client updates the
lastOpenedmetadata on a checked item/folder metadata with the current time. - Browser opens VolView with file download url pointing to
GET folder/:id/volview?items=[...ids]&folders=[...ids]. That endpoint returns a JSON file with URLs to Girder files. - VolView save URL is pointing to
PUT folder/:id/volview?metadata={items: [...ids], folders: [...ids]}.metadataparameter matches the checked set in the Girder file browser. User clicks save.session.volview.zipitem is created in the folder with alinkedResourcesmetadata key holding the folder and item IDs. If user checked a session.volview.zip item, thenitemspoints to an existing session.volview.zip. The new session.volview.zip takes thelinkedResourcesof the older session.volview.zip. - If user clicks refresh in VolView, the
GET folder/:id/volview?items=[...ids]&folders=[...ids]end point is hit again. If a session.volview.zip is in theitemsparameter, the plugin reads the volview.zip'slinkedResourcesand searches for a newer session.volview.zips with matchinglinkedResourcesand returns that if found. - If user checks a new set of folders or items that does not include a session.volview.zip item, the
GET folder/:id/volviewendpoint does not pick a session.volview.zip with matchinglinkedResourcesaslastOpenedmetadata on one of the checked items/folders is newer than the matching session.volview.zip. This allows opening of images with a clean slate.
Get this running https://github.com/DigitalSlideArchive/digital_slide_archive/tree/master/devops/with-dive-volview
In the docker-compose.override.yml file, add some volumes pointing to this girder plugin and optionally
a VolView repo checkout. Example:
services:
girder:
volumes:
- ../with-dive-volview/provision.divevolview.yaml:/opt/digital_slide_archive/devops/dsa/provision.yaml
- ../../../girder_volview:/opt/girder_volview
- ../../../../VolView:/opt/volview-packageComment out the pip install of this plugin here: https://github.com/DigitalSlideArchive/digital_slide_archive/blob/master/devops/with-dive-volview/provision.divevolview.yaml#L3
To install volume mapped girder-volview plugin and incorporate changes as files are edited, add this to the shell section of the provision.yaml:
shell:
- cd /opt/girder_volview/ && pip install -e .
- (sleep 30 && girder build --dev --watch-plugin volview)&To develop with a local VolView build, change the directory the Webpack copy plugin pulls from in girder_volview/web_client/webpack.helper.js:
new CopyWebpackPlugin([
{
from: "/opt/volview-package/dist", // Point to your mount of VolView
to: config.output.path,
toType: "dir",
},
]);Then build VolView from source with these env vars:
VITE_ENABLE_REMOTE_SAVE=true npm run build- Update the volview version in
./girder_volview/web_client/package.json