📄 unit10.pas
字号:
unit Unit10;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, StrUtils;
type
TfrmWindowingPreset = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
cbModality: TComboBox;
GroupBox1: TGroupBox;
ListBox1: TListBox;
edtWidth: TEdit;
edtLevel: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure FormShow(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure cbModalityClick(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmWindowingPreset: TfrmWindowingPreset;
iW,iL : Integer;
implementation
uses Unit1;
{$R *.dfm}
procedure TfrmWindowingPreset.FormShow(Sender: TObject);
begin
iL := Form1.DICOMX1.ImageWinCenter;
iW := Form1.DICOMX1.ImageWinWidth;
Label4.Caption := '';
cbModality.ItemIndex := 0;
cbModality.OnClick(Self);
Button2.SetFocus;
end;
procedure TfrmWindowingPreset.Button2Click(Sender: TObject);
begin
Form1.DICOMX1.ImageWinCenter := iL;
Form1.DICOMX1.ImageWinWidth := iW;
frmWindowingPreset.Close;
end;
procedure TfrmWindowingPreset.cbModalityClick(Sender: TObject);
begin
ListBox1.Clear;
Label4.Caption := '';
edtWidth.Text := '';
edtLevel.Text := '';
Case cbModality.ItemIndex of
0: //CT
begin
ListBox1.Items.Append('Abdomen [250,45]');
ListBox1.Items.Append('Brain [80,40]');
ListBox1.Items.Append('Bone [4000,500]');
ListBox1.Items.Append('Chest [350,40]');
ListBox1.Items.Append('Crane [100,35]');
ListBox1.Items.Append('Head [350,90]');
ListBox1.Items.Append('Lung [2000,-500]');
ListBox1.Items.Append('Medisstinum [440,45]');
ListBox1.Items.Append('Pelvis [300,45]');
end;
1:
begin
end;
2:
begin
end;
3: //US
begin
ListBox1.Items.Append('Low [190,80]');
ListBox1.Items.Append('Med [160,70]');
ListBox1.Items.Append('High [120,60]');
end;
4:
begin
end;
5:
begin
end;
6:
begin
end;
7:
begin
end;
8:
begin
end;
end;
end;
procedure TfrmWindowingPreset.ListBox1Click(Sender: TObject);
var
sTmp :String;
begin
sTmp := ListBox1.Items.Strings[ListBox1.ItemIndex];
if sTmp='' then
Exit;
Label4.Caption := LeftStr(sTmp,Pos('[',sTmp)-2);
edtWidth.Text := MidStr(sTmp,Pos('[',sTmp)+1,(Pos(',',sTmp)-Pos('[',sTmp)-1));
edtLevel.Text := MidStr(sTmp,Pos(',',sTmp)+1,Pos(']',sTmp)-Pos(',',sTmp)-1);
try
Form1.DICOMX1.ImageWinWidth := StrToInt(edtWidth.Text);
Form1.DICOMX1.ImageWinCenter := StrToInt(edtLevel.Text);
finally
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -