12 set font12 {Helvetica 12}
13 set font12 {-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
14 set font14 {Helvetica 14}
15 eval destroy [
winfo child .]
18 menu .menuBar -tearoff 0
25 if { $filename == "{}" } {
28 if { [
string match -* $filename] } {
32 if { [
string length $filename] > 0 } {
33 set imgdir [
file dirname $filename]
39 set Bsoft [
exec printenv BSOFT]
40 if { [
string length $Bsoft] < 2 } {
41 set Bsoft /usr/local/bsoft
43 set bshow_script $Bsoft/tcltk
44 set bshow_lib $Bsoft/lib
49 set helpfile "$bshow_script/bshow.hlp"
54 load $bshow_lib/libbsoft.so Bsoft_tcl
55 load $bshow_lib/tcltk_bimage.so Bimage
56 load $bshow_lib/tcltk_bmg.so Bmg
61 source $bshow_script/bshow_file.tcl
62 source $bshow_script/bshow_param.tcl
63 source $bshow_script/bshow_scales.tcl
64 source $bshow_script/bshow_markers.tcl
65 source $bshow_script/bshow_boxes.tcl
66 source $bshow_script/bshow_filament.tcl
67 source $bshow_script/bshow_ctf.tcl
68 source $bshow_script/bshow_tomo.tcl
69 source $bshow_script/bshow_misc.tcl
76 tk_messageBox -icon info -type ok -title "About bshow" -message \
78 Image display in Tcl/Tk\n\
79 using the Bsoft library\n\
80 Bernard Heymann\n2003-08-16"
92 if { [
string length $filename] < 1 } {
return}
93 set scale [.scale.scale get]
94 set slice_num [.slice.scale get]
95 set img_num [.image.scale get]
97 if ![
winfo exists .wctf] { $c delete ellipse}
98 Bimage show theimg $img_num $slice_num $scale
99 if { $amode == "mark" } {
102 if [
winfo exists .wbox] {
105 if { $amode == "fil" } {
109 if [
winfo exists .wctf] {
115 if { $amode == "tomo" } {
128 set datatype "unknown"
131 set imgtype "mg_file"
135 pack .frame -side left -fill both -expand yes
137 . configure -menu .menuBar
139 canvas $c -width 200 -height 200 \
140 -relief sunken -borderwidth 2 \
141 -xscrollcommand ".frame.hscroll set" \
142 -yscrollcommand ".frame.vscroll set"
143 scrollbar .frame.vscroll -orient vertical -command "$c yview"
144 scrollbar .frame.hscroll -orient horiz -command "$c xview"
146 bind $c <Motion> "showCoords %W %x %y"
147 $c bind marker <Any-Enter> "$c itemconfig current -outline red"
148 $c bind marker <Any-Leave> "$c itemconfig current -outline yellow"
149 bind . <Return> { Update }
150 bind . <ButtonRelease> { Update }
154 $c config -cursor {crosshair #ffffff #ffff00}
157 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
158 grid .frame.vscroll \
159 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
160 grid .frame.hscroll \
161 -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news
162 grid rowconfig .frame 0 -weight 1 -minsize 0
163 grid columnconfig .frame 0 -weight 1 -minsize 0
166 image create photo theimg
167 $c create image 0 0 -image theimg -anchor nw -tags theimage
170 radiobutton .mode.mark -text "Markers" -variable amode \
171 -relief flat -value "mark" -command { Markers $c }
172 radiobutton .mode.part -text "Particles" -variable amode \
173 -relief flat -value "part" -command { Particles $c }
174 radiobutton .mode.fil -text "Filaments" -variable amode \
175 -relief flat -value "fil" -command { Filaments $c }
176 radiobutton .mode.ctf -text "CTF" -variable amode \
177 -relief flat -value "ctf" -command { CTF $c }
178 radiobutton .mode.tomo -text "Tomography" -variable amode \
179 -relief flat -value "tomo" -command { Tomography $c }
182 label .pixel.xtag -font $font12 -text "x"
183 label .pixel.x -text "0" -relief sunken -bd 1 -width 8 \
184 -font $font12 -anchor w
185 label .pixel.ytag -font $font12 -text "y"
186 label .pixel.y -text "0" -relief sunken -bd 1 -width 8 \
187 -font $font12 -anchor w
188 label .pixel.vtag -font $font12 -text "value"
189 label .pixel.value -text "0" -relief sunken -bd 1 -width 16 \
190 -font $font12 -anchor w
193 label .pixel_size.tag -font $font12 -text "Pixel size (A)"
194 entry .pixel_size.entry -width 10
195 .pixel_size.entry insert 0 1
197 pack .mode -side top -pady 2
198 pack .mode.mark .mode.part .mode.fil .mode.ctf .mode.tomo -side top -pady 2 -anchor w
200 pack .pixel.xtag .pixel.x .pixel.ytag .pixel.y .pixel.vtag .pixel.value \
201 -side left -pady 2 -padx 2
203 pack .pixel_size.tag .pixel_size.entry -side left -pady 5
205 pack .pixel .pixel_size .image .slice .scale .min .max -side top -fill x -pady 2
209 if { [
string first ".star" $filename] > -1 } {
210 set paramfile $filename