def showDialogR(R, val): """ Create dialog for input and save R values in settings """ gui = GenericDialog("Heterogeneous Z Correction") msg = "Heterogeneous Z Correction calculates an optical model\n"\ "based on rational fluorescence intensity attenuation\n"\ "over depth, in the form of (ax+b)/(x+c). Please specify\n"\ "(a,b,c) for each region. You should provide a z-stack with\n"\ "unique pixel values for each region.\n" gui.addMessage(msg) for ii in range(len(val)): gui.addNumericField( "Region " + str(ii) + " (" + str(val[ii]) + "): a", R[ii][0], 2) gui.addToSameRow() gui.addNumericField("b", R[ii][1], 2) gui.addToSameRow() gui.addNumericField("c", R[ii][2], 2) gui.addHelp( r"https://github.com/alexandrebastien/heterogeneous-z-correction") gui.showDialog() if gui.wasOKed(): R = [] for ii in range(len(val)): R = R + [ (gui.getNextNumber(), gui.getNextNumber(), gui.getNextNumber()) ] Prefs.set("HetZCorr.R", str(R)) return R else: return
def getOptions(): gd = GenericDialog("Option") gd.addNumericField("Sliding Z Projection Slices", 5, 0) # show 0 decimals gd.addHelp("http://www.robertcudmore.org/software/bSliding_Z_Projection.html") gd.showDialog() if gd.wasCanceled(): print "User cancelled dialog." return #read out options userSlices = gd.getNextNumber() return int(userSlices)
def getOptions(): global numberOfChannels global replaceExisting gd = GenericDialog("Options") gd.addNumericField("Number of channel", 2, 0) # show 0 decimals gd.addCheckbox("Replace Destination .tif files", 0) gd.addHelp("http://robertcudmore.org/software_index.html") gd.showDialog() if gd.wasCanceled(): print "User cancelled dialog." return -1 #read out options numberOfChannels = gd.getNextNumber() replaceExisting = gd.getNextBoolean() return 1 #int(numberOfChannels)
def showTable(self): """ Add the main panel to a GenericDialog and show it """ gd = GenericDialog("Roi-group table") gd.addPanel(self) # Add current table instance to panel gd.addMessage("""If you use this plugin, please cite: Laurent Thomas. (2020, November 18). LauLauThom/RoiGroupTable: ImageJ/Fiji RoiGroup Table (Version 1.0) Zenodo. http://doi.org/10.5281/zenodo.4279049""") gd.addHelp(r"https://github.com/LauLauThom/RoiGroupTable") gd.showDialog() if gd.wasOKed(): # Update ImageJ Roi group names mapping stringGroup = self.tableModel.getGroupString() Roi.setGroupNames(stringGroup)
else: # List column headers table = tableWindow.getResultsTable() headers = table.getHeadings() # Generate dialog with dropdown for column selection dialog = GenericDialog("PieChart from table column") dialog.addChoice("Data column", headers, headers[0]) dialog.addMessage( """Hover the mouse over the plot to view absolute and relative (%) values\n Right-click to set colors, export to PNG...\n Note: BarCharts usually provide better distinction than PieCharts for sectors with similar sizes (see Help).""" ) dialog.addHelp(r"https://www.data-to-viz.com/caveat/pie.html") dialog.showDialog() # Generate PieChart with data column if dialog.wasOKed(): # Get the data column as string selectedHeader = dialog.getNextChoice() column = table.getColumnAsVariables(selectedHeader) columnString = [str(item)[1:-1] for item in column] # [1:-1] to remove the "" # Make the PieChart for this data column if columnString: chart = PieChart(selectedHeader, columnString) chart.showFrame("PieChart")
from ij.gui import GenericDialog gd = GenericDialog("How to cite the plugins") gd.addMessage("""If you use these plugins, please cite : Thomas LSV, Schaefer F and Gehrig J. Fiji plugins for qualitative image annotations: routine analysis and application to image classification [version 2; peer review: 2 approved, 1 approved with reservations]. F1000Research 2021, 9:1248 doi : 10.12688/f1000research.26872.2""") #URL = r"https://doi.org/10.12688/f1000research.26872.1/" # mind the last slash at the end of URL, otherwise not working URL = r"https://f1000research.com/articles/9-1248" gd.addHelp(URL) gd.setHelpLabel("Article page") gd.hideCancelButton() gd.showDialog()