SettingWindow.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <Window x:Class="AIDiagnosisDemo.Presentation.SettingWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:extensions="clr-namespace:AIDiagnosisDemo.Extensions"
  7. mc:Ignorable="d"
  8. Title="系统设置" Height="580" Width="430" WindowStartupLocation="CenterScreen">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="*" />
  12. <RowDefinition Height="Auto" />
  13. </Grid.RowDefinitions>
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="*" />
  16. </Grid.ColumnDefinitions>
  17. <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
  18. <StackPanel Margin="5">
  19. <GroupBox Header="超声图像来源">
  20. <StackPanel>
  21. <StackPanel Orientation="Horizontal">
  22. <TextBlock Text="图像来源" Margin="5" Width="120" VerticalAlignment="Center" ></TextBlock>
  23. <ComboBox Width="230" VerticalAlignment="Center" ItemsSource="{Binding UltrasoundImageSourceTypeList, Converter={extensions:SourceTypeListToStringListConverter}}" HorizontalContentAlignment="Center"
  24. Cursor="Hand" SelectedItem="{Binding UltrasoundImageSourceType, Converter={extensions:SourceTypeToStringConverter}}" />
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal">
  27. <TextBlock Text="输入源" Margin="5" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  28. <StackPanel Orientation="Horizontal" Visibility="{Binding IsDeviceSelected,Converter={extensions:BoolToVisibilityConverter},ConverterParameter=Reverse}">
  29. <TextBox Height="25" Margin="5" Width="185" VerticalAlignment="Center" Text="{Binding VideoFilePath}" ToolTip="{Binding VideoFilePath}" IsReadOnly="True" />
  30. <Button Margin="5" Content="浏览" Width="35" Command="{Binding BrowseCommand}" />
  31. </StackPanel>
  32. <ComboBox Margin="5" Width="230" VerticalAlignment="Center" ItemsSource="{Binding DeviceSourceList}" SelectedItem="{Binding UltrasoundImageSource}" HorizontalContentAlignment="Center"
  33. DisplayMemberPath="Name" Visibility="{Binding IsDeviceSelected,Converter={extensions:BoolToVisibilityConverter}}" />
  34. </StackPanel>
  35. </StackPanel>
  36. </GroupBox>
  37. <GroupBox Header="AI功能设定">
  38. <StackPanel Orientation="Vertical">
  39. <StackPanel Orientation="Horizontal">
  40. <TextBlock Margin="5" Text="启用AI诊断" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  41. <CheckBox Margin="5" VerticalAlignment="Center" IsChecked="{Binding IsEnableAI}" HorizontalAlignment="Center" ></CheckBox>
  42. </StackPanel>
  43. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  44. <TextBlock Margin="5" Text="AI性能" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  45. <ComboBox Margin="5" Width="230" VerticalAlignment="Center" SelectedValue="{Binding Performance}" SelectedValuePath="Tag"
  46. Cursor="Hand" HorizontalContentAlignment="Center">
  47. <ComboBoxItem Content="低" Tag="Low" />
  48. <ComboBoxItem Content="中" Tag="Medium" />
  49. <ComboBoxItem Content="较高" Tag="High" />
  50. <ComboBoxItem Content="高" Tag="Maximum" />
  51. </ComboBox>
  52. </StackPanel>
  53. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  54. <TextBlock Margin="5" Text="去除超声图像无效区域" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  55. <CheckBox Margin="5" IsChecked="{Binding CropImage}" FontSize="10" Foreground="Gray" Content="(启用此设置可兼容各种超声图像,但会降低性能)"></CheckBox>
  56. </StackPanel>
  57. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  58. <TextBlock Margin="5" Text="检测模式" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  59. <ComboBox Margin="5" Width="230" VerticalAlignment="Center" SelectedValue="{Binding DetectMode}" SelectedValuePath="Tag"
  60. Cursor="Hand" HorizontalContentAlignment="Center">
  61. <ComboBoxItem Content="按每秒频次计算" Tag="TimesPerSecond" />
  62. <ComboBoxItem Content="按时间间隔计算" Tag="PeriodicIntervals" />
  63. </ComboBox>
  64. </StackPanel>
  65. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  66. <TextBlock Margin="5" Text="超声图像检测间隔" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  67. <StackPanel Orientation="Horizontal" Visibility="{Binding IsIntervalTimeMode,Converter={extensions:BoolToVisibilityConverter}}">
  68. <TextBox Height="25" Margin="5" Width="185" VerticalAlignment="Center" Text="{Binding IntervalTime}" HorizontalContentAlignment="Center" />
  69. <TextBlock Margin="5" Text="ms" VerticalAlignment="Center" Width="35" />
  70. </StackPanel>
  71. <ComboBox Width="230" VerticalAlignment="Center" SelectedValue="{Binding DetectTps}" SelectedValuePath="Content"
  72. Cursor="Hand" HorizontalContentAlignment="Center" Visibility="{Binding IsIntervalTimeMode,Converter={extensions:BoolToVisibilityConverter},ConverterParameter=Reverse}">
  73. <ComboBoxItem Content="1" />
  74. <ComboBoxItem Content="2" />
  75. <ComboBoxItem Content="3" />
  76. <ComboBoxItem Content="4" />
  77. <ComboBoxItem Content="5" />
  78. </ComboBox>
  79. </StackPanel>
  80. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  81. <TextBlock Margin="5" Text="显示脏器轮廓" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  82. <CheckBox Margin="5" VerticalAlignment="Center" IsChecked="{Binding IsShowOrgansContour}" HorizontalAlignment="Center" ></CheckBox>
  83. </StackPanel>
  84. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  85. <TextBlock Margin="5" Text="病灶显示" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  86. <ComboBox Margin="5" Width="230" VerticalAlignment="Center" SelectedValue="{Binding ShowLesions}" SelectedValuePath="Tag"
  87. Cursor="Hand" HorizontalContentAlignment="Center">
  88. <ComboBoxItem Content="轮廓" Tag="Contour" />
  89. <ComboBoxItem Content="边框" Tag="Border" />
  90. </ComboBox>
  91. </StackPanel>
  92. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  93. <TextBlock Margin="5" Text="AI识别类型" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  94. <ComboBox Margin="5" Width="230" VerticalAlignment="Center" SelectedValue="{Binding AIDiagnosisType}" SelectedValuePath="Tag"
  95. Cursor="Hand" HorizontalContentAlignment="Center">
  96. <ComboBoxItem Content="常规" Tag="Normal" />
  97. <ComboBoxItem Content="心肌" Tag="Myocardial" />
  98. <ComboBoxItem Content="小鼠心肌" Tag="MiceMyocardial" />
  99. <ComboBoxItem Content="大鼠心肌" Tag="RatMyocardial" />
  100. <ComboBoxItem Content="甲状腺切面" Tag="ThyroidClassification" />
  101. <ComboBoxItem Content="脏器识别" Tag="OrganIdentification" />
  102. </ComboBox>
  103. </StackPanel>
  104. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsEnableAI}">
  105. <TextBlock Margin="5" Text="心肌圆环形是否补全" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  106. <CheckBox Margin="5" VerticalAlignment="Center" IsChecked="{Binding CompleteMyocardialImg}" HorizontalAlignment="Center" />
  107. </StackPanel>
  108. </StackPanel>
  109. </GroupBox>
  110. <GroupBox Header="模拟占用">
  111. <StackPanel Orientation="Vertical">
  112. <StackPanel Orientation="Horizontal">
  113. <TextBlock Margin="5" Text="启用模拟占用" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  114. <CheckBox Margin="5" VerticalAlignment="Center" IsChecked="{Binding IsSimulation}" HorizontalAlignment="Center" ></CheckBox>
  115. </StackPanel>
  116. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsSimulation}">
  117. <TextBlock Margin="5" Text="CPU占用(10%-90%)" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  118. <ComboBox Width="230" VerticalAlignment="Center" SelectedValue="{Binding CPUUsed}" SelectedValuePath="Tag"
  119. Cursor="Hand" HorizontalContentAlignment="Center">
  120. <ComboBoxItem Content="0%" Tag="0" />
  121. <ComboBoxItem Content="10%" Tag="10" />
  122. <ComboBoxItem Content="20%" Tag="20" />
  123. <ComboBoxItem Content="30%" Tag="30" />
  124. <ComboBoxItem Content="40%" Tag="40" />
  125. <ComboBoxItem Content="50%" Tag="50" />
  126. <ComboBoxItem Content="60%" Tag="60" />
  127. <ComboBoxItem Content="70%" Tag="70" />
  128. <ComboBoxItem Content="80%" Tag="80" />
  129. <ComboBoxItem Content="90%" Tag="90" />
  130. </ComboBox>
  131. </StackPanel>
  132. <StackPanel Orientation="Horizontal" IsEnabled="{Binding IsSimulation}">
  133. <TextBlock Margin="5" Text="内存占用(10%-90%)" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
  134. <ComboBox Width="230" VerticalAlignment="Center" SelectedValue="{Binding RAMUsed}" SelectedValuePath="Tag"
  135. Cursor="Hand" HorizontalContentAlignment="Center">
  136. <ComboBoxItem Content="0%" Tag="0" />
  137. <ComboBoxItem Content="10%" Tag="10" />
  138. <ComboBoxItem Content="20%" Tag="20" />
  139. <ComboBoxItem Content="30%" Tag="30" />
  140. <ComboBoxItem Content="40%" Tag="40" />
  141. <ComboBoxItem Content="50%" Tag="50" />
  142. <ComboBoxItem Content="60%" Tag="60" />
  143. <ComboBoxItem Content="70%" Tag="70" />
  144. <ComboBoxItem Content="80%" Tag="80" />
  145. <ComboBoxItem Content="90%" Tag="90" />
  146. </ComboBox>
  147. </StackPanel>
  148. </StackPanel>
  149. </GroupBox>
  150. </StackPanel>
  151. </ScrollViewer>
  152. <Grid Grid.Row="1" HorizontalAlignment="Center">
  153. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  154. <Button Margin="5" Height="25" Width="70" Content="保存并退出" Click="OnSaveAndExit" />
  155. </StackPanel>
  156. </Grid>
  157. </Grid>
  158. </Window>