From 86cd388f23fcaf6b5edd127147a7c33e5798fe99 Mon Sep 17 00:00:00 2001 From: Brad Busse Date: Fri, 30 Oct 2015 12:50:21 -0400 Subject: [PATCH 1/5] Cristoph Gohlke's skimage binaries appear to install, but collapse into a messy pile of unresolved dependencies when run. Toggling them off for now. --- MosaicImage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MosaicImage.py b/MosaicImage.py index 61ad6b1..26f0d8c 100644 --- a/MosaicImage.py +++ b/MosaicImage.py @@ -23,6 +23,7 @@ import numpy as np import threading import os +import sys import Queue from CenterRectangle import CenterRectangle from matplotlib.lines import Line2D @@ -32,11 +33,10 @@ import cv2 import ransac from scipy.signal import correlate2d -from skimage.measure import block_reduce +#from skimage.measure import block_reduce import norm_xcorr #implicity this relies upon matplotlib.axis matplotlib.AxisImage matplotlib.bar - #my custom 2d correlation function for numpy 2d matrices.. def mycorrelate2d(fixed,moved,skip=1): """a 2d correlation function for numpy 2d matrices @@ -57,7 +57,7 @@ def mycorrelate2d(fixed,moved,skip=1): if the variance in the subsampled region of fixed is lower than the variance of the entire matrix """ - if skip>1: + if skip>1 and 'block_reduce' in sys.modules: fixed = block_reduce(fixed,block_size = (int(skip),int(skip)),func = np.mean,cval=np.mean(fixed)) moved = block_reduce(moved,block_size = (int(skip),int(skip)),func = np.mean,cval=np.mean(moved)) @@ -668,4 +668,4 @@ def make_preview_stack(self,xpos,ypos,width,height,directory): (cx_pix,cy_pix)=self.convert_pos_to_ind(xpos[i],ypos[i]) rect=[cx_pix-hw_pix,cy_pix-hh_pix,cx_pix+hw_pix,cy_pix+hh_pix] queue.put((self.imagefile,rect,i)) - queue.join() \ No newline at end of file + queue.join() From 5ce9438704e0d934a59e5ec54fea5262df9dae85 Mon Sep 17 00:00:00 2001 From: Brad Busse Date: Fri, 30 Oct 2015 15:13:06 -0400 Subject: [PATCH 2/5] Disabling faulthander for now; it throws an error upon initialization. --- MosaicPlanner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MosaicPlanner.py b/MosaicPlanner.py index c093f5a..cd38eb2 100644 --- a/MosaicPlanner.py +++ b/MosaicPlanner.py @@ -1214,10 +1214,10 @@ def OnClose(self,event): #dirname=sys.argv[1] #print dirname -faulthandler.enable() +#faulthandler.enable() app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window. frame = ZVISelectFrame(None,"Mosaic Planner") # A Frame is a top-level window. app.MainLoop() -QtGui.QApplication.quit() \ No newline at end of file +QtGui.QApplication.quit() From e6f22469d74d73077a50b6d8bf28ba027ea599da Mon Sep 17 00:00:00 2001 From: Brad Busse Date: Fri, 30 Oct 2015 15:23:23 -0400 Subject: [PATCH 3/5] QTgui (from pyqtgraph 0.9.10) does not have a margin parameter --- LiveMode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LiveMode.py b/LiveMode.py index bacb790..7faa968 100644 --- a/LiveMode.py +++ b/LiveMode.py @@ -13,6 +13,8 @@ import functools from imageSourceMM import imageSource +import pyqtgraph +print pyqtgraph.__version__ class VideoView(QtGui.QWidget): def __init__(self,imgSrc,exposure_times=dict([]),channelGroup="Channels"): @@ -87,7 +89,7 @@ def initUI(self): keys = self.exposure_times.keys() - gridlay=QtGui.QGridLayout(margin=0,spacing=-1) + gridlay=QtGui.QGridLayout(spacing=-1) for i,ch in enumerate(self.channels): btn=QtGui.QPushButton(ch,self) self.chnButtons.append(btn) From 22d755a6113809debe88d6d8a89bee05aa0699cf Mon Sep 17 00:00:00 2001 From: Brad Busse Date: Fri, 30 Oct 2015 15:23:48 -0400 Subject: [PATCH 4/5] Removing debug code --- LiveMode.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/LiveMode.py b/LiveMode.py index 7faa968..0723933 100644 --- a/LiveMode.py +++ b/LiveMode.py @@ -13,8 +13,6 @@ import functools from imageSourceMM import imageSource -import pyqtgraph -print pyqtgraph.__version__ class VideoView(QtGui.QWidget): def __init__(self,imgSrc,exposure_times=dict([]),channelGroup="Channels"): From 9baa0cb9cf4bb2311b1c9713cd17555d4f96572f Mon Sep 17 00:00:00 2001 From: Brad Busse Date: Fri, 30 Oct 2015 15:32:48 -0400 Subject: [PATCH 5/5] Uses image.max() to stretch dynamic range --- ImageCollection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ImageCollection.py b/ImageCollection.py index 0117fd6..4e04fb6 100644 --- a/ImageCollection.py +++ b/ImageCollection.py @@ -194,7 +194,7 @@ def add_image_at(self,x,y): (thedata,bbox)=self.imageSource.take_image(x,y) if thedata.dtype == np.uint16: print "converting" - maxval=self.imageSource.get_max_pixel_value() + maxval=thedata.max()#self.imageSource.get_max_pixel_value() thedata=self.lut_convert16as8bit(thedata,0,maxval) except: @@ -340,4 +340,4 @@ def loadImageCollection(self): # plt.show() - \ No newline at end of file +