当前位置:网站首页>vtk. JS left mouse button sliding to change window level and window width
vtk. JS left mouse button sliding to change window level and window width
2022-06-23 07:53:00 【Xiaojiangjiang 12】
var that = this;
function DragObj(selector) {
// Save node
this.ele = $(selector).get(0);
// call startDrag
this.startDrag();
}
/* encapsulation startDrag Method */
DragObj.prototype.startDrag = function () {
var self = this;
// Add... To the node of the current object mousedown event , Execute sliding event after mouse down event
$(self.ele).on({
mousedown: function () {
self.drag();
}
})
}
/* Encapsulate sliding events */
DragObj.prototype.drag = function () {
var self = this;
/* initialization self.newDisance*/
self.newDisance = {
X:that.vtkObj['imageActorI'].getProperty().getColorLevel(),
Y:that.vtkObj['imageActorI'].getProperty().getColorWindow()
}
// to X Add move and end events to window objects
$('#contentX').on({
/* According to the moving distance, judge whether to increase or decrease the grayscale , To the left and right wl, Up and down for ww*/
mousemove: function (oEvent) {
if(self.disance && self.disance.X){
self.newDisance.X = that.vtkObj['imageActorI'].getProperty().getColorLevel() + (oEvent.pageX - self.disance.X);
self.newDisance.Y = that.vtkObj['imageActorI'].getProperty().getColorWindow() + (oEvent.pageY - self.disance.Y);
}
self.disance = {
X: oEvent.pageX,
Y: oEvent.pageY
};
// Sagittal plane , Coronal plane , The axial plane changes the window level and window width at the same time
['X','Y','Z'].forEach((type) => {
that.vtkObj['imageActor' + that.typeMap[type]].getProperty().setColorLevel(self.newDisance.X);
that.vtkObj['imageActor' + that.typeMap[type]].getProperty().setColorWindow(self.newDisance.Y);
})
$(".colorLevel").val(self.newDisance.X);
$(".colorWindow").val(self.newDisance.Y);
},
mouseup: function () {
/* Reset the distance after releasing the mouse , Let it recalculate */
self.disance = {};
self.newDisance = {
X:that.vtkObj['imageActorI'].getProperty().getColorLevel(),
Y:that.vtkObj['imageActorI'].getProperty().getColorWindow()
};
$("#contentX").off('mousemove mouseup');
}
})
}
new DragObj('#contentX');
边栏推荐
- 2. probability theory - axiom of probability theory
- 【Kubernetes】Kubernetes各大版本的最新版本下载地址
- What is customer experience automation?
- Minio single node deployment Minio distributed deployment fool deployment process (I)
- Start appium
- EXCEL VBA 入门与实用例子
- 【云计算赛项】职业技能竞赛--容器开发部分例题Pig快速开发框架
- NFS special attention to permissions
- Introduction to Excel VBA and practical examples
- Matlab随机波动率SV、GARCH用MCMC马尔可夫链蒙特卡罗方法分析汇率时间序列
猜你喜欢
![[cloud computing event] vocational skill competition -- container development example pig rapid development framework](/img/4b/393b5980090330602a501867c60089.png)
[cloud computing event] vocational skill competition -- container development example pig rapid development framework

The sandbox has reached a cooperation with football player to bring popular football cartoons and animation into the metauniverse

QT reading XML files using qdomdocument

启动appium

Learn to draw Er graph in an article

Matlab random volatility SV, GARCH using MCMC Markov chain Monte Carlo method to analyze exchange rate time series

Design of temperature detection and alarm system based on 51 single chip microcomputer
![[interface automation] software testing the core skills of salary increase to increase salary by 200%](/img/22/be8c5c922307225c34f6205f189c33.png)
[interface automation] software testing the core skills of salary increase to increase salary by 200%
![Acwing game 56 [End]](/img/f6/cd650331c819a27f17c9ce6cd0c569.png)
Acwing game 56 [End]

Chain tour airship development farmers' world chain tour development land chain tour development
随机推荐
Online text filter less than specified length tool
一秒钟查看一次文件,并将文件最后一行内容结果发送至syslog服务器
[深度学习][原创]如何不用yolov5权重或者模型进行目标检测和绘制map等参数图
MySQL gets the system time period
Acwing第 56 場周賽【完結】
What is customer experience automation?
MySQL系统表介绍
Query on the performance of multi table view in MySQL
HCIP之路MPLS
PHP 文件包含 -ctf
Mathematical knowledge: Euler function - Euler function
Vs problems when connecting to SQL myconn OPen(); cannot execute
Match 56 de la semaine d'acwing [terminé]
聊聊服务治理中的路由设计
Hcip Road
HCIP之路
【Kubernetes】Kubernetes各大版本的最新版本下载地址
数学知识:快速幂求逆元—快速幂
[pit stepping record] a pit where the database connection is not closed and resources are released
抓包发现tcp会话中老是出现重复的ack和大量的tcp重传——SACK(Selective Acknowledgment, 选择性确认)技术