伪彩组件更改
parent
8600054405
commit
e631ce73f2
|
|
@ -691,13 +691,14 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
cornerstoneToolsMouseMove(e) {
|
cornerstoneToolsMouseMove(e) {
|
||||||
|
try {
|
||||||
const { currentPoints } = e.detail
|
const { currentPoints } = e.detail
|
||||||
const worldPoint = currentPoints.world
|
const worldPoint = currentPoints.world
|
||||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||||
let referencedImageId = viewport.getCurrentImageId()
|
let referencedImageId = viewport.getCurrentImageId()
|
||||||
const data = viewport.getImageData()
|
const data = viewport.getImageData()
|
||||||
if (!data) return
|
if (!data || !referencedImageId) return
|
||||||
const { dimensions, imageData, metadata, voxelManager } = data
|
const { dimensions, imageData, metadata, voxelManager } = data
|
||||||
const index = imageData.worldToIndex(worldPoint)
|
const index = imageData.worldToIndex(worldPoint)
|
||||||
index[0] = Math.floor(index[0])
|
index[0] = Math.floor(index[0])
|
||||||
|
|
@ -737,6 +738,9 @@ export default {
|
||||||
this.mousePosition.value = value
|
this.mousePosition.value = value
|
||||||
this.mousePosition.modalityUnit = modalityUnit
|
this.mousePosition.modalityUnit = modalityUnit
|
||||||
}
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggleTask(evt, visitTaskNum, i) {
|
toggleTask(evt, visitTaskNum, i) {
|
||||||
this.$emit('activeViewport', this.viewportIndex)
|
this.$emit('activeViewport', this.viewportIndex)
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ export default {
|
||||||
range: 40,
|
range: 40,
|
||||||
upper: 6,
|
upper: 6,
|
||||||
isSlideMoving: false,
|
isSlideMoving: false,
|
||||||
|
req: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -137,23 +138,23 @@ export default {
|
||||||
})
|
})
|
||||||
document.addEventListener('mousemove', (e) => {
|
document.addEventListener('mousemove', (e) => {
|
||||||
if (this.isSlideMoving) {
|
if (this.isSlideMoving) {
|
||||||
|
if (this.req) return;
|
||||||
|
this.req = requestAnimationFrame(() => {
|
||||||
|
this.req = null;
|
||||||
var containerWidth = container.clientWidth
|
var containerWidth = container.clientWidth
|
||||||
var sliderWidth = sliderBox.clientWidth
|
var sliderWidth = sliderBox.clientWidth
|
||||||
var maxLeft = containerWidth - sliderWidth
|
var maxLeft = containerWidth - sliderWidth
|
||||||
if (maxLeft <= 0) return
|
if (maxLeft <= 0) return
|
||||||
|
|
||||||
var left = e.clientX - container.getBoundingClientRect().left
|
var left = e.clientX - container.getBoundingClientRect().left
|
||||||
var position = null
|
|
||||||
position = left
|
|
||||||
if (left < 0) {
|
if (left < 0) {
|
||||||
left = 6
|
left = 0
|
||||||
position = 0
|
|
||||||
} else if (left > maxLeft) {
|
} else if (left > maxLeft) {
|
||||||
left = maxLeft + 6
|
left = maxLeft
|
||||||
position = maxLeft
|
|
||||||
}
|
}
|
||||||
|
var position = left
|
||||||
|
|
||||||
slider.style.left = left + 'px'
|
slider.style.left = (left + 6) + 'px'
|
||||||
var positionValue = document.getElementById('slider-position')
|
var positionValue = document.getElementById('slider-position')
|
||||||
var upper = Number(this.range) || 0
|
var upper = Number(this.range) || 0
|
||||||
position = parseInt((position / maxLeft) * upper)
|
position = parseInt((position / maxLeft) * upper)
|
||||||
|
|
@ -167,6 +168,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.upper = position
|
this.upper = position
|
||||||
this.voiChange(position)
|
this.voiChange(position)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
document.addEventListener('mouseup', () => {
|
document.addEventListener('mouseup', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue