@@ -62,7 +62,7 @@ def __init__(self):
62
62
#set up ui signals
63
63
self .ui .load_image_pushButton .clicked .connect (self .load_image )
64
64
self .ui .custom_pixel_size_checkBox .stateChanged .connect (self .switch_custom_pixel_size )
65
- self .ui .update_scaling_factor_pushButton .clicked .connect (self .reload_image )
65
+ self .ui .update_settings_pushButton .clicked .connect (self .reload_image )
66
66
self .ui .spot_radioButton .toggled .connect (self .update_camera )
67
67
68
68
self .update_camera () #initialize camera pixel size
@@ -88,10 +88,14 @@ def resize_to_scaling_factor(self, image):
88
88
"""
89
89
self .update_scaling_factor ()
90
90
91
- if self .ui .pixera_radioButton .isChecked ():
92
- image = self .original_image
93
- elif self .ui .spot_radioButton .isChecked ():
91
+ if self .ui .spot_radioButton .isChecked () and self .ui .resize_image_checkBox .isChecked ():
94
92
image = self .original_image .resize ((round (image .size [0 ]* self .scaling_factor ), round (image .size [1 ]* self .scaling_factor )))
93
+ self .image_plot .getAxis ("bottom" ).setScale (scale = 1 )
94
+ self .image_plot .getAxis ("left" ).setScale (scale = 1 )
95
+ else :
96
+ image = self .original_image
97
+ self .image_plot .getAxis ("bottom" ).setScale (scale = self .scaling_factor )
98
+ self .image_plot .getAxis ("left" ).setScale (scale = self .scaling_factor )
95
99
96
100
if self .ui .greyscale_checkBox .isChecked ():
97
101
image = image .convert ("L" ) #convert to greyscale
@@ -106,8 +110,8 @@ def resize_to_scaling_factor(self, image):
106
110
self .img_item .setImage (image = self .image_array )
107
111
self .img_item .setRect (self .img_item_rect )
108
112
109
- if self .ui .greyscale_checkBox .isChecked ():
110
- self .hist_lut .setImageItem (self .img_item )
113
+ # if self.ui.greyscale_checkBox.isChecked():
114
+ # self.hist_lut.setImageItem(self.img_item)
111
115
112
116
if self .ui .vertical_radioButton .isChecked ():
113
117
roi_height = self .scaling_factor * height
@@ -135,11 +139,11 @@ def line_profile_update_plot(self):
135
139
elif self .ui .horizontal_radioButton .isChecked ():
136
140
x_values = coords [1 ,0 ,:]
137
141
138
- if self .ui .pixera_radioButton .isChecked ():
142
+ if self .ui .pixera_radioButton .isChecked () or ( self . ui . spot_radioButton . isChecked () and not self . ui . resize_image_checkBox . isChecked ()) :
139
143
x_values = x_values * self .scaling_factor
140
144
141
145
#calculate average along columns in region
142
- if len (data .shape ) = = 2 : #if grayscale, average intensities
146
+ if len (data .shape ) < = 2 : #if grayscale, average intensities
143
147
if self .ui .vertical_radioButton .isChecked ():
144
148
avg_to_plot = np .mean (data , axis = - 1 )
145
149
elif self .ui .horizontal_radioButton .isChecked ():
@@ -191,10 +195,12 @@ def update_camera(self):
191
195
if self .ui .spot_radioButton .isChecked ():
192
196
self .camera_pixel_size = 7.4
193
197
self .ui .greyscale_checkBox .setChecked (False )
198
+ self .ui .resize_image_checkBox .setEnabled (True )
194
199
self .update_scaling_factor ()
195
200
elif self .ui .pixera_radioButton .isChecked ():
196
201
self .camera_pixel_size = 3
197
202
self .ui .greyscale_checkBox .setChecked (True )
203
+ self .ui .resize_image_checkBox .setEnabled (False )
198
204
self .update_scaling_factor ()
199
205
200
206
def close_application (self ):
0 commit comments