@@ -50,6 +50,7 @@ def load_RNA_parameters(self, channel, paras):
5050 """ default or loaded RNA parameters """
5151 paras ["RNA" + str (channel )+ "_spotZRadiusNm" ] = 1000
5252 paras ["RNA" + str (channel )+ "_spotXYRadiusNm" ] = 250
53+ paras ["RNA" + str (channel )+ "_tophatRadius" ] = 20
5354 paras ["RNA" + str (channel )+ "_removeSpotInExtremeZ" ] = True
5455 #paras["RNA"+str(channel)+"_drawing_spot_size"] = 3
5556 paras ["RNA" + str (channel )+ "_threshold" ] = self .mig .get_rna_threshold (channel )
@@ -171,6 +172,11 @@ def __init__( self, napari_viewer, parameters, nchan, mig, cfg, defmethod, rnafi
171172 threshold_line .addWidget (self .automatic_threshold )
172173
173174 bigfish_layout .addLayout (threshold_line )
175+
176+ ## top-hat radius
177+ tophat_line , self .tophat_radius = fwid .value_line ( "TopHat radius (pixels)" , 20 , descr = "Preprocessing with top-hat. Put 0 to disable" )
178+ self .tophat_radius .setText ( str (self .paras ["RNA" + str (self .rnachannel )+ "_tophatRadius" ]) )
179+ bigfish_layout .addLayout ( tophat_line )
174180
175181 self .remove_extrem = QCheckBox ("Remove spots in extremes Z" )
176182 self .remove_extrem .setChecked (False )
@@ -215,6 +221,7 @@ def go_rna(self):
215221 self .cfg .addParameter ("RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_method" , self .method .currentText ())
216222 self .cfg .addParameter ( "RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_spotZRadiusNm" , int (self .spotz_radius .text ()) )
217223 self .cfg .addParameter ( "RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_spotXYRadiusNm" , int (self .spotxy_radius .text ()) )
224+ self .cfg .addParameter ( "RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_tophatRadius" , int (self .tophat_radius .text ()) )
218225 self .cfg .addParameter ( "RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_threshold" , float (self .threshold .text ()) )
219226 self .cfg .addParameter ( "RNA" + str (self .rnachannel ), "RNA" + str (self .rnachannel )+ "_removeSpotInExtremeZ" , self .remove_extrem .isChecked () )
220227 #cfg.addParameter( "RNA"+str(rna_channel), "RNA"+str(rna_channel)+"_drawing_spot_size", drawing_spot_size )
@@ -274,6 +281,7 @@ def channel_choice(self):
274281 self .filename .setText (rnafilename )
275282 self .spotz_radius .setText (str (self .paras ["RNA" + str (self .rnachannel )+ "_spotZRadiusNm" ]))
276283 self .spotxy_radius .setText (str (self .paras ["RNA" + str (self .rnachannel )+ "_spotXYRadiusNm" ]))
284+ self .tophat_radius .setText (str (self .paras ["RNA" + str (self .rnachannel )+ "_tophatRadius" ]))
277285 self .threshold .setText (str (self .paras ["RNA" + str (self .rnachannel )+ "_threshold" ]))
278286 self .automatic_threshold .setChecked ( self .paras ["RNA" + str (self .rnachannel )+ "_automatic_threshold" ] )
279287 self .remove_extrem .setChecked ( self .paras ["RNA" + str (self .rnachannel )+ "_removeSpotInExtremeZ" ] )
@@ -291,9 +299,10 @@ def load_segmentationfile_rna(self ):
291299 self .end_segmented_rna ()
292300
293301 def segment_rna (self , threshold ):
302+ """ Launch the segmentation with selected parameters """
294303 chanel = self .rnachannel
295304 start_time = time .time ()
296- self .mig .find_rna ( self .rnachannel , int (self .spotz_radius .text ()), int (self .spotxy_radius .text ()), self .remove_extrem .isChecked (), threshold )
305+ self .mig .find_rna ( self .rnachannel , int (self .spotz_radius .text ()), int (self .spotxy_radius .text ()), self .remove_extrem .isChecked (), threshold , int ( self . tophat_radius . text ()) )
297306 print ("RNA big-fish segmentation finished in {:.3f}" .format ((time .time ()- start_time )/ 60 )+ " min" )
298307 self .end_segmented_rna ()
299308
0 commit comments