2 # @file bshow_voxels.tcl
4 # @brief Procedures to record voxel values in Bshow.
6 # @author Bernard Heymann
7 # @date Created: 20101202
8 # @date Modified: 20200117
10 ## @brief Handles selections from the image data.
17 global line_width trace_line
18 set c [getImageCanvas $theimg]
22 if ![winfo exists $w] {
26 pack $w.frame -expand yes -fill both -padx 1 -pady 1
27 text $w.text -width 60 -height 24 -wrap none -undo 1 -background white\
28 -xscrollcommand "$w.xscroll set" \
29 -yscrollcommand "$w.yscroll set" \
30 -setgrid 1 -highlightthickness 0 -pady 2 -padx 3
31 scrollbar $w.xscroll -command "$w.text xview" \
32 -highlightthickness 0 -orient horizontal
33 scrollbar $w.yscroll -command "$w.text yview" \
34 -highlightthickness 0 -orient vertical
36 grid $w.text -in $w.frame -padx 1 -pady 1 \
37 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
38 grid $w.xscroll -in $w.frame -padx 1 -pady 1 \
39 -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news
40 grid $w.yscroll -in $w.frame -padx 1 -pady 1 \
41 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
42 grid rowconfig $w.frame 0 -weight 1 -minsize 0
43 grid columnconfig $w.frame 0 -weight 1 -minsize 0
46 checkbutton $w.type.line -text "Line" -variable trace_line
47 setupEntry $w.type.width "Width" double $line_width "Width of line"
50 button $w.buttons.save -text Save -command "saveAsTextFile $w.text"
51 # button $w.buttons.clear -text Clear -command "$w.text delete 1.0 end"
52 button $w.buttons.clear -text Clear -command "clearVoxelText $w"
53 button $w.buttons.close -text Close -command "destroy $w"
55 pack $w.type.line $w.type.width -side left -expand 1
56 # pack $w.type.line -side left -expand 1
57 pack $w.buttons.save $w.buttons.clear $w.buttons.close -side left -expand 1
58 pack $w.buttons $w.type -side bottom -fill x -pady 2m
64 wm title $w "Record voxels"
65 wm iconname $w "Voxels"
66 .menuBar.window entryconfigure "Voxels" -state normal
67 bind $c <1> "mousePressed %W %x %y"
68 bind $w <Control-w> { destroy $w }
71 proc clearVoxelText { w } {
72 $w.text delete 1.0 end