-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
193 lines (184 loc) · 15.1 KB
/
MainWindow.xaml
File metadata and controls
193 lines (184 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<m:MetroWindow x:Class="Cube.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:m="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:s="clr-namespace:Sparta;assembly=WarpControls"
xmlns:local="clr-namespace:Cube"
mc:Ignorable="d"
Closing="MainWindow_OnClosing"
PreviewKeyDown="MainWindow_OnPreviewKeyDown"
Title="Cube" Height="1100" Width="1000" BorderThickness="0.5" BorderBrush="{DynamicResource AccentColorBrush}">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
</ResourceDictionary.MergedDictionaries>
<Color x:Key="HighlightDarkColor">#FFFFFFFF</Color>
<Color x:Key="HighlightLightColor">#FFFFFFFF</Color>
<Color x:Key="AccentDarkColor">#FFFFFFFF</Color>
<Color x:Key="AccentColor">#FF666666</Color>
<Color x:Key="AccentColor2">#FFFFFFFF</Color>
<Color x:Key="AccentColor3">#FFFFFFFF</Color>
<Color x:Key="AccentColor4">#FF000000</Color>
<Color x:Key="LinkColor">CornflowerBlue</Color>
<SolidColorBrush x:Key="BrandingBrush" Color="{DynamicResource LinkColor}" />
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource AccentColor}" />
<Style TargetType="s:ValueSlider">
<Setter Property="Foreground" Value="Black" />
</Style>
<Style x:Key="HyperlinkLikeButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="#0066cc" />
<Setter Property="Cursor" Value="Hand" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground" Value="#3399ff" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ControlTemplate.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextDecorations" Value="Underline" />
</Style>
</ControlTemplate.Resources>
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*" />
<ColumnDefinition Width="25*" />
<ColumnDefinition Width="18*" />
<ColumnDefinition Width="15*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Name="ButtonTomogramPath" Grid.Row="0" Style="{StaticResource HyperlinkLikeButton}" Click="ButtonTomogramPath_OnClick">
<TextBlock Name="ButtonTomogramPathText" TextTrimming="CharacterEllipsis">Select tomogram...</TextBlock>
</Button>
<Button IsEnabled="False" Foreground="LightGray" Name="ButtonWarpMetaPath" Grid.Row="1" Style="{StaticResource HyperlinkLikeButton}">
<TextBlock Name="ButtonWarpMetaPathText" TextTrimming="CharacterEllipsis">Select Warp metadata...</TextBlock>
</Button>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<!--<s:ValueSlider Value="{Binding InputLowpass, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="Low-pass to {0} Å, " MinValue="1" MaxValue="9999" StepSize="1" />-->
<s:ValueSlider Value="{Binding InputAverageSlices, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="Average over {0} sclices" MinValue="1" MaxValue="1000" StepSize="1" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
<s:ValueSlider Value="{Binding DisplayIntensityMin, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="Display intensity between {0} " MinValue="-10" MaxValue="-0.01" StepSize="0.01" />
<s:ValueSlider Value="{Binding DisplayIntensityMax, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="and {0} σ" MinValue="0.01" MaxValue="10" StepSize="0.01" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
<s:ValueSlider Value="{Binding IsosurfaceThreshold, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="Isosurface at {0} σ, " MinValue="0.01" MaxValue="999" StepSize="0.01" />
<CheckBox Content="only central blob" IsChecked="{Binding CentralBlob}" VerticalAlignment="Top" />
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="2" Orientation="Horizontal">
<s:FormattedTextBlock Value="{Binding NParticles}" TextFormat="{}{0} particles, " />
<s:ValueSlider Value="{Binding BoxSize, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="{}{0} px box" MinValue="2" MaxValue="256" StepSize="2" />
</StackPanel>
<Button Name="ButtonPointsImport" Grid.Row="1" Grid.Column="2" Content="Import Coordinates" Style="{StaticResource HyperlinkLikeButton}" HorizontalAlignment="Left" Click="ButtonPointsImport_OnClick" />
<Button Name="ButtonPointsExport" Grid.Row="2" Grid.Column="2" Content="Export Coordinates" Style="{StaticResource HyperlinkLikeButton}" HorizontalAlignment="Left" Click="ButtonPointsExport_OnClick" />
<!--<Button IsEnabled="False" Foreground="LightGray" Name="ButtonSubtomoExport" Grid.Row="3" Grid.Column="2" Content="Export Sub-Tomograms" Style="{StaticResource HyperlinkLikeButton}" HorizontalAlignment="Left" />-->
<StackPanel Grid.Row="3" Grid.Column="2" Orientation="Horizontal">
<s:ValueSlider Name="SliderParticleScoreMin" Value="{Binding ParticleScoreMin, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="Limit scores to {0}" MinValue="0.0" MaxValue="10" StepSize="0.01" />
<s:ValueSlider Name="SliderParticleScoreMax" Value="{Binding ParticleScoreMax, Mode=TwoWay}" UpdateTrigger="PropertyChanged" TextFormat="–{0}" MinValue="0.0" MaxValue="10" StepSize="0.01" />
</StackPanel>
<Button IsEnabled="False" Foreground="LightGray" Name="ButtonReferencePath" Grid.Row="0" Grid.Column="3" Style="{StaticResource HyperlinkLikeButton}">
<TextBlock Name="ButtonReferencePathText" TextTrimming="CharacterEllipsis">Select reference...</TextBlock>
</Button>
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Horizontal">
<s:EditableTextBlock IsEnabled="False" Foreground="LightGray" Text="{Binding Path=ReferenceSymmetry, Mode=TwoWay}" FontSize="12" />
<TextBlock IsEnabled="False" Foreground="LightGray" Text=" symmetry"/>
</StackPanel>
<CheckBox IsEnabled="False" Foreground="LightGray" Grid.Row="2" Grid.Column="3" IsChecked="{Binding DoSnap, Mode=TwoWay}" Content="Snap" />
</Grid>
<Grid Name="GridDisplay" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Name="MainGridRow0" MinHeight="50" Height="3*" />
<RowDefinition Name="MainGridRow1" MinHeight="50" Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Name="MainGridColumn0" MinWidth="50" Width="1*" />
<ColumnDefinition Name="MainGridColumn1" MinWidth="50" Width="3*" />
</Grid.ColumnDefinitions>
<GridSplitter Grid.Row="0" Grid.Column="1" ResizeBehavior="PreviousAndCurrent" ResizeDirection="Columns" Width="3" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<GridSplitter Grid.Row="0" Grid.Column="1" ResizeBehavior="CurrentAndNext" ResizeDirection="Rows" Width="Auto" Height="3" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<Canvas Name="CanvasZY" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="True" Margin="2">
<Image Name="ImageZY" Cursor="None" MouseWheel="ImageZY_OnMouseWheel" MouseDown="Image_OnMouseDown" MouseUp="Image_OnMouseUp" MouseLeave="Image_OnMouseLeave" MouseMove="ImageZY_OnMouseMove" MouseEnter="ImageZY_OnMouseEnter" />
<Canvas Name="CanvasOverlayZY">
<Line Name="CrosshairZYZ" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
<Line Name="CrosshairZYY" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
</Canvas>
<Canvas Name="CanvasParticlesZY" />
<s:ValueSlider Canvas.Top="0" Canvas.Left="0" Name="SliderPlaneX" TextFormat="X = {0}" Value="{Binding PlaneX, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Padding="4,0,4,2" />
</Canvas>
<Canvas Name="CanvasXY" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="True" SizeChanged="CanvasXY_OnSizeChanged" Margin="2">
<Image Name="ImageXY" Cursor="None" MouseWheel="ImageXY_OnMouseWheel" MouseDown="Image_OnMouseDown" MouseUp="Image_OnMouseUp" MouseLeave="Image_OnMouseLeave" MouseMove="ImageXY_OnMouseMove" MouseEnter="ImageXY_OnMouseEnter" />
<Canvas Name="CanvasOverlayXY">
<Line Name="CrosshairXYX" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
<Line Name="CrosshairXYY" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
</Canvas>
<Canvas Name="CanvasParticlesXY" />
<s:ValueSlider Canvas.Top="0" Canvas.Left="0" Name="SliderPlaneZ" TextFormat="Z = {0}" Value="{Binding PlaneZ, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Padding="4,0,4,2" />
</Canvas>
<Canvas Name="CanvasXZ" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="True" Margin="2">
<Image Name="ImageXZ" Cursor="None" MouseWheel="ImageXZ_OnMouseWheel" MouseDown="Image_OnMouseDown" MouseUp="Image_OnMouseUp" MouseLeave="Image_OnMouseLeave" MouseMove="ImageXZ_OnMouseMove" MouseEnter="ImageXZ_OnMouseEnter" />
<Canvas Name="CanvasOverlayXZ">
<Line Name="CrosshairXZX" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
<Line Name="CrosshairXZZ" StrokeThickness="1" Stroke="Orange" Opacity="0.3" IsHitTestVisible="False" />
</Canvas>
<Canvas Name="CanvasParticlesXZ" />
<s:ValueSlider Canvas.Top="0" Canvas.Left="0" Name="SliderPlaneY" TextFormat="Y = {0}" Value="{Binding PlaneY, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Padding="4,0,4,2" />
</Canvas>
<Grid Grid.Row="1" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Name="ParticleGridRow0" />
<RowDefinition Name="ParticleGridRow1" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Name="ParticleGridColumn0" />
<ColumnDefinition Name="ParticleGridColumn1" />
</Grid.ColumnDefinitions>
<Image Name="ImageParticleZY" Grid.Row="0" Grid.Column="0" Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<s:ValueSlider Grid.Row="0" Grid.Column="0" Name="SliderParticleX" TextFormat="X = {0}" Value="{Binding ParticlePlaneX, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Margin="2" Padding="4,0,4,2" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Image Name="ImageParticleXY" Grid.Row="0" Grid.Column="1" Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<s:ValueSlider Grid.Row="0" Grid.Column="1" Name="SliderParticleZ" TextFormat="Z = {0}" Value="{Binding ParticlePlaneZ, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Margin="2" Padding="4,0,4,2" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Image Name="ImageParticleXZ" Grid.Row="1" Grid.Column="1" Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<s:ValueSlider Grid.Row="1" Grid.Column="1" Name="SliderParticleY" TextFormat="Y = {0}" Value="{Binding ParticlePlaneY, Mode=TwoWay}" UpdateTrigger="PropertyChanged" MinValue="0" StepSize="1" Background="White" Margin="2" Padding="4,0,4,2" HorizontalAlignment="Left" VerticalAlignment="Top" />
<WindowsFormsHost Grid.Row="1" Grid.Column="0" Name="ViewportHost" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2" Initialized="ViewportHost_OnInitialized" />
</Grid>
</Grid>
<Grid Name="GridProcessingOverlay" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White" Opacity="0.6" Visibility="Hidden">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<m:ProgressRing/>
<TextBlock Name="TextProcessingMessage" FontSize="20" Margin="0,30" />
</StackPanel>
</Grid>
</Grid>
</m:MetroWindow>