Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nikon take 2 #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ImageCollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -340,4 +340,4 @@ def loadImageCollection(self):

# plt.show()



2 changes: 1 addition & 1 deletion LiveMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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)
Expand Down
8 changes: 4 additions & 4 deletions MosaicImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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))

Expand Down Expand Up @@ -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()
queue.join()
4 changes: 2 additions & 2 deletions MosaicPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
QtGui.QApplication.quit()