Skip to content

Commit

Permalink
Merge pull request #50 from Kitware/update_vtkjs
Browse files Browse the repository at this point in the history
Update vtk.js dependency
  • Loading branch information
floryst authored Mar 28, 2018
2 parents 22ca9f8 + b575877 commit f448f2d
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 158 deletions.
93 changes: 28 additions & 65 deletions Sources/config/glanceProxyConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ function activateOnCreate(def) {

// ----------------------------------------------------------------------------

function createDefaultView(classFactory, ui) {
return activateOnCreate(
createProxyDefinition(classFactory, ui, [
{
type: 'application',
link: 'AnnotationOpacity',
property: 'annotationOpacity',
},
{
type: 'application',
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
type: 'application',
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
);
}

// ----------------------------------------------------------------------------
export default {
definitions: {
Proxy: {
Expand Down Expand Up @@ -106,71 +129,11 @@ export default {
Glyph: createProxyDefinition(vtkGlyphRepresentationProxy, proxyUI.Glyph),
},
Views: {
View3D: activateOnCreate(
createProxyDefinition(vtkView, proxyUI.View3D, [
{ link: 'AnnotationOpacity', property: 'annotationOpacity' },
{
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
),
View2D: activateOnCreate(
createProxyDefinition(vtk2DView, proxyUI.View2D, [
{ link: 'AnnotationOpacity', property: 'annotationOpacity' },
{
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
),
View2D_X: activateOnCreate(
createProxyDefinition(vtk2DView, proxyUI.View2D, [
{ link: 'AnnotationOpacity', property: 'annotationOpacity' },
{
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
),
View2D_Y: activateOnCreate(
createProxyDefinition(vtk2DView, proxyUI.View2D, [
{ link: 'AnnotationOpacity', property: 'annotationOpacity' },
{
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
),
View2D_Z: activateOnCreate(
createProxyDefinition(vtk2DView, proxyUI.View2D, [
{ link: 'AnnotationOpacity', property: 'annotationOpacity' },
{
link: 'OrientationAxesVisibility',
property: 'orientationAxesVisibility',
},
{
link: 'OrientationAxesPreset',
property: 'presetToOrientationAxes',
},
])
),
View3D: createDefaultView(vtkView, proxyUI.View3D),
View2D: createDefaultView(vtk2DView, proxyUI.View2D),
View2D_X: createDefaultView(vtk2DView, proxyUI.View2D),
View2D_Y: createDefaultView(vtk2DView, proxyUI.View2D),
View2D_Z: createDefaultView(vtk2DView, proxyUI.View2D),
},
},
representations: {
Expand Down
67 changes: 0 additions & 67 deletions Sources/externals/ITKReader/ITKImageReader.js

This file was deleted.

6 changes: 4 additions & 2 deletions Sources/externals/ITKReader/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import vtkITKImageReader from 'vtk.js/Sources/IO/Misc/ITKImageReader';

import extensionToIO from 'itk/extensionToIO';
import readImageArrayBuffer from 'itk/readImageArrayBuffer';

import vtkITKImageReader from './ITKImageReader';
vtkITKImageReader.setReadImageArrayBufferFromITK(readImageArrayBuffer);

export const extensions = Array.from(
new Set(Object.keys(extensionToIO).map((ext) => ext.toLowerCase()))
Expand All @@ -22,7 +25,6 @@ export function registerToGlance(Glance) {

export default {
extensions,
vtkITKImageReader,
registerToGlance,
};

Expand Down
Loading

0 comments on commit f448f2d

Please sign in to comment.