OSDN Git Service

Display2: Mode v2.3.30p0223
authorTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Sat, 21 Nov 2015 00:21:08 +0000 (09:21 +0900)
committerTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Sat, 21 Nov 2015 00:21:08 +0000 (09:21 +0900)
modified:   bin/wish/Display2/Display2.wish
modified:   bin/wish/Display2/Display2Image.wish
modified:   bin/wish/Display2/Display2Init.wish
modified:   bin/wish/Display2/RoiAreaCreate.wish
modified:   bin/wish/Display2/RoiAreaFile.wish
modified:   bin/wish/Display2/tclIndex
modified:   src/Objects/DataExpress/TclTk/src/tclUtil.wish
modified:   src/Tools/Integration/Display2/src/wish/Display2.wish
modified:   src/Tools/Integration/Display2/src/wish/Display2Image.wish
modified:   src/Tools/Integration/Display2/src/wish/Display2Init.wish
modified:   src/Tools/Integration/Display2/src/wish/RoiAreaCreate.wish
modified:   src/Tools/Integration/Display2/src/wish/RoiAreaFile.wish

12 files changed:
bin/wish/Display2/Display2.wish
bin/wish/Display2/Display2Image.wish
bin/wish/Display2/Display2Init.wish
bin/wish/Display2/RoiAreaCreate.wish
bin/wish/Display2/RoiAreaFile.wish
bin/wish/Display2/tclIndex
src/Objects/DataExpress/TclTk/src/tclUtil.wish
src/Tools/Integration/Display2/src/wish/Display2.wish
src/Tools/Integration/Display2/src/wish/Display2Image.wish
src/Tools/Integration/Display2/src/wish/Display2Init.wish
src/Tools/Integration/Display2/src/wish/RoiAreaCreate.wish
src/Tools/Integration/Display2/src/wish/RoiAreaFile.wish

index 7cf9afb..3298a7a 100755 (executable)
@@ -2,6 +2,10 @@
 ## Environment Set 
 set CurrentDir [ pwd ]
 set tcl_precision 17
+
+global debugMode
+set debugMode 0 
+
 #puts "CurrentDir: $CurrentDir"        
 
 # Tcl/Tk library Directory
index 1f345e8..38b9dea 100755 (executable)
@@ -86,20 +86,21 @@ proc mainImagePut { c fileName { mode 0 } } {
 proc overviewImagePut { c fileName { mode 0 } }  {
        global mainImage 
        global overviewImage
+       global Desktop
 
        if {$overviewImage(image) == "No"} {
        } else {
                image delete $overviewImage(image)
        }
-       set stepx [ expr $mainImage(width)/128 ]
-       set stepy [ expr $mainImage(height)/128 ]
+       set stepx [ expr $mainImage(width)/$Desktop(overviewCanvasX)]
+       set stepy [ expr $mainImage(height)/$Desktop(overviewCanvasY)]
        if {$stepx > $stepy } { 
                set step $stepx 
        } else { 
                set step $stepy 
        } 
        set overviewImage(image) [ image create photo -palette 8 ]
-       $overviewImage(image) copy $mainImage(image) -from 0 0 $mainImage(width) $mainImage(height) -to 0 0 127 127 -subsample $step
+       $overviewImage(image) copy $mainImage(image) -from 0 0 $mainImage(width) $mainImage(height) -to 0 0 [expr $Desktop(overviewCanvasX) - 1 ] [expr $Desktop(overviewCanvasY) - 1] -subsample $step
        $c.canvas create image 0 0 -image $overviewImage(image) -anchor nw
        set overviewImage(canvas) $c.canvas
 }
index 109d8c3..ec15fcc 100755 (executable)
@@ -10,7 +10,7 @@ proc display2SetVar {} {
        global Zoom
 
 
-       #puts "display2SetVar Start"    
+       debugPrint "display2SetVar Start"       
        if [ info exists thresHigh ] {
                set mainImage(thresHigh) $thresHigh
        } 
@@ -23,7 +23,7 @@ proc display2SetVar {} {
        if { [ info exists Zoom ] } {
                set Roi(Zoom) $Zoom 
        }
-       #puts "display2SetVar End"      
+       debugPrint "display2SetVar End" 
 }
 
 # Set
@@ -57,37 +57,17 @@ proc display2InitVar {} {
        global Zoom 
 
        
-       #puts "display2InitVar Start"   
+       debugPrint "display2InitVar Start"      
 
        set tcl_precision 17 
 
        # Canvas Area Create
-       if [ info exists Desktop(mainCanvasX) ] {
-               set Desktop(mainCanvasX) $Desktop(mainCanvasX)  
-       } else  {
-               set Desktop(mainCanvasX) 1999
-       }
-       if [ info exists Desktop(mainCanvasY) ] {
-               set Desktop(mainCanvasY) $Desktop(mainCanvasY)
-       } else {
-               set Desktop(mainCanvasY) 1999 
-       }
-
-
-       Canvas .overview_canvas 128 128
-       Canvas .zoom_canvas     128 128
-
-       scrolledCanvas .main_canvas 128 128 [ list 0  0 $Desktop(mainCanvasX) $Desktop(mainCanvasY) ]
-
-       set Desktop(mainCanvas)      .main_canvas
-       set Desktop(overviewCanvas)  .overview_canvas
-       set Desktop(zoomCanvas)      .zoom_canvas
-
-       # mrcImage Set
-       set mainImage(mainCanvas)     .main_canvas
-       set mainImage(overviewCanvas) .overview_canvas
-       set mainImage(zoomCanvas)     .zoom_canvas
-
+       set Desktop(mainCanvasX) 1999
+       set Desktop(mainCanvasY) 1999 
+       set Desktop(overviewCanvasX) 128 
+       set Desktop(overviewCanvasY) 128 
+       set Desktop(sizeX) 128 
+       set Desktop(sizeY) 128
 
        set overviewImage(image)  No
 
@@ -123,7 +103,7 @@ proc display2InitVar {} {
        set mousePressed(endy) 0
 
        # Roi
-       set Roi(Canvas) $Desktop(mainCanvas).canvas
+       #set Roi(Canvas) $Desktop(mainCanvas).canvas
        set Roi(CurrentObject)  0
        set Roi(OKColor)      #118866
        set Roi(SelectColor)  #0000ff
@@ -230,23 +210,23 @@ proc display2InitVar {} {
     set Section(Win,Title) "Section Information"
 
 
-       #puts "display2InitVar End"     
+       debugPrint "display2InitVar End"        
 }
 
 proc display2InitVarSet  { filename } {
-       #puts "display2InitVarSet Start"
+       debugPrint "display2InitVarSet Start"
 
        if [ file isdirectory "~/.Eos/" ] {
-               puts "Already dir"      
+               debugPrint "Already dir ~/.Eos/"        
        } else {
-               #puts "mkdir"
+               puts "~/.Eos/ is created as default dir."
                file mkdir "~/.Eos"
        }
 
-       #puts "$filename"
+       debugPrint "$filename"
        set fpt [ open $filename a ]
 
-       #puts "Set Start"
+       debugPrint "Set Start"
 puts $fpt {
 #
 # Default
@@ -255,6 +235,14 @@ puts $fpt {
 # Precision
 set tcl_precision 17 
 
+# Canvas Area Create
+set Desktop(mainCanvasX) 1999
+set Desktop(mainCanvasY) 1999 
+set Desktop(overviewCanvasX) 128 
+set Desktop(overviewCanvasY) 128 
+set Desktop(sizeX) 128 
+set Desktop(sizeY) 128 
+
 # Image 
 set mainImage(thresHigh) No
 set mainImage(thresLow)  No
@@ -345,9 +333,37 @@ set Section(atDelta)      1
 set Section(mode)    normal 
 }
        close $fpt
-       puts "display2InitVarSet End"
+       debugPrint "display2InitVarSet End"
 }
 
+
+
+proc diplay2CanvasInit { } {
+       global Desktop
+       global Roi
+       global mainImage 
+
+       debugPrint "display2CanvasInit Start"
+       debugPrint "main     $Desktop(mainCanvasX) $Desktop(mainCanvasY)"
+       debugPrint "overview $Desktop(overviewCanvasX) $Desktop(overviewCanvasY)"
+
+       Canvas .overview_canvas $Desktop(overviewCanvasX) $Desktop(overviewCanvasY) 
+       Canvas .zoom_canvas     $Desktop(overviewCanvasX) $Desktop(overviewCanvasY) 
+
+       scrolledCanvas .main_canvas  $Desktop(sizeX)  $Desktop(sizeY) [ list 0  0 $Desktop(mainCanvasX) $Desktop(mainCanvasY) ]
+
+       set Desktop(mainCanvas)      .main_canvas
+       set Desktop(overviewCanvas)  .overview_canvas
+       set Desktop(zoomCanvas)      .zoom_canvas
+
+       # mrcImage Set
+       set mainImage(mainCanvas)     .main_canvas
+       set mainImage(overviewCanvas) .overview_canvas
+       set mainImage(zoomCanvas)     .zoom_canvas
+
+       set Roi(Canvas) $Desktop(mainCanvas).canvas
+}
 proc display2Init {} {
        global mousePressed
        global Roi
@@ -378,23 +394,31 @@ proc display2Init {} {
        
        global defaultFile
 
+       # Initial Variables
        display2InitVar 
+       debugPrint "display2InitVar End"
 
+       # Load variables from defaultFile
        if [ info exists defaultFile ] {
-               puts "Already Exist $defaultFile"
+               debugPrint "Already Exist a variable, defaultFile"
        } else {
                set defaultFile "~/.Eos/Display2"
        }
        if [ file exists $defaultFile ] {
                #
+               debugPrint "Load parameters from $defaultFile"  
        } else {
+               # Create initial ~/.Eos/Display2 
                display2InitVarSet $defaultFile
        }
        source $defaultFile
 
        # from arguments
        display2SetVar
-       
+
+       # CanvasCreate
+       diplay2CanvasInit
+
        display2MenuSet
        display2MenuSet2
        display2BindingSet .main_canvas.canvas
index e060c77..5660566 100755 (executable)
@@ -27,7 +27,7 @@ proc roiAreaCreateStart {c x y} {
                Rectangle {
                        if { $Roi(SizeLock) == "On" } {
                                global rectanglePoints
-                               #puts "SizeLock Start: $mousePressed(startx)  $mousePressed(starty)"
+                               debugPrint "SizeLock Start: $mousePressed(startx)  $mousePressed(starty)"
                                set Roi(CurrentObject) [roiRectangleCreate $c \
                                        [expr $mousePressed(startx)-$rectanglePoints(width) /2 ] \
                                        [expr $mousePressed(starty)-$rectanglePoints(height)/2 ] \
@@ -51,7 +51,7 @@ proc roiAreaCreateStart {c x y} {
                                $mousePressed(startx) $mousePressed(starty)]
                }
                default {
-                       puts "Not supported Shape"
+                       puts stderr "Not supported Shape"
                }
        }
 }
@@ -90,7 +90,7 @@ proc roiAreaCreateMotion {c x y} {
                                        $mousePressed(endx)   $mousePressed(endy) ]
                        }
                        default {
-                               puts "Not supported Shape"
+                               puts stderr "Not supported Shape"
                        }
                }
        }
@@ -131,7 +131,7 @@ proc roiAreaCreateEnd {c x y} {
                                        $mousePressed(endx) $mousePressed(endy) ]
                        }
                        default {
-                               puts "Not supported Shape"
+                               puts stderr "Not supported Shape"
                        }
                }
        }
@@ -172,7 +172,7 @@ proc roiAreaRedraw { i } {
                                $Roi([subst $i],x1)  $Roi([subst $i],y1)  ] 
                }
                default {
-                       puts "Not supported in roiAreaAllRedraw"
+                       puts stderr "Not supported in roiAreaAllRedraw"
                }
        }
        switch $Roi(MultiNumber) {
@@ -211,8 +211,7 @@ proc roiRectangleCreate { c startx starty endx endy } {
        set rectanglePoints(x3) $blx
        set rectanglePoints(y3) $try
        
-       #puts $startx
-       #puts $rectanglePoints(x0)
+       debugPrint "$startx $rectanglePoints(x0)"
 
        if { $mousePressed(mode) == 2 } {
                #knobShow $c $rectanglePoints(x0) $rectanglePoints(y0)
@@ -283,7 +282,7 @@ proc roiLineCreate { c startx starty endx endy } {
 proc lineCreate { c x0 y0 x1 y1 } {
        global Roi
        set height [ lindex [ $c cget -scrollregion] 3 ]
-       #puts $Roi(LineWidth)
+       debugPrint $Roi(LineWidth)
        return [ $c create line \
                                                        [ coordGetInMainImageToCanvas $c x $x0 ]  [ coordGetInMainImageToCanvas $c y $y0 ] \
                                                        [ coordGetInMainImageToCanvas $c x $x1 ]  [ coordGetInMainImageToCanvas $c y $y1 ] \
index 3485aec..4737778 100755 (executable)
@@ -6,7 +6,7 @@ proc roiMultiAreaInfoSave { } {
        if { [ fileCanBeOverwritten $Roi(InformationFile) ] } {
                set Roi(fptInformationFile) [ open $Roi(InformationFile) w 0600 ]
        } else {
-               puts "Warning: Cannot be overwritten"
+               puts stderr "Warning: Cannot be overwritten"
                return  no
        }       
        for { set i 0 } { $i < $Roi(TotalN) } { incr i } {
@@ -28,14 +28,14 @@ proc roiMultiAreaInfoSave { } {
                                                ] 
                                }
                                default {
-                                       puts "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
+                                       puts stderr "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
                                }
                        }
                        puts  $Roi(fptInformationFile) $oneRoi 
                        flush $Roi(fptInformationFile)
-                       puts                           $oneRoi 
+                       debugPrint $oneRoi 
                } else {
-                       puts "Roi($i) doesn't exist. The last roi has not made sure yet or the number $i was not determined."
+                       puts stderr "Roi($i) doesn't exist. The last roi has not made sure yet or the number $i was not determined."
                }
        }       
        close $Roi(fptInformationFile)
@@ -49,7 +49,7 @@ proc roiMultiAreaInfoLoad { } {
        if { [ file exists $Roi(InformationFile) ] } {
                set Roi(fptInformationFile) [ open $Roi(InformationFile) r 0600 ]
        } else {
-               puts "Warning: File not found: $Roi(InformationFile) "
+               puts stderr "Warning: File not found: $Roi(InformationFile) "
                return  no
        }
        for { set i 0 } { $i < $Roi(TotalN) } { incr i } {
@@ -76,7 +76,7 @@ proc roiMultiAreaInfoLoad { } {
                                set Roi($i,y3) [ lindex $oneLineList 9 ]
                        }
                        default {
-                               puts "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
+                               puts stderr "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
                        }
                }
                incr Roi(TotalN) 
@@ -151,7 +151,7 @@ proc roiAreaFileSave {  } {
                                if { $Roi(Extract) == "foreground" } {
                                        eval exec [ list Display2 -i $Roi(OutputFile) & ] 
                                } else {
-                                       puts "Not supported because process does not run on foreground"
+                                       puts stderr "Not supported because process does not run on foreground"
                                }
                        }
                }       
@@ -162,7 +162,7 @@ proc roiAreaFileSave {  } {
                        if { [ fileCanBeOverwritten $Roi(MontageFile) ] } {
                                #
                        } else {
-                               puts "Warning: Cannot be overwritten"
+                               puts stderr "Warning: Cannot be overwritten"
                                return  no
                        }
                        #
@@ -183,12 +183,12 @@ proc roiAreaFileSave {  } {
                                if { $Roi(Extract) == "foreground" } {
                                        eval exec [ list Display2 -i $Roi(MontageFile) & ] 
                                } else {
-                                       puts "Not supported because process does not run on foreground"
+                                       puts stderr "Not supported because process does not run on foreground"
                                }
                        }
                }               
                default {
-                                       puts "Not supported"
+                                       puts stderr "Not supported"
                }       
        }       
 }
index 003cb8b..685c0e6 100644 (file)
@@ -36,6 +36,7 @@ set auto_index(roiAnalysisFrameCreate) [list source [file join $dir Display2Info
 set auto_index(display2SetVar) [list source [file join $dir Display2Init.wish]]
 set auto_index(display2InitVar) [list source [file join $dir Display2Init.wish]]
 set auto_index(display2InitVarSet) [list source [file join $dir Display2Init.wish]]
+set auto_index(diplay2CanvasInit) [list source [file join $dir Display2Init.wish]]
 set auto_index(display2Init) [list source [file join $dir Display2Init.wish]]
 set auto_index(display2MenuSet) [list source [file join $dir Display2Menu.wish]]
 set auto_index(menuFileCreate) [list source [file join $dir Display2Menu.wish]]
index 62938ca..f723812 100755 (executable)
@@ -1,10 +1,13 @@
+
 proc NotSupportedCommand { } {
        puts stderr "Not supported command"
 }
 
-proc debugPrint { s { mode 0 } } {
-       if { $mode == 1} {
-               puts $s; flush stdout
+proc debugPrint { s } {
+       global debugMode  
+
+       if { $debugMode == 1} {
+               puts stderr $s; flush stderr
        } else {
 
        }
index 7cf9afb..3298a7a 100755 (executable)
@@ -2,6 +2,10 @@
 ## Environment Set 
 set CurrentDir [ pwd ]
 set tcl_precision 17
+
+global debugMode
+set debugMode 0 
+
 #puts "CurrentDir: $CurrentDir"        
 
 # Tcl/Tk library Directory
index 1f345e8..38b9dea 100755 (executable)
@@ -86,20 +86,21 @@ proc mainImagePut { c fileName { mode 0 } } {
 proc overviewImagePut { c fileName { mode 0 } }  {
        global mainImage 
        global overviewImage
+       global Desktop
 
        if {$overviewImage(image) == "No"} {
        } else {
                image delete $overviewImage(image)
        }
-       set stepx [ expr $mainImage(width)/128 ]
-       set stepy [ expr $mainImage(height)/128 ]
+       set stepx [ expr $mainImage(width)/$Desktop(overviewCanvasX)]
+       set stepy [ expr $mainImage(height)/$Desktop(overviewCanvasY)]
        if {$stepx > $stepy } { 
                set step $stepx 
        } else { 
                set step $stepy 
        } 
        set overviewImage(image) [ image create photo -palette 8 ]
-       $overviewImage(image) copy $mainImage(image) -from 0 0 $mainImage(width) $mainImage(height) -to 0 0 127 127 -subsample $step
+       $overviewImage(image) copy $mainImage(image) -from 0 0 $mainImage(width) $mainImage(height) -to 0 0 [expr $Desktop(overviewCanvasX) - 1 ] [expr $Desktop(overviewCanvasY) - 1] -subsample $step
        $c.canvas create image 0 0 -image $overviewImage(image) -anchor nw
        set overviewImage(canvas) $c.canvas
 }
index 837f7fe..ec15fcc 100755 (executable)
@@ -10,7 +10,7 @@ proc display2SetVar {} {
        global Zoom
 
 
-       #puts "display2SetVar Start"    
+       debugPrint "display2SetVar Start"       
        if [ info exists thresHigh ] {
                set mainImage(thresHigh) $thresHigh
        } 
@@ -23,7 +23,7 @@ proc display2SetVar {} {
        if { [ info exists Zoom ] } {
                set Roi(Zoom) $Zoom 
        }
-       #puts "display2SetVar End"      
+       debugPrint "display2SetVar End" 
 }
 
 # Set
@@ -57,37 +57,17 @@ proc display2InitVar {} {
        global Zoom 
 
        
-       #puts "display2InitVar Start"   
+       debugPrint "display2InitVar Start"      
 
        set tcl_precision 17 
 
        # Canvas Area Create
-       if [ info exists Desktop(mainCanvasX) ] {
-               set Desktop(mainCanvasX) $Desktop(mainCanvasX)  
-       } else  {
-               set Desktop(mainCanvasX) 1999
-       }
-       if [ info exists Desktop(mainCanvasY) ] {
-               set Desktop(mainCanvasY) $Desktop(mainCanvasY)
-       } else {
-               set Desktop(mainCanvasY) 1999 
-       }
-
-
-       Canvas .overview_canvas 128 128
-       Canvas .zoom_canvas     128 128
-
-       scrolledCanvas .main_canvas 128 128 [ list 0  0 $Desktop(mainCanvasX) $Desktop(mainCanvasY) ]
-
-       set Desktop(mainCanvas)      .main_canvas
-       set Desktop(overviewCanvas)  .overview_canvas
-       set Desktop(zoomCanvas)      .zoom_canvas
-
-       # mrcImage Set
-       set mainImage(mainCanvas)     .main_canvas
-       set mainImage(overviewCanvas) .overview_canvas
-       set mainImage(zoomCanvas)     .zoom_canvas
-
+       set Desktop(mainCanvasX) 1999
+       set Desktop(mainCanvasY) 1999 
+       set Desktop(overviewCanvasX) 128 
+       set Desktop(overviewCanvasY) 128 
+       set Desktop(sizeX) 128 
+       set Desktop(sizeY) 128
 
        set overviewImage(image)  No
 
@@ -123,7 +103,7 @@ proc display2InitVar {} {
        set mousePressed(endy) 0
 
        # Roi
-       set Roi(Canvas) $Desktop(mainCanvas).canvas
+       #set Roi(Canvas) $Desktop(mainCanvas).canvas
        set Roi(CurrentObject)  0
        set Roi(OKColor)      #118866
        set Roi(SelectColor)  #0000ff
@@ -230,23 +210,23 @@ proc display2InitVar {} {
     set Section(Win,Title) "Section Information"
 
 
-       #puts "display2InitVar End"     
+       debugPrint "display2InitVar End"        
 }
 
 proc display2InitVarSet  { filename } {
-       #puts "display2InitVarSet Start"
+       debugPrint "display2InitVarSet Start"
 
        if [ file isdirectory "~/.Eos/" ] {
-               puts "Already dir ~/.Eos/"      
+               debugPrint "Already dir ~/.Eos/"        
        } else {
-               puts "~/.Eos/ is created."
+               puts "~/.Eos/ is created as default dir."
                file mkdir "~/.Eos"
        }
 
-       #puts "$filename"
+       debugPrint "$filename"
        set fpt [ open $filename a ]
 
-       #puts "Set Start"
+       debugPrint "Set Start"
 puts $fpt {
 #
 # Default
@@ -255,6 +235,14 @@ puts $fpt {
 # Precision
 set tcl_precision 17 
 
+# Canvas Area Create
+set Desktop(mainCanvasX) 1999
+set Desktop(mainCanvasY) 1999 
+set Desktop(overviewCanvasX) 128 
+set Desktop(overviewCanvasY) 128 
+set Desktop(sizeX) 128 
+set Desktop(sizeY) 128 
+
 # Image 
 set mainImage(thresHigh) No
 set mainImage(thresLow)  No
@@ -345,9 +333,37 @@ set Section(atDelta)      1
 set Section(mode)    normal 
 }
        close $fpt
-       #puts "display2InitVarSet End"
+       debugPrint "display2InitVarSet End"
 }
 
+
+
+proc diplay2CanvasInit { } {
+       global Desktop
+       global Roi
+       global mainImage 
+
+       debugPrint "display2CanvasInit Start"
+       debugPrint "main     $Desktop(mainCanvasX) $Desktop(mainCanvasY)"
+       debugPrint "overview $Desktop(overviewCanvasX) $Desktop(overviewCanvasY)"
+
+       Canvas .overview_canvas $Desktop(overviewCanvasX) $Desktop(overviewCanvasY) 
+       Canvas .zoom_canvas     $Desktop(overviewCanvasX) $Desktop(overviewCanvasY) 
+
+       scrolledCanvas .main_canvas  $Desktop(sizeX)  $Desktop(sizeY) [ list 0  0 $Desktop(mainCanvasX) $Desktop(mainCanvasY) ]
+
+       set Desktop(mainCanvas)      .main_canvas
+       set Desktop(overviewCanvas)  .overview_canvas
+       set Desktop(zoomCanvas)      .zoom_canvas
+
+       # mrcImage Set
+       set mainImage(mainCanvas)     .main_canvas
+       set mainImage(overviewCanvas) .overview_canvas
+       set mainImage(zoomCanvas)     .zoom_canvas
+
+       set Roi(Canvas) $Desktop(mainCanvas).canvas
+}
 proc display2Init {} {
        global mousePressed
        global Roi
@@ -380,16 +396,17 @@ proc display2Init {} {
 
        # Initial Variables
        display2InitVar 
+       debugPrint "display2InitVar End"
 
        # Load variables from defaultFile
        if [ info exists defaultFile ] {
-               #puts "Already Exist a variable, defaultFile"
+               debugPrint "Already Exist a variable, defaultFile"
        } else {
                set defaultFile "~/.Eos/Display2"
        }
        if [ file exists $defaultFile ] {
                #
-               #puts "Load parameters from $defaultFile"       
+               debugPrint "Load parameters from $defaultFile"  
        } else {
                # Create initial ~/.Eos/Display2 
                display2InitVarSet $defaultFile
@@ -398,7 +415,10 @@ proc display2Init {} {
 
        # from arguments
        display2SetVar
-       
+
+       # CanvasCreate
+       diplay2CanvasInit
+
        display2MenuSet
        display2MenuSet2
        display2BindingSet .main_canvas.canvas
index e060c77..5660566 100755 (executable)
@@ -27,7 +27,7 @@ proc roiAreaCreateStart {c x y} {
                Rectangle {
                        if { $Roi(SizeLock) == "On" } {
                                global rectanglePoints
-                               #puts "SizeLock Start: $mousePressed(startx)  $mousePressed(starty)"
+                               debugPrint "SizeLock Start: $mousePressed(startx)  $mousePressed(starty)"
                                set Roi(CurrentObject) [roiRectangleCreate $c \
                                        [expr $mousePressed(startx)-$rectanglePoints(width) /2 ] \
                                        [expr $mousePressed(starty)-$rectanglePoints(height)/2 ] \
@@ -51,7 +51,7 @@ proc roiAreaCreateStart {c x y} {
                                $mousePressed(startx) $mousePressed(starty)]
                }
                default {
-                       puts "Not supported Shape"
+                       puts stderr "Not supported Shape"
                }
        }
 }
@@ -90,7 +90,7 @@ proc roiAreaCreateMotion {c x y} {
                                        $mousePressed(endx)   $mousePressed(endy) ]
                        }
                        default {
-                               puts "Not supported Shape"
+                               puts stderr "Not supported Shape"
                        }
                }
        }
@@ -131,7 +131,7 @@ proc roiAreaCreateEnd {c x y} {
                                        $mousePressed(endx) $mousePressed(endy) ]
                        }
                        default {
-                               puts "Not supported Shape"
+                               puts stderr "Not supported Shape"
                        }
                }
        }
@@ -172,7 +172,7 @@ proc roiAreaRedraw { i } {
                                $Roi([subst $i],x1)  $Roi([subst $i],y1)  ] 
                }
                default {
-                       puts "Not supported in roiAreaAllRedraw"
+                       puts stderr "Not supported in roiAreaAllRedraw"
                }
        }
        switch $Roi(MultiNumber) {
@@ -211,8 +211,7 @@ proc roiRectangleCreate { c startx starty endx endy } {
        set rectanglePoints(x3) $blx
        set rectanglePoints(y3) $try
        
-       #puts $startx
-       #puts $rectanglePoints(x0)
+       debugPrint "$startx $rectanglePoints(x0)"
 
        if { $mousePressed(mode) == 2 } {
                #knobShow $c $rectanglePoints(x0) $rectanglePoints(y0)
@@ -283,7 +282,7 @@ proc roiLineCreate { c startx starty endx endy } {
 proc lineCreate { c x0 y0 x1 y1 } {
        global Roi
        set height [ lindex [ $c cget -scrollregion] 3 ]
-       #puts $Roi(LineWidth)
+       debugPrint $Roi(LineWidth)
        return [ $c create line \
                                                        [ coordGetInMainImageToCanvas $c x $x0 ]  [ coordGetInMainImageToCanvas $c y $y0 ] \
                                                        [ coordGetInMainImageToCanvas $c x $x1 ]  [ coordGetInMainImageToCanvas $c y $y1 ] \
index 3485aec..4737778 100755 (executable)
@@ -6,7 +6,7 @@ proc roiMultiAreaInfoSave { } {
        if { [ fileCanBeOverwritten $Roi(InformationFile) ] } {
                set Roi(fptInformationFile) [ open $Roi(InformationFile) w 0600 ]
        } else {
-               puts "Warning: Cannot be overwritten"
+               puts stderr "Warning: Cannot be overwritten"
                return  no
        }       
        for { set i 0 } { $i < $Roi(TotalN) } { incr i } {
@@ -28,14 +28,14 @@ proc roiMultiAreaInfoSave { } {
                                                ] 
                                }
                                default {
-                                       puts "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
+                                       puts stderr "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
                                }
                        }
                        puts  $Roi(fptInformationFile) $oneRoi 
                        flush $Roi(fptInformationFile)
-                       puts                           $oneRoi 
+                       debugPrint $oneRoi 
                } else {
-                       puts "Roi($i) doesn't exist. The last roi has not made sure yet or the number $i was not determined."
+                       puts stderr "Roi($i) doesn't exist. The last roi has not made sure yet or the number $i was not determined."
                }
        }       
        close $Roi(fptInformationFile)
@@ -49,7 +49,7 @@ proc roiMultiAreaInfoLoad { } {
        if { [ file exists $Roi(InformationFile) ] } {
                set Roi(fptInformationFile) [ open $Roi(InformationFile) r 0600 ]
        } else {
-               puts "Warning: File not found: $Roi(InformationFile) "
+               puts stderr "Warning: File not found: $Roi(InformationFile) "
                return  no
        }
        for { set i 0 } { $i < $Roi(TotalN) } { incr i } {
@@ -76,7 +76,7 @@ proc roiMultiAreaInfoLoad { } {
                                set Roi($i,y3) [ lindex $oneLineList 9 ]
                        }
                        default {
-                               puts "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
+                               puts stderr "Not supported shape at the multi mode: $Roi([subst $i],Shape)"
                        }
                }
                incr Roi(TotalN) 
@@ -151,7 +151,7 @@ proc roiAreaFileSave {  } {
                                if { $Roi(Extract) == "foreground" } {
                                        eval exec [ list Display2 -i $Roi(OutputFile) & ] 
                                } else {
-                                       puts "Not supported because process does not run on foreground"
+                                       puts stderr "Not supported because process does not run on foreground"
                                }
                        }
                }       
@@ -162,7 +162,7 @@ proc roiAreaFileSave {  } {
                        if { [ fileCanBeOverwritten $Roi(MontageFile) ] } {
                                #
                        } else {
-                               puts "Warning: Cannot be overwritten"
+                               puts stderr "Warning: Cannot be overwritten"
                                return  no
                        }
                        #
@@ -183,12 +183,12 @@ proc roiAreaFileSave {  } {
                                if { $Roi(Extract) == "foreground" } {
                                        eval exec [ list Display2 -i $Roi(MontageFile) & ] 
                                } else {
-                                       puts "Not supported because process does not run on foreground"
+                                       puts stderr "Not supported because process does not run on foreground"
                                }
                        }
                }               
                default {
-                                       puts "Not supported"
+                                       puts stderr "Not supported"
                }       
        }       
 }