diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-07-10 20:51:44 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-07-10 20:51:44 (GMT) |
commit | f8a175bf5b2c4ad0ae830c0c09d096e4aeb58785 (patch) | |
tree | 5add3ae0d001975b30bb23361a463d589cf324e7 /ds9/library/cube.tcl | |
parent | cf5512238a12cf871256c34e7aed6c911b35ba2f (diff) | |
download | blt-f8a175bf5b2c4ad0ae830c0c09d096e4aeb58785.zip blt-f8a175bf5b2c4ad0ae830c0c09d096e4aeb58785.tar.gz blt-f8a175bf5b2c4ad0ae830c0c09d096e4aeb58785.tar.bz2 |
add current slice control to plot3d
Diffstat (limited to 'ds9/library/cube.tcl')
-rw-r--r-- | ds9/library/cube.tcl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl index c716a86..0190dfc 100644 --- a/ds9/library/cube.tcl +++ b/ds9/library/cube.tcl @@ -646,6 +646,77 @@ proc UpdateCubeDialog {} { } } +proc UpdateCubeMotionDialog {ii} { + global icube + global dcube + global cube + + # current frame only + global current + global ds9 + + global debug + if {$debug(tcl,update)} { + puts stderr "UpdateCubeMotionDialog" + } + + CubeStop + + if {![winfo exists $icube(top)]} { + return + } + + set w $icube(top) + set mb $icube(mb) + + # get number of axes + if {$current(frame) != {}} { + set naxes [$current(frame) get fits naxes] + } else { + set naxes 2 + } + + # set from/to + set depth 1 + if {$naxes == 2} { + set dcube(from,2) 1 + set dcube(to,2) 1 + set dcube(from,wcs,2) 1 + set dcube(to,wcs,2) 1 + } else { + if {$ii==2} { + # get cropped version + set ss [$current(frame) get crop 3d image] + set dcube(from,$ii) [lindex $ss 0] + set dcube(to,$ii) [lindex $ss 1] + } else { + set dcube(from,$ii) 1 + set dcube(to,$ii) [$current(frame) get fits depth $ii] + } + + set dcube(from,wcs,$ii) [$current(frame) get coordinates $dcube(from,$ii) image $cube(system) $ii] + set dcube(to,wcs,$ii) [$current(frame) get coordinates $dcube(to,$ii) image $cube(system) $ii] + } + + # set intervals + if {$naxes == 2} { + SliderFromTo $dcube(slider,2) $dcube(from,2) $dcube(to,2) + SliderMinMax $dcube(slider,2) $dcube(from,2) $dcube(to,2) 4 + } else { + SliderFromTo $dcube(slider,$ii) $dcube(from,$ii) $dcube(to,$ii) + SliderMinMax $dcube(slider,$ii) $dcube(from,wcs,$ii) $dcube(to,wcs,$ii) 4 + } + + # we must do this after the scale has been configured + if {$naxes == 2} { + set dcube(image,2) 1 + set dcube(wcs,2) 1 + } else { + set dcube(image,$ii) [$current(frame) get fits slice $ii] + set dcube(wcs,$ii) [$current(frame) get coordinates $dcube(image,$ii) image $cube(system) $ii] + } +} + proc CubeBackup {ch which} { switch [$which get type] { base - |