11import _ from 'underscore' ;
2+ import Vue from 'vue' ;
23
4+ import { restRequest } from '@girder/core/rest' ;
35import Panel from '@girder/slicer_cli_web/views/Panel' ;
4- import FrameSelector from '@girder/large_image/vue/components/FrameSelector.vue' ;
6+ import FrameSelector from '@girder/large_image/widgets/FrameSelector.vue' ;
7+ import DualInput from '@girder/large_image/widgets/DualInput.vue' ;
8+ import CompositeLayers from '@girder/large_image/widgets/CompositeLayers.vue' ;
9+ import HistogramEditor from '@girder/large_image/widgets/HistogramEditor.vue' ;
10+ import PresetsMenu from '@girder/large_image/vue/components/PresetsMenu.vue' ;
11+ import colors from '@girder/large_image/widgets/colors.json' ;
512
613import frameSelectorWidget from '../templates/panels/frameSelectorWidget.pug' ;
714import '../stylesheets/panels/frameSelectorWidget.styl' ;
@@ -23,14 +30,35 @@ var FrameSelectorWidget = Panel.extend({
2330 collapsed : this . $ ( '.s-panel-content.collapse' ) . length && ! this . $ ( '.s-panel-content' ) . hasClass ( 'in' )
2431 } ) ) ;
2532 const el = this . $ ( '#vue-container' ) . get ( 0 ) ;
26- const vm = new FrameSelector ( {
33+ const getFrameHistogram = ( params ) => {
34+ params = Object . assign ( { } , params ) ;
35+ restRequest ( {
36+ type : 'GET' ,
37+ url : 'item/' + this . _itemId + '/tiles/histogram' ,
38+ data : params
39+ } ) . then ( ( response ) => {
40+ const frameHistograms = this . vueApp . _props . frameHistograms || { } ;
41+ frameHistograms [ params . frame ] = response ;
42+ this . vueApp . _props . frameHistograms = Object . assign ( { } , frameHistograms ) ;
43+ return undefined ;
44+ } ) ;
45+ } ;
46+ CompositeLayers . components = { HistogramEditor} ;
47+ FrameSelector . components = { DualInput, CompositeLayers, HistogramEditor, PresetsMenu} ;
48+ const Component = Vue . extend ( FrameSelector ) ;
49+ const vm = new Component ( {
2750 el,
2851 propsData : {
52+ currentFrame : 0 ,
2953 itemId : this . _itemId ,
3054 imageMetadata : this . _tiles ,
3155 frameUpdate : ( frame , style ) => {
3256 this . viewer . frameUpdate ( frame , style ) ;
33- }
57+ } ,
58+ liConfig : this . _liConfig ,
59+ frameHistograms : undefined ,
60+ getFrameHistogram,
61+ colors
3462 }
3563 } ) ;
3664 this . vueApp = vm ;
0 commit comments