From 863df28339e7a795a82a292a88788b4e3b4bd4b5 Mon Sep 17 00:00:00 2001 From: Antonino Ingargiola Date: Sun, 15 Jul 2007 15:57:35 +0200 Subject: [PATCH] I: Allow to change visualized aspect-ratio. --- pyplotsuite/imageanalyzer/image_analyzer.glade | 67 ++++++++++++++++++++++++-- pyplotsuite/imageanalyzer2.py | 10 +++- 2 files changed, 70 insertions(+), 7 deletions(-) mode change 100755 => 100644 pyplotsuite/imageanalyzer2.py diff --git a/pyplotsuite/imageanalyzer/image_analyzer.glade b/pyplotsuite/imageanalyzer/image_analyzer.glade index ad31b9f..02bec05 100644 --- a/pyplotsuite/imageanalyzer/image_analyzer.glade +++ b/pyplotsuite/imageanalyzer/image_analyzer.glade @@ -2211,7 +2211,7 @@ POSSIBILITY OF SUCH DAMAGES. True - False + True 0 @@ -2254,7 +2254,7 @@ POSSIBILITY OF SUCH DAMAGES. 10 True - True + False @@ -2268,13 +2268,13 @@ POSSIBILITY OF SUCH DAMAGES. True - False + True 0 True - PIxel Y dimension + PIxel Y dimension: False False GTK_JUSTIFY_LEFT @@ -2311,7 +2311,64 @@ POSSIBILITY OF SUCH DAMAGES. 10 True - True + False + + + + + 10 + True + True + + + + + + True + True + 0 + + + + True + Visualized aspect ratio: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 10 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + + True + True + 10 + 2 + True + GTK_UPDATE_ALWAYS + False + False + 1 0.0010000000475 1000 1 10 10 + + + 10 + True + False diff --git a/pyplotsuite/imageanalyzer2.py b/pyplotsuite/imageanalyzer2.py old mode 100755 new mode 100644 index e060d14..0770945 --- a/pyplotsuite/imageanalyzer2.py +++ b/pyplotsuite/imageanalyzer2.py @@ -102,6 +102,7 @@ class ImageApp(GenericMainPlotWindow): self.ylabel = None self.colorlist = None self.sectionsLC = None # LinesCollection representing the sections + self.aspect = 1 # Show the window and each child self.window.show_all() @@ -229,12 +230,14 @@ class ImageApp(GenericMainPlotWindow): if not extent == None: self.extent = extend self.axim.clear() + self.i = self.axim.imshow(self.image_array, interpolation=self.interp, vmin=self.min, vmax=self.max, cmap=self.colormap, origin=self.origin, - extent=self.extent) + extent=self.extent, + aspect=self.aspect) if not self.isColorImage: # Plot the colorbar @@ -247,7 +250,7 @@ class ImageApp(GenericMainPlotWindow): if self.gridon: self.axim.grid(color=self.gridcolor) - self.axim.axis('image') + # self.axim.axis('image') self.set_title_and_labels() if self.sectionsLC != None: self.axim.add_collection(self.sectionsLC) @@ -591,13 +594,16 @@ class PixelDimensionWindow(DialogWindowWithCancel): self.xPixDimSpinButt = self.widgetTree.get_widget('xPixDimSpinButt') self.yPixDimSpinButt = self.widgetTree.get_widget('yPixDimSpinButt') + self.aspectSpinButt = self.widgetTree.get_widget('aspectSpinButt') self.xPixDimSpinButt.set_value(xDim) self.yPixDimSpinButt.set_value(yDim) + self.aspectSpinButt.set_value(self.callerApp.aspect) def on_okButton_clicked(self, widget, *args): dprint ("OK") self.callerApp.xPixelDim = self.xPixDimSpinButt.get_value() self.callerApp.yPixelDim = self.yPixDimSpinButt.get_value() + self.callerApp.aspect = self.aspectSpinButt.get_value() self.callerApp.autoset_extent() self.callerApp.plot_image() self.window.destroy() -- 2.11.4.GIT