伪彩组件更改
parent
8600054405
commit
e631ce73f2
|
|
@ -691,51 +691,55 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
cornerstoneToolsMouseMove(e) {
|
cornerstoneToolsMouseMove(e) {
|
||||||
const { currentPoints } = e.detail
|
try {
|
||||||
const worldPoint = currentPoints.world
|
const { currentPoints } = e.detail
|
||||||
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
const worldPoint = currentPoints.world
|
||||||
const viewport = renderingEngine.getViewport(this.viewportId)
|
const renderingEngine = getRenderingEngine(this.renderingEngineId)
|
||||||
let referencedImageId = viewport.getCurrentImageId()
|
const viewport = renderingEngine.getViewport(this.viewportId)
|
||||||
const data = viewport.getImageData()
|
let referencedImageId = viewport.getCurrentImageId()
|
||||||
if (!data) return
|
const data = viewport.getImageData()
|
||||||
const { dimensions, imageData, metadata, voxelManager } = data
|
if (!data || !referencedImageId) return
|
||||||
const index = imageData.worldToIndex(worldPoint)
|
const { dimensions, imageData, metadata, voxelManager } = data
|
||||||
index[0] = Math.floor(index[0])
|
const index = imageData.worldToIndex(worldPoint)
|
||||||
index[1] = Math.floor(index[1])
|
index[0] = Math.floor(index[0])
|
||||||
index[2] = Math.floor(index[2])
|
index[1] = Math.floor(index[1])
|
||||||
this.mousePosition.index = index
|
index[2] = Math.floor(index[2])
|
||||||
const modality = metadata.Modality
|
this.mousePosition.index = index
|
||||||
let ijk = csUtils.transformWorldToIndex(imageData, worldPoint)
|
const modality = metadata.Modality
|
||||||
ijk = vec3.round(ijk, ijk);
|
let ijk = csUtils.transformWorldToIndex(imageData, worldPoint)
|
||||||
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
ijk = vec3.round(ijk, ijk);
|
||||||
this.isHandleOutsideImage = false
|
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
||||||
let value = voxelManager.getAtIJKPoint(ijk)
|
this.isHandleOutsideImage = false
|
||||||
ijk[2] = viewport.getCurrentImageIdIndex()
|
let value = voxelManager.getAtIJKPoint(ijk)
|
||||||
let modalityUnit
|
ijk[2] = viewport.getCurrentImageIdIndex()
|
||||||
if (modality === 'US') {
|
let modalityUnit
|
||||||
const calibratedResults = cornerstoneTools.utilities.getCalibratedProbeUnitsAndValue(image, [ijk])
|
if (modality === 'US') {
|
||||||
const hasEnhancedRegionValues = calibratedResults.values.every(
|
const calibratedResults = cornerstoneTools.utilities.getCalibratedProbeUnitsAndValue(image, [ijk])
|
||||||
(value) => value !== null
|
const hasEnhancedRegionValues = calibratedResults.values.every(
|
||||||
)
|
(value) => value !== null
|
||||||
value = (hasEnhancedRegionValues ? calibratedResults.values : value)
|
)
|
||||||
modalityUnit = hasEnhancedRegionValues
|
value = (hasEnhancedRegionValues ? calibratedResults.values : value)
|
||||||
? calibratedResults.units
|
modalityUnit = hasEnhancedRegionValues
|
||||||
: 'raw';
|
? calibratedResults.units
|
||||||
} else {
|
: 'raw';
|
||||||
const scalingModule = referencedImageId && metaData.get('scalingModule', referencedImageId)
|
} else {
|
||||||
const isSuvScaled = typeof scalingModule?.suvbw === 'number'
|
const scalingModule = referencedImageId && metaData.get('scalingModule', referencedImageId)
|
||||||
const pixelUnitsOptions = {
|
const isSuvScaled = typeof scalingModule?.suvbw === 'number'
|
||||||
isPreScaled: cornerstoneTools.utilities.viewport.isViewportPreScaled(viewport, referencedImageId),
|
const pixelUnitsOptions = {
|
||||||
isSuvScaled: isSuvScaled,
|
isPreScaled: cornerstoneTools.utilities.viewport.isViewportPreScaled(viewport, referencedImageId),
|
||||||
|
isSuvScaled: isSuvScaled,
|
||||||
|
}
|
||||||
|
modalityUnit = cornerstoneTools.utilities.getPixelValueUnits(
|
||||||
|
modality,
|
||||||
|
referencedImageId,
|
||||||
|
pixelUnitsOptions
|
||||||
|
);
|
||||||
}
|
}
|
||||||
modalityUnit = cornerstoneTools.utilities.getPixelValueUnits(
|
this.mousePosition.value = value
|
||||||
modality,
|
this.mousePosition.modalityUnit = modalityUnit
|
||||||
referencedImageId,
|
|
||||||
pixelUnitsOptions
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
this.mousePosition.value = value
|
} catch(e) {
|
||||||
this.mousePosition.modalityUnit = modalityUnit
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleTask(evt, visitTaskNum, i) {
|
toggleTask(evt, visitTaskNum, i) {
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ export default {
|
||||||
range: 40,
|
range: 40,
|
||||||
upper: 6,
|
upper: 6,
|
||||||
isSlideMoving: false,
|
isSlideMoving: false,
|
||||||
|
req: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -137,36 +138,37 @@ export default {
|
||||||
})
|
})
|
||||||
document.addEventListener('mousemove', (e) => {
|
document.addEventListener('mousemove', (e) => {
|
||||||
if (this.isSlideMoving) {
|
if (this.isSlideMoving) {
|
||||||
var containerWidth = container.clientWidth
|
if (this.req) return;
|
||||||
var sliderWidth = sliderBox.clientWidth
|
this.req = requestAnimationFrame(() => {
|
||||||
var maxLeft = containerWidth - sliderWidth
|
this.req = null;
|
||||||
if (maxLeft <= 0) return
|
var containerWidth = container.clientWidth
|
||||||
|
var sliderWidth = sliderBox.clientWidth
|
||||||
|
var maxLeft = containerWidth - sliderWidth
|
||||||
|
if (maxLeft <= 0) return
|
||||||
|
|
||||||
var left = e.clientX - container.getBoundingClientRect().left
|
var left = e.clientX - container.getBoundingClientRect().left
|
||||||
var position = null
|
if (left < 0) {
|
||||||
position = left
|
left = 0
|
||||||
if (left < 0) {
|
} else if (left > maxLeft) {
|
||||||
left = 6
|
left = maxLeft
|
||||||
position = 0
|
}
|
||||||
} else if (left > maxLeft) {
|
var position = left
|
||||||
left = maxLeft + 6
|
|
||||||
position = maxLeft
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
||||||
if (position > upper) position = upper
|
if (position > upper) position = upper
|
||||||
if (position < 0) position = 0
|
if (position < 0) position = 0
|
||||||
|
|
||||||
if (this.modality === 'NM') {
|
if (this.modality === 'NM') {
|
||||||
positionValue.textContent = upper > 0 ? Math.round((position / upper) * 100) + '%' : '0%'
|
positionValue.textContent = upper > 0 ? Math.round((position / upper) * 100) + '%' : '0%'
|
||||||
} else {
|
} else {
|
||||||
positionValue.textContent = position
|
positionValue.textContent = position
|
||||||
}
|
}
|
||||||
this.upper = position
|
this.upper = position
|
||||||
this.voiChange(position)
|
this.voiChange(position)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
document.addEventListener('mouseup', () => {
|
document.addEventListener('mouseup', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue