DESKTOP-6C3NK6N\WXS 2024-07-30 10:43:24 +08:00
parent 535d30b6df
commit 2e11c881f5
1 changed files with 185 additions and 185 deletions

View File

@ -872,192 +872,192 @@ export default {
this.setAllToolsPassive()
},
onContextmenu(event) {
const colormapsList = cornerstone.colors.getColormapsList()
const colorItems = []
colorItems.push({
label: '默认值',
onClick: () => {
this.setColormap()
}
})
colormapsList.forEach(colormap => {
const item = {}
item.label = colormap.name
item.onClick = () => {
this.setColormap(colormap.id)
}
colorItems.push(item)
})
this.$contextmenu({
items: [
{
label: '移动',
divided: true,
onClick: () => {
this.setToolActive('Pan')
}
},
{
label: '缩放',
divided: true,
children: [
{
label: '自由缩放',
onClick: () => {
this.setToolActive('Zoom')
}
},
{
label: '适应图像',
onClick: () => {
this.fitToWindow()
}
},
{
label: '适应窗口',
onClick: () => {
this.fitToImage()
}
}
]
},
{
label: '透镜',
divided: true,
onClick: () => {
this.setToolActive('Magnify')
}
},
{
label: '旋转',
divided: true,
children: [
{
label: '默认值',
onClick: () => {
this.resetRotate()
}
},
{
label: '自由旋转',
onClick: () => {
this.setToolActive('Rotate')
}
},
{
label: '水平翻转',
onClick: () => {
this.setRotate(true, false, 0)
}
},
{
label: '垂直翻转',
onClick: () => {
this.setRotate(false, true, 0)
}
},
{
label: '左转90度',
onClick: () => {
this.setRotate(false, false, -90)
}
},
{
label: '右转90度',
onClick: () => {
this.setRotate(false, false, 90)
}
}
]
},
// const colormapsList = cornerstone.colors.getColormapsList()
// const colorItems = []
// colorItems.push({
// label: '',
// onClick: () => {
// this.setColormap()
// }
// })
// colormapsList.forEach(colormap => {
// const item = {}
// item.label = colormap.name
// item.onClick = () => {
// this.setColormap(colormap.id)
// }
// colorItems.push(item)
// })
// this.$contextmenu({
// items: [
// {
// label: '',
// divided: true,
// onClick: () => {
// this.setToolActive('Pan')
// }
// },
// {
// label: '',
// divided: true,
// children: [
// {
// label: '',
// onClick: () => {
// this.setToolActive('Zoom')
// }
// },
// {
// label: '',
// onClick: () => {
// this.fitToWindow()
// }
// },
// {
// label: '',
// onClick: () => {
// this.fitToImage()
// }
// }
// ]
// },
// {
// label: '',
// divided: true,
// onClick: () => {
// this.setToolActive('Magnify')
// }
// },
// {
// label: '',
// divided: true,
// children: [
// {
// label: '',
// onClick: () => {
// this.resetRotate()
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('Rotate')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setRotate(true, false, 0)
// }
// },
// {
// label: '',
// onClick: () => {
// this.setRotate(false, true, 0)
// }
// },
// {
// label: '90',
// onClick: () => {
// this.setRotate(false, false, -90)
// }
// },
// {
// label: '90',
// onClick: () => {
// this.setRotate(false, false, 90)
// }
// }
// ]
// },
{
label: '测量',
divided: true,
minWidth: 0,
children: [
{
label: '探针',
onClick: () => {
this.setToolActive('Probe')
}
},
{
label: '长度测量',
onClick: () => {
this.setToolActive('Length')
}
},
{
label: '角度测量',
onClick: () => {
this.setToolActive('Angle')
}
},
{
label: 'Cobb测量',
onClick: () => {
this.setToolActive('CobbAngle')
}
},
{
label: '椭圆测量',
onClick: () => {
this.setToolActive('EllipticalRoi')
}
},
{
label: '矩形测量',
onClick: () => {
this.setToolActive('RectangleRoi')
}
},
{
label: '多边形标记',
onClick: () => {
this.setToolActive('FreehandRoi')
}
},
{
label: '十字线',
onClick: () => {
this.setToolActive('Bidirectional')
}
},
{
label: '文字标注',
onClick: () => {
this.setToolActive('ArrowAnnotate')
}
}
]
},
{
label: '调窗',
divided: true,
onClick: () => {
this.setToolActive('Wwwc')
}
},
{
label: '反色',
divided: true,
onClick: () => {
this.toggleInvert()
}
},
{
label: '伪彩',
children: colorItems
}
],
event,
// x: event.clientX,
// y: event.clientY,
customClass: 'class-a',
zIndex: 3,
minWidth: 100
})
// {
// label: '',
// divided: true,
// minWidth: 0,
// children: [
// {
// label: '',
// onClick: () => {
// this.setToolActive('Probe')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('Length')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('Angle')
// }
// },
// {
// label: 'Cobb',
// onClick: () => {
// this.setToolActive('CobbAngle')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('EllipticalRoi')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('RectangleRoi')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('FreehandRoi')
// }
// },
// {
// label: '线',
// onClick: () => {
// this.setToolActive('Bidirectional')
// }
// },
// {
// label: '',
// onClick: () => {
// this.setToolActive('ArrowAnnotate')
// }
// }
// ]
// },
// {
// label: '',
// divided: true,
// onClick: () => {
// this.setToolActive('Wwwc')
// }
// },
// {
// label: '',
// divided: true,
// onClick: () => {
// this.toggleInvert()
// }
// },
// {
// label: '',
// children: colorItems
// }
// ],
// event,
// // x: event.clientX,
// // y: event.clientY,
// customClass: 'class-a',
// zIndex: 3,
// minWidth: 100
// })
return false
},
getToolSate() {