Nikolai Mikuszeit
2014-01-30 16:21:02 UTC
Hi,
I am using the example for ContrastAdjustments to analyze/manipulate some
data.
To apply the changes upon manipulation I use the set_data() method. I want
to apply the same contrast levels adjusted for the previous image.
Without docu and after hours of scanning the API I found a solution
presented below (in red). I am, however, not really satisfied with this. Is
there a better way to put the present contrast adjustments to an image
after image.set_data()?
Nikolai
...
def create_window(self):
self.win = ImageDialog(parent=None,edit=True, toolbar=True,
wintitle="Real", options=dict(show_contrast=True))
for toolklass in (VCursorTool, HCursorTool,
XCursorTool,AnnotatedObliqueRectangleTool, ObliqueRectangleTool):
self.win.add_tool(toolklass)
self.contrastPanel = self.win.get_contrast_panel()
def myMakeImage(self,data):
self.contrast_min,self.contrast_max=self.contrastPanel.histogram.range.get_range()
self.image.set_data(data)
def updateImage(self):
self.plot.replot()
self.contrastPanel.set_range(self.contrast_min,self.contrast_max)
...
I am using the example for ContrastAdjustments to analyze/manipulate some
data.
To apply the changes upon manipulation I use the set_data() method. I want
to apply the same contrast levels adjusted for the previous image.
Without docu and after hours of scanning the API I found a solution
presented below (in red). I am, however, not really satisfied with this. Is
there a better way to put the present contrast adjustments to an image
after image.set_data()?
Nikolai
...
def create_window(self):
self.win = ImageDialog(parent=None,edit=True, toolbar=True,
wintitle="Real", options=dict(show_contrast=True))
for toolklass in (VCursorTool, HCursorTool,
XCursorTool,AnnotatedObliqueRectangleTool, ObliqueRectangleTool):
self.win.add_tool(toolklass)
self.contrastPanel = self.win.get_contrast_panel()
def myMakeImage(self,data):
self.contrast_min,self.contrast_max=self.contrastPanel.histogram.range.get_range()
self.image.set_data(data)
def updateImage(self):
self.plot.replot()
self.contrastPanel.set_range(self.contrast_min,self.contrast_max)
...
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.