Next: Image profiles and histograms Up: Hypertools Previous: Hypertools

## Image visualization

We mentioned several times in this paper the importance of normalizing floating-point images in the same way. Typically, this can be done by querying the minimum and maximum value of each image, and by computing the absolute minimum and maximum of all the images being displayed. Setting the dynamic range has to be done each time an image is updated; for example, in volume visualization, the dynamic range is likely to be different for each slice. Moreover, visualization tools may run on different systems and display the images on the same screen. In summary, choosing a correct dynamic range is a tedious time-consuming task. However, the `send` command makes things simple, as the following script demonstrates:

    proc set_range {} {
       # initializations
       set l [winfo interps]
       set min {}; set max {}; set visu_list {}

       # list visu applications
       foreach k $l {
          if { [string match "visu*" \
    	            [lindex $k 0] ] } {
             lappend visu_list $k
          }
       }

       # query dynamic range of active images
       foreach k $visu_list {
          lappend min \
             [send $k {$curr_img getmin}]
          lappend max \
             [send $k {$curr_img getmax}]
       }

       # compute the global minimum and maximum
       set fmin [lindex $min 0]
       set fmax [lindex $max 0]
       foreach k $min {
          if { $k<$fmin } {
             set fmin $k
          }
          if { $k>$fmax } {
             set fmax $k
          }
       }

       # set the new dynamic range
       foreach k $visu_list {
          send $k {$curr_img range} $fmin $fmax
       }
    }

In this script, the dynamic range is broadcast to all the visu applications. Other possibilities include showing the pixel values at the same mouse location in different images, so as to compare images on a pixel-by-pixel basis. Using the visu scripts, this option could be written as the following command.

    foreach k $visu_list {
        send $k {set x $x}
        send $k {set y $y}
        send $k {set pix [$curr_img get $x $y]}
    }

Instead of sending values, it is possible to send commands, and for example to visualize the same slice in different data sets by broadcasting the command `rdslice $curr_img $curr_slice`. A direct application is the creation of simultaneous animations of volumes located in different file systems and accessed over the network.