def __init__(self): TkDialog.__init__(self) #Here you can make things pretty self.arraychannel = None self.wm_geometry("500x470") self.title("Channel Calculator - Copyright (c) 2015 Egor Zindy") self.add_menu("File",["Open configuration", "Save configuration","|","Exit"]) self.add_menu("Help",["About"]) widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("chana_input"), values=[], exportselection=0, state="readonly"), ttk.Entry(self.mainframe,textvariable=self.arrayvar("factor_a"))] tick = (self.arrayvar("check_inverta", "off"),"Invert channel") tooltip = "Select a channel and a scaling coefficient." tooltip1 = "Click to invert the channel." self.add_control("Channel A times",widget, tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("chanb_input"), values=[], exportselection=0, state="readonly"), ttk.Entry(self.mainframe,textvariable=self.arrayvar("factor_b"))] tick = (self.arrayvar("check_invertb", "off"),"Invert channel") tooltip = "Select a channel and a scaling coefficient." tooltip1 = "Click to invert the channel." self.add_control("Channel B times",widget, tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("operation_type"), values=list_operations, exportselection=0, state="readonly") tooltip = "Choose an operation to perform on Channel A and Channel B" self.add_control("Operation",widget, name="ctrl_operations", tooltip=tooltip) widget = ttk.Checkbutton(self.mainframe, variable=self.arrayvar("check_threshold","off"), text="(click to activate)", onvalue="on", offvalue="off") tooltip = "Check this box to use the sliders below to clip the low / high pixel intensity values of the resulting image.\nIn Threshold only (no normalisation) mode, pixels whose intensity is below the minimum threshold are set to 0." self.add_control("Threshold output", widget, tooltip=tooltip) widget = ttk.Checkbutton(self.mainframe, variable=self.arrayvar("check_normalise","on"), text="(click to activate)", onvalue="on", offvalue="off") tooltip = "Normalising the operational output image scales its intensity range to that of the input images.\nFor example, if the input images are 16 bits, the normalised output image range will span 0 to 65535.\nFor quantitative comparisons where pixel intensity is important, you will want to work with non-normalised images." self.add_control("Normalise output", widget, tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("lothresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips low intensity / negative intensity pixels." self.add_control("Threshold min", widget, name="ctrl_lothresh", tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("hithresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips high intensity pixels." self.add_control("Threshold max", widget, name="ctrl_hithresh", tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Preview operation at current timepoint", command=self.OnPreview, name="btn1") tooltip = "Click preview to check your operation on a single timepoint." self.add_control("Preview",widget, tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Apply operation to all timepoints", command=self.OnCalculate, name="btn2") tooltip = "Click this to apply the operation for every timepoint in your image/volume timelapse (this may take sone time)." self.add_control("Apply",widget, tooltip=tooltip) widget = ttk.Progressbar(self.mainframe, variable=self.arrayvar("progress"), maximum=100, mode='determinate', orient="horizontal") self.add_control("Progress",widget, name="ctrl_progress") #we have all the ingredients, now bake the dialog box! self.bake(has_live=True, has_cancel=False) #, has_preview=True) #"Calculate")
def __init__(self): TkDialog.__init__(self) #Here you can make things pretty self.arraychannel = None self.wm_geometry("500x470") self.title("Channel Calculator XTension - Copyright (c) 2015 Egor Zindy") widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("chana_input"), values=[], exportselection=0, state="readonly"), ttk.Entry(self.mainframe,textvariable=self.arrayvar("factor_a"))] tick = (self.arrayvar("check_inverta", "off"),"Invert channel") tooltip = "Select a channel and a scaling coefficient." tooltip1 = "Click to invert the channel." self.add_control("Channel A times",widget, tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("chanb_input"), values=[], exportselection=0, state="readonly"), ttk.Entry(self.mainframe,textvariable=self.arrayvar("factor_b"))] tick = (self.arrayvar("check_invertb", "off"),"Invert channel") tooltip = "Select a channel and a scaling coefficient." tooltip1 = "Click to invert the channel." self.add_control("Channel B times",widget, tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("operation_type"), values=list_operations, exportselection=0, state="readonly") tooltip = "Choose an operation to perform on Channel A and Channel B" self.add_control("Operation",widget, name="ctrl_operations", tooltip=tooltip) widget = ttk.Checkbutton(self.mainframe, variable=self.arrayvar("check_threshold","off"), text="(click to activate)", onvalue="on", offvalue="off") tooltip = "Check this box to use the sliders below to clip the low / high pixel intensity values of the resulting image.\nIn Threshold only (no normalisation) mode, pixels whose intensity is below the minimum threshold are set to 0." self.add_control("Threshold output", widget, tooltip=tooltip) widget = ttk.Checkbutton(self.mainframe, variable=self.arrayvar("check_normalise","on"), text="(click to activate)", onvalue="on", offvalue="off") tooltip = "Normalising the operational output image scales its intensity range to that of the input images.\nFor example, if the input images are 16 bits, the normalised output image range will span 0 to 65535.\nFor quantitative comparisons where pixel intensity is important, you will want to work with non-normalised images." self.add_control("Normalise output", widget, tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("lothresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips low intensity / negative intensity pixels." self.add_control("Threshold min", widget, name="ctrl_lothresh", tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("hithresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips high intensity pixels." self.add_control("Threshold max", widget, name="ctrl_hithresh", tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Preview operation at current timepoint", command=self.OnPreview, name="btn1") tooltip = "Click preview to check your operation on a single timepoint." self.add_control("Preview",widget, tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Apply operation to all timepoints", command=self.OnCalculate, name="btn2") tooltip = "Click this to apply the operation for every timepoint in your image/volume timelapse (this may take sone time)." self.add_control("Apply",widget, tooltip=tooltip) widget = ttk.Progressbar(self.mainframe, variable=self.arrayvar("progress"), maximum=100, mode='determinate', orient="horizontal") self.add_control("Progress",widget, name="ctrl_progress") #we have all the ingredients, now bake the dialog box! self.bake(has_live=True, has_cancel=False) #, has_preview=True) #"Calculate")
def __init__(self, is3D=False): TkDialog.__init__(self) #Here you can make things pretty self.arraychannel = None self.wm_geometry("600x120") self.title("Spot Resizer - Copyright (c) 2018 Egor Zindy") self.add_menu("File", [ "Update objects", "Open configuration", "Save configuration", "|", "Exit" ]) self.add_menu("Help", ["About"]) #widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("objects"), values=[], exportselection=0, state="readonly"), # ttk.Combobox(self.mainframe, textvariable=self.arrayvar("cc_type"), values=list_colourcoding, exportselection=0, state="readonly")] #self.add_control("Object and coding",widget, "ctrl_objects") widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("objects"), values=[], exportselection=0, state="readonly") self.add_control("Spot object", widget, name="ctrl_objects", tick=None) widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("xsize")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("ysize")) ] label = "Spot um size X/Y" if is3D: widget.append( ttk.Entry(self.mainframe, textvariable=self.arrayvar("zsize"))) label += "/Z" self.add_control(label, widget, tick=None) widget = ttk.Button(self.mainframe, text="Apply", name="btn3") self.add_control("", widget) #we have all the ingredients, now bake the dialog box! self.bake(has_cancel=False) #, has_preview=True) #"Calculate")
def __init__(self, is3D=False): TkDialog.__init__(self) #Here you can make things pretty self.arraychannel = None self.wm_geometry("700x800") self.title("Tracks plotter - Copyright (c) 2015 Egor Zindy") self.add_menu("File", [ "Update objects", "Open configuration", "Save configuration", "|", "Exit" ]) self.add_menu("Help", ["About"]) #widget = [ttk.Combobox(self.mainframe, textvariable=self.arrayvar("objects"), values=[], exportselection=0, state="readonly"), # ttk.Combobox(self.mainframe, textvariable=self.arrayvar("cc_type"), values=list_colourcoding, exportselection=0, state="readonly")] #self.add_control("Object and coding",widget, "ctrl_objects") widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("objects"), values=[], exportselection=0, state="readonly") tick = self.arrayvar("check_selected", "off"), "Selected" self.add_control("Spot object", widget, name="ctrl_objects", tick=tick) if is3D: widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("plot_type"), values=list_plots, exportselection=0, state="readonly") self.add_control("Plot type", widget, name="ctrl_plots", tick=tick) self.ctrl_type = w1 = ttk.Combobox( self.mainframe, textvariable=self.arrayvar("cc_type"), values=[], exportselection=0, state="readonly") self.ctrl_channel = w2 = ttk.Combobox( self.mainframe, textvariable=self.arrayvar("cc_channel"), values=[], exportselection=0, state="readonly") widget = [w1, w2] tick = self.arrayvar("check_cc", "off"), "Use" self.add_control("Colour coding", widget, tick=tick) widget = ttk.Entry(self.mainframe, textvariable=self.arrayvar("title")) tick = self.arrayvar("check_title", "off"), "Display" self.add_control("Title string", widget, tick=tick) if is3D: widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("xsize")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("ysize")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("zsize")) ] tick = self.arrayvar("check_defaultsize", "on"), "Default" self.add_control("Voxel um size X/Y/Z", widget, tick=tick) else: widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("xsize")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("ysize")) ] tick = self.arrayvar("check_defaultsize", "on"), "Default" self.add_control("Voxel um size X/Y", widget, tick=tick) widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("xmin")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("xmax")) ] tick = self.arrayvar("xauto", "on"), "Auto" self.add_control("X range (min/max)", widget, tick=tick) widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("ymin")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("ymax")) ] tick = self.arrayvar("yauto", "on"), "Auto" self.add_control("Y range (min/max)", widget, tick=tick) if is3D: widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("zmin")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("zmax")) ] tick = self.arrayvar("zauto", "on"), "Auto" self.add_control("Z range (min/max)", widget, tick=tick) widget = [ ttk.Entry(self.mainframe, textvariable=self.arrayvar("azimuth")), ttk.Entry(self.mainframe, textvariable=self.arrayvar("elevation")) ] self.add_control("Azimuth / Elevation", widget) #,tick=tick) self.figure = Figure(figsize=(10, 10), dpi=100) self.canvas = FigureCanvasTkAgg(self.figure, master=self.mainframe) self.add_control("", self.canvas.get_tk_widget()) #self.toolbar = NavigationToolbar2TkAgg(self.canvas, self.mainframe) #self.add_control("",self.toolbar) widget = ttk.Button(self.mainframe, text="Save high resolution figure", command=self.OnSaveFigure, name="btn3") self.add_control("", widget) #we have all the ingredients, now bake the dialog box! self.bake(has_cancel=False) #, has_preview=True) #"Calculate")
def __init__(self): TkDialog.__init__(self) #Here you can make things pretty self.arraychannel = None self.wm_geometry("510x510") self.title( "Wavelet analysis for Imaris v1.0.1 - Copyright (c) 2014-2018 Egor Zindy" ) self.add_menu( "File", ["Open configuration", "Save configuration", "|", "Exit"]) self.add_menu("Help", ["About"]) widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("channel"), values=[], exportselection=0, state="readonly") tick = (self.arrayvar("check_channel", "off"), "Apply to All") tooltip = "Select a channel to filter using Wavelet analysis. A new channel will be created for each filtered channel." tooltip1 = "It is probably best to work on one channel at a time.\nHowever, checking this box will apply the same parameters to all the dataset channels." self.add_control("Channel", widget, name="ctrl_channels", tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = ttk.Combobox(self.mainframe, textvariable=self.arrayvar("kernel_type"), values=[], exportselection=0, state="readonly") tick = (self.arrayvar("check_invert", "off"), "Invert first") tooltip = "Choose the 3x3 kernel for filtering small features and the 5x5 kernel for filtering large features. The Gaussian 7x7 kernel is a new addition and seems to work better than the 3x3 for detecting small/fine objects." tooltip1 = "Wavelet analysis considers bright features on a dark background.\nIf your image consists of dark features on a bright background (e.g. a brightfield or phase contrast image), click this to invert your image." self.add_control("Filter type", widget, name="ctrl_filters", tick=tick, tooltip=tooltip, tooltip1=tooltip1) widget = tk.Scale(self.mainframe, variable=self.arrayvar("low_scale"), from_=1, to=10, tickinterval=1, orient="horizontal", showvalue=True) tooltip = "The first low number scale to allow through the filter.\nIf you have a noisy image, you may want to disregard scale 1 and possibly scale 2." self.add_control("Lower limit", widget, name="ctrl_low_scale", tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("high_scale"), from_=1, to=10, tickinterval=1, orient="horizontal", showvalue=True) tooltip = "The largest number scale to allow through the filter. To create a band-pass filter, set this to be the same scale as the lower limit scale.\nFor example, to detect spots with diameters around the 16 to 20 pixel mark, try using the 3x3 kernel and set both lower and upper limits to 4." self.add_control("Upper limit", widget, name="ctrl_high_scale", tooltip=tooltip) widget1 = ttk.Checkbutton(self.mainframe, variable=self.arrayvar( "check_threshold", "on"), text="Threshold output", onvalue="on", offvalue="off") #widget = ttk.Checkbutton(self.mainframe, variable=self.arrayvar("check_delete","off"), text="(click to zero pixels above top threshold)", onvalue="on", offvalue="off") #tooltip = "The normal operation for pixels whose intensity is above the high threshold is to clip their intensity value to that of the high threshold. Checking this box will set their intensity to the minimum threshold value.\nThis can be interesting if high intensity objects need to be discarded from the filtered image." #self.add_control("Bright pixels", widget, tooltip=tooltip) widget2 = ttk.Checkbutton(self.mainframe, variable=self.arrayvar( "check_normalise", "on"), text="Normalise output", onvalue="on", offvalue="off") widget3 = ttk.Checkbutton(self.mainframe, variable=self.arrayvar( "check_lowpass", "off"), text="Residual low-pass", onvalue="on", offvalue="off") tooltip1 = "Check the threshold box to use the sliders below to clip the low / high pixel intensity values.\nIn Threshold only (no normalisation) mode, pixels whose intensity is below the minimum threshold are set to 0." tooltip2 = "Check the normalise box to scale the output intensity range to that of the input image.\nFor example, if the input image is 16 bits, the normalised output image range will span 0 to 65535.\nFor quantitative comparisons where pixel intensity is important, you will want to work with non-normalised images." tooltip3 = "Check the low pass residual box to add the residual low-pass filter to the output (generally not needed as you will most certainly try to remove the background)." self.add_control("Options", [widget1, widget2, widget3], tooltip=tooltip1 + "\n" + tooltip2 + "\n" + tooltip3) widget = tk.Scale(self.mainframe, variable=self.arrayvar("low_thresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips low intensity / negative intensity pixels." self.add_control("Threshold min", widget, name="ctrl_low_thresh", tooltip=tooltip) widget = tk.Scale(self.mainframe, variable=self.arrayvar("high_thresh"), from_=0., to=255., resolution=0.5, tickinterval=25., orient="horizontal", showvalue=True) tooltip = "This threshold clips high intensity pixels." self.add_control("Threshold max", widget, name="ctrl_high_thresh", tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Preview filtered data for current timepoint", command=self.OnPreview, name="btn1") tooltip = "Click preview to filter a data set for the current timepoint and display the filtered data in Imaris.\nFiltered data is cached so that calculations are performed unnecessarily. Also, click preview to update the filtered image's pixel intensity range." self.add_control("Preview", widget, tooltip=tooltip) widget = ttk.Button(self.mainframe, text="Apply filter to all timepoints", command=self.OnCalculate, name="btn2") tooltip = "Click this filter every timepoint in your image/volume timelapse (this may take sone time)." self.add_control("Apply", widget, tooltip=tooltip) widget = ttk.Progressbar(self.mainframe, variable=self.arrayvar("progress"), maximum=100, mode='determinate', orient="horizontal") self.add_control("Progress", widget, name="ctrl_progress") #we have all the ingredients, now bake the dialog box! self.bake(has_live=False, has_cancel=False) #, has_preview=True) #"Calculate")