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