@@ -62,7 +62,7 @@ def __init__(self):
6262 #set up ui signals
6363 self .ui .load_image_pushButton .clicked .connect (self .load_image )
6464 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 )
6666 self .ui .spot_radioButton .toggled .connect (self .update_camera )
6767
6868 self .update_camera () #initialize camera pixel size
@@ -88,10 +88,14 @@ def resize_to_scaling_factor(self, image):
8888 """
8989 self .update_scaling_factor ()
9090
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 ():
9492 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 )
9599
96100 if self .ui .greyscale_checkBox .isChecked ():
97101 image = image .convert ("L" ) #convert to greyscale
@@ -106,8 +110,8 @@ def resize_to_scaling_factor(self, image):
106110 self .img_item .setImage (image = self .image_array )
107111 self .img_item .setRect (self .img_item_rect )
108112
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)
111115
112116 if self .ui .vertical_radioButton .isChecked ():
113117 roi_height = self .scaling_factor * height
@@ -135,11 +139,11 @@ def line_profile_update_plot(self):
135139 elif self .ui .horizontal_radioButton .isChecked ():
136140 x_values = coords [1 ,0 ,:]
137141
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 ()) :
139143 x_values = x_values * self .scaling_factor
140144
141145 #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
143147 if self .ui .vertical_radioButton .isChecked ():
144148 avg_to_plot = np .mean (data , axis = - 1 )
145149 elif self .ui .horizontal_radioButton .isChecked ():
@@ -191,10 +195,12 @@ def update_camera(self):
191195 if self .ui .spot_radioButton .isChecked ():
192196 self .camera_pixel_size = 7.4
193197 self .ui .greyscale_checkBox .setChecked (False )
198+ self .ui .resize_image_checkBox .setEnabled (True )
194199 self .update_scaling_factor ()
195200 elif self .ui .pixera_radioButton .isChecked ():
196201 self .camera_pixel_size = 3
197202 self .ui .greyscale_checkBox .setChecked (True )
203+ self .ui .resize_image_checkBox .setEnabled (False )
198204 self .update_scaling_factor ()
199205
200206 def close_application (self ):
0 commit comments