Skip to content

Commit

Permalink
Commit #112
Browse files Browse the repository at this point in the history
- Wrong column headers issue fixed for fitting data. (I & bg swapped)
- vimba_cam: added frame rate control functions.
- vimba_panel: added the option for single view, dual view side by side (right side of the chip flipped horizontally), dual view overlaid (right side of the chip flipped horizontally and overlaid over the left side). Also two channel independent intensity scaling is added by controlling a linear ROI range within the histogram plot.
PLEASE NOTE SAVED RAW DATA IS NOT AFFECTED ALL OF THIS IS FOR PREVIEW DURING ACQUISITION!
  • Loading branch information
samhitech committed Mar 15, 2023
1 parent edf6ba6 commit f501fab
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 61 deletions.
2 changes: 2 additions & 0 deletions examples/miEye_scripts/AcquisitionLoopXYstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def loop(mieye, iterations, delay):
mieye._stop_scan = False
mieye._scanning = True

params = mieye.scanAcqWidget.get_params()

mieye.scan_worker = thread_worker(
scan_acquisition, mieye,
[params[0], params[1]],
Expand Down
2 changes: 1 addition & 1 deletion src/microEye/fitting/phasor_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def intensity_estimate(roi: np.ndarray, bg_mask, sig_mask, percentile=56):

intensity = np.sum(roi[sig_mask]) - (np.sum(sig_mask) * background)

return background, max(0, intensity)
return max(0, intensity), background
10 changes: 5 additions & 5 deletions src/microEye/fitting/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ class FittingMethod:


ParametersHeaders = {
0: ['x', 'y', 'bg', 'I', 'ratio x/y', 'frame'],
1: ['x', 'y', 'bg', 'I', 'iteration'],
2: ['x', 'y', 'bg', 'I', 'sigma', 'iteration'],
4: ['x', 'y', 'bg', 'I', 'sigmax', 'sigmay', 'iteration'],
5: ['x', 'y', 'bg', 'I', 'z', 'iteration']
0: ['x', 'y', 'I', 'bg', 'ratio x/y', 'frame'],
1: ['x', 'y', 'I', 'bg', 'iteration'],
2: ['x', 'y', 'I', 'bg', 'sigma', 'iteration'],
4: ['x', 'y', 'I', 'bg', 'sigmax', 'sigmay', 'iteration'],
5: ['x', 'y', 'I', 'bg', 'z', 'iteration']
}


Expand Down
10 changes: 5 additions & 5 deletions src/microEye/fitting/results_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from PyQt5.QtWidgets import *

ParametersHeaders = {
0: ['x', 'y', 'bg', 'I', 'ratio x/y', 'frame'],
1: ['x', 'y', 'bg', 'I'],
2: ['x', 'y', 'bg', 'I', 'sigma'],
4: ['x', 'y', 'bg', 'I', 'sigmax', 'sigmay'],
5: ['x', 'y', 'bg', 'I', 'z']
0: ['x', 'y', 'I', 'bg', 'ratio x/y', 'frame'],
1: ['x', 'y', 'I', 'bg'],
2: ['x', 'y', 'I', 'bg', 'sigma'],
4: ['x', 'y', 'I', 'bg', 'sigmax', 'sigmay'],
5: ['x', 'y', 'I', 'bg', 'z']
}


Expand Down
67 changes: 67 additions & 0 deletions src/microEye/hardware/vimba_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ def __init__(self, camera_id=None):

self.exposure_auto = 'Off'

self.frameRateEnabled = False

self.frameRate = 0.0

self.frameRate_increment = 1
self.frameRate_unit = ''
self.frameRate_range = None

self.trigger_source = 'Software'

self.trigger_selector = 'FrameStart'
Expand Down Expand Up @@ -115,6 +123,8 @@ def __init__(self, camera_id=None):
def initialize(self):
with self.cam:
self.default()
self.getAcquisitionFrameRateEnable()
self.getFrameRate()
self.get_exposure()
self.get_exposure_mode()
self.get_exposure_auto()
Expand Down Expand Up @@ -227,6 +237,7 @@ def set_exposure(self, value: float):
self.exposure_range[0])
exposure.set(set_value)
self.get_exposure()
self.getFrameRate()
return 1
except Exception:
print("Exposure Set ERROR")
Expand Down Expand Up @@ -327,6 +338,62 @@ def get_exposure_auto_entries(self):

return [modes, displayNames, tooltips]

def setAcquisitionFrameRateEnable(self, enabled: bool = False):
try:
AcquisitionFrameRateEnable = self.cam.AcquisitionFrameRateEnable
AcquisitionFrameRateEnable.set(enabled)
self.frameRateEnabled = enabled
except Exception:
print("AcquisitionFrameRateEnable set ERROR")

def getAcquisitionFrameRateEnable(self, output: bool = True):
try:
AcquisitionFrameRateEnable = self.cam.AcquisitionFrameRateEnable
self.frameRateEnabled = AcquisitionFrameRateEnable.get()
if output:
print(
"AcquisitionFrameRate Enabled ",
self.frameRateEnabled)
except Exception:
print("AcquisitionFrameRateEnable get ERROR")

def getFrameRate(self, output: bool = True):
try:
frameRate = self.cam.AcquisitionFrameRate
self.frameRate = frameRate.get()
self.frameRate_unit = frameRate.get_unit()
self.frameRate_range = frameRate.get_range()
if output:
print(
"Current FrameRate ",
self.frameRate,
self.frameRate_unit)
return self.frameRate
except Exception:
print("AcquisitionFrameRate get ERROR")
self.frameRate = 0.0
return self.frameRate

def setFrameRate(self, value: float):
if not self.frameRateEnabled:
return 0

try:
frameRate = self.cam.AcquisitionFrameRate
self.frameRate_unit = frameRate.get_unit()
self.frameRate_range = frameRate.get_range()

set_value = max(
min(value, self.frameRate_range[1]),
self.frameRate_range[0])
frameRate.set(set_value)
self.getFrameRate(False)
self.get_exposure(False)
return 1
except Exception:
print("AcquisitionFrameRate Set ERROR")
return 0

def set_trigger_mode(self, value: str = 'On'):
try:
# with self.cam:
Expand Down
Loading

0 comments on commit f501fab

Please sign in to comment.