def getOptions(): gui = GenericDialogPlus("Options for Moving TIFF files") gui.addMessage("Select the number of imput files to be used per stitched image") gui.addSlider("", 2, 10, 2) gui.addFileField("Select csv file", "") gui.addMessage("Add key values and corresponding genotype, when finished, leave fields empty") gui.addStringField("Key :", prefs.get(None, "key1", "p")) gui.addToSameRow() gui.addStringField("Genotype :", prefs.get(None, "genotype1", "PROM-1_HA")) gui.addStringField("Key :", prefs.get(None, "key2", "p")) gui.addToSameRow() gui.addStringField("Genotype :", prefs.get(None, "genotype2", "PROM-1_HA")) gui.addStringField("Key :", prefs.get(None, "key3", "p")) gui.addToSameRow() gui.addStringField("Genotype :", prefs.get(None, "genotype3", "PROM-1_HA")) gui.addStringField("Key :", prefs.get(None, "key4", "p")) gui.addToSameRow() gui.addStringField("Genotype :", prefs.get(None, "genotype4", "PROM-1_HA")) gui.addStringField("Key :", prefs.get(None, "key5", "p")) gui.addToSameRow() gui.addStringField("Genotype :", prefs.get(None, "genotype5", "PROM-1_HA")) gui.showDialog() if gui.wasOKed(): tiffs_per_image = int(gui.getNextNumber()) csv_file = str(gui.getNextString()) genotypes = {} for i in range(5): key = str(gui.getNextString()) value = str(gui.getNextString()) if key != "": genotypes[key] = value else: return if len(genotypes) > 0: a = list(genotypes.items())[0] prefs.put(None, "key1", a[0]) prefs.put(None, "genotype1", a[1]) if len(genotypes) > 1: a = list(genotypes.items())[1] prefs.put(None, "key2", a[0]) prefs.put(None, "genotype2", a[1]) if len(genotypes) > 2: a = list(genotypes.items())[2] prefs.put(None, "key3", a[0]) prefs.put(None, "genotype3", a[1]) if len(genotypes) > 3: a = list(genotypes.items())[3] prefs.put(None, "key4", a[0]) prefs.put(None, "genotype4", a[1]) if len(genotypes) > 4: a = list(genotypes.items())[4] prefs.put(None, "key5", a[0]) prefs.put(None, "genotype5", a[1]) return tiffs_per_image, csv_file, genotypes
def dialog(imp2, labelColorBarImp): gd = GenericDialogPlus("ROI labeller") categories=11 #placeholder slider variables so the class can be initiated slider1=0 slider2=0 slider3=0 slider4=0 test=previewLabelerAndListeners(imp2, slider1,slider2,slider3,slider4, gd) for i in range(1,categories): gd.addButton("label "+str(i), test) gd.addImage(labelColorBarImp) #imp7.close() - causes an error as image needed for the dialog gd.addButton("Set top",test) gd.addButton("Whole stack",test) gd.addButton("Set bottom", test) gd.addSlider("Top",1, imp2.getStackSize(), 1) gd.addSlider("Bottom",1, imp2.getStackSize(),imp2.getStackSize()) gd.addSlider("Minimum ROI size", 0, 9999, 0, 1) gd.addSlider("Maximum ROI size", 1, 10000, 10000, 1) slider1=gd.getSliders().get(0) slider2=gd.getSliders().get(1) test.slider1=slider1 test.slider2=slider2 slider3=gd.getSliders().get(2) slider4=gd.getSliders().get(3) test.slider3=slider3 test.slider4=slider4 slider1.addAdjustmentListener(test) slider2.addAdjustmentListener(test) slider3.addAdjustmentListener(test) slider4.addAdjustmentListener(test) gd.addChoice("Apply labeling to:", ["(Sub)stack", "Slice"], "(Sub)stack") gd.setLayout(GridLayout(0,2)) gd.setModal(False) buttons=gd.getButtons() gd.showDialog() while ((not gd.wasCanceled()) and not (gd.wasOKed())): Thread.sleep(50) return test
def previewDialog(imp): gd = GenericDialogPlus("Nuclear segmentation and quantification v1.01") #create a list of the channels in the provided imagePlus types = [] for i in xrange(1, imp.getNChannels() + 1): types.append(str(i)) #user can pick which channel to base the segmentation on gd.addChoice("Channel number to use for segmentation", types, types[0]) gd.addChoice("Channel to quantify", types, types[0]) methods = [ "Otsu", "Default", "Huang", "Intermodes", "IsoData", "IJ_IsoData", "Li", "MaxEntropy", "Mean", "MinError", "Minimum", "Moments", "Percentile", "RenyiEntropy", "Shanbhag", "Triangle", "Yen" ] gd.addChoice("Autosegmentation method", methods, methods[0]) intensities = ["254", "4094", "65534"] gd.addChoice("Max Intensity", intensities, intensities[-1]) gd.addSlider("Small DoG sigma", 0.5, 10, 1, 0.1) gd.addSlider("Large DoG sigma", 0.5, 20, 5, 0.1) gd.addCheckbox("TopHat background subtraction? (Slower, but better) ", True) gd.addSlider("TopHat sigma", 5, 20, 8, 0.1) gd.setModal(False) gd.addCheckbox("Manually set threshold? ", False) gd.addSlider("Manual threshold", 10, 65534, 2000, 1) gd.hideCancelButton() gd.showDialog() cal = imp.getCalibration() pixelAspect = (cal.pixelDepth / cal.pixelWidth) originalTitle = imp1.getTitle() choices = gd.getChoices() print choices sliders = gd.getSliders() checkboxes = gd.getCheckboxes() segmentChannel = int(choices.get(0).getSelectedItem()) quantChannel = int(choices.get(1).getSelectedItem()) thresholdMethod = choices.get(2).getSelectedItem() maxIntensity = int(choices.get(3).getSelectedItem()) gaussianSigma = sliders.get(0).getValue() / 10.0 largeDoGSigma = gd.sliders.get(1).getValue() / 10.0 topHat = gd.checkboxes.get(0).getState() topHatSigma = gd.sliders.get(2).getValue() / 10.0 manualSegment = gd.checkboxes.get(1).getState() manualThreshold = gd.sliders.get(3).getValue() segmentChannelOld = segmentChannel thresholdMethodOld = thresholdMethod maxIntensityOld = maxIntensity gaussianSigmaOld = gaussianSigma largeDoGSigmaOld = largeDoGSigma topHatOld = topHat topHatSigmaOld = topHatSigma manualSegmentOld = manualSegment manualThresholdOld = manualThreshold clij2.clear() segmentImp = extractChannel(imp1, segmentChannel, 0) try: gfx1 = clij2.push(segmentImp) gfx2 = clij2.create(gfx1) gfx3 = clij2.create(gfx1) gfx4 = clij2.create(gfx1) gfx5 = clij2.create(gfx1) gfx7 = clij2.create([imp.getWidth(), imp.getHeight()]) except: try: Thread.sleep(500) IJ.log( "Succeeded to sending to graphics card on the second time...") gfx1 = clij2.push(segmentImp) gfx2 = clij2.create(gfx1) gfx3 = clij2.create(gfx1) gfx4 = clij2.create(gfx1) gfx5 = clij2.create(gfx1) gfx7 = clij2.create([imp.getWidth(), imp.getHeight()]) except: errorDialog( """Could not send image to graphics card, it may be too large! Easy solutions: Try processing as 8-bit, cropping or scaling the image, or select a different CLIJ2 GPU. This issue is often intermittent, so trying again may also work! See the "Big Images on x graphics cards' notes at: https://clij2.github.io/clij2-docs/troubleshooting for more solutions """ + str(clij2.reportMemory())) gfx1, gfx2, gfx3, gfx4, gfx5 = segment(gfx1, gfx2, gfx3, gfx4, gfx5, gaussianSigma, thresholdMethod, maxIntensity, largeDoGSigma, pixelAspect, originalTitle, topHat, topHatSigma, manualSegment, manualThreshold) clij2.maximumZProjection(gfx5, gfx7) labelPrevImp = clij2.pull(gfx7) IJ.setMinAndMax(labelPrevImp, 0, clij2.getMaximumOfAllPixels(gfx7)) labelPrevImp.setTitle("Preview segmentation") labelPrevImp.show() IJ.run("glasbey_inverted") while ((not gd.wasCanceled()) and not (gd.wasOKed())): segmentChannel = int(choices.get(0).getSelectedItem()) quantChannel = int(choices.get(1).getSelectedItem()) thresholdMethod = choices.get(2).getSelectedItem() maxIntensity = int(choices.get(3).getSelectedItem()) gaussianSigma = sliders.get(0).getValue() / 10.0 largeDoGSigma = gd.sliders.get(1).getValue() / 10.0 topHat = gd.checkboxes.get(0).getState() topHatSigma = gd.sliders.get(2).getValue() / 10.0 manualSegment = gd.checkboxes.get(1).getState() manualThreshold = gd.sliders.get(3).getValue() if (segmentChannelOld != segmentChannel or thresholdMethodOld != thresholdMethod or maxIntensityOld != maxIntensity or gaussianSigmaOld != gaussianSigma or largeDoGSigmaOld != largeDoGSigma or topHatOld != topHat or topHatSigmaOld != topHatSigma or manualSegmentOld != manualSegment or manualThresholdOld != manualThreshold): if segmentChannelOld != segmentChannel: clij2.clear() segmentImp = extractChannel(imp1, segmentChannel, 0) gfx1 = clij2.push(segmentImp) gfx2 = clij2.create(gfx1) gfx3 = clij2.create(gfx1) gfx4 = clij2.create(gfx1) gfx5 = clij2.create(gfx1) gfx7 = clij2.create([imp.getWidth(), imp.getHeight()]) gfx1, gfx2, gfx3, gfx4, gfx5 = segment( gfx1, gfx2, gfx3, gfx4, gfx5, gaussianSigma, thresholdMethod, maxIntensity, largeDoGSigma, pixelAspect, originalTitle, topHat, topHatSigma, manualSegment, manualThreshold) clij2.maximumZProjection(gfx5, gfx7) labelPrevImp.close() labelPrevImp = clij2.pull(gfx7) IJ.setMinAndMax(labelPrevImp, 0, clij2.getMaximumOfAllPixels(gfx7)) labelPrevImp.setTitle("Preview segmentation") labelPrevImp.show() IJ.run("glasbey_inverted") segmentChannelOld = segmentChannel thresholdMethodOld = thresholdMethod maxIntensityOld = maxIntensity gaussianSigmaOld = gaussianSigma largeDoGSigmaOld = largeDoGSigma topHatOld = topHat topHatSigmaOld = topHatSigma manualSegmentOld = manualSegment manualThresholdOld = manualThreshold Thread.sleep(200) labelPrevImp.close() return segmentChannel, quantChannel, thresholdMethod, maxIntensity, gaussianSigma, largeDoGSigma, topHat, topHatSigma, manualSegment, manualThreshold
scaleY = calib.pixelHeight / calib.pixelDepth * zoom; scaleZ = 1.0 * zoom; # initialize state input = None; formerT = None; resultCylinderMaxProjection = None; resultMaxProjection = None; spots = None; circles = None; blobs = None; # build up user interface gdp = GenericDialogPlus("Spot detection workflow"); gdp.addMessage("Noise and background subtraction (DoG)"); gdp.addCheckbox("Do noise and background subtraction ", formerDoNoiseAndBackgroundRemoval); gdp.addSlider("Sigma 1 (in 0.1 pixel)", 0, 100, formerSigma1); gdp.addSlider("Sigma 2 (in 0.1 pixel)", 0, 100, formerSigma2); gdp.addMessage("Rigid transform"); gdp.addCheckbox("Do rigid transformation", formerDoRigidTransform); gdp.addSlider("Translation X (in pixel)", -100, 100, formerTranslationX); gdp.addSlider("Translation Y (in pixel)", -100, 100, formerTranslationY); gdp.addSlider("Translation Z (in pixel)", -100, 100, formerTranslationZ); gdp.addSlider("Rotation X (in degrees)", -180, 180, formerRotationX); gdp.addSlider("Rotation Y (in degrees)", -180, 180, formerRotationY); gdp.addSlider("Rotation Z (in degrees)", -180, 180, formerRotationZ); gdp.addMessage("Spot detection") gdp.addCheckbox("Do spot detection", formerDoSpotDetection); gdp.addSlider("Tolerance", 0, 100, formerTolerance); gdp.addSlider("Threshold", 0, 100, formerThreshold); gdp.setModal(False);
## Create GUI Win = GenericDialogPlus("Multiple Template Matching") Win.addImageChoice("Template", prefs.get("Template", "Choice")) Win.addImageChoice("Image", prefs.get("Image", "Choice")) Win.addCheckbox("Flip_template_vertically", prefs.getInt("FlipV", False)) Win.addCheckbox("Flip_template_horizontally", prefs.getInt("FlipH", False)) Win.addStringField("Rotate template by ..(comma-separated)", prefs.get("Angles", "")) Win.addChoice("Matching_method", [ "Normalised Square Difference", "Normalised cross-correlation", "Normalised 0-mean cross-correlation" ], prefs.get("Method", "Normalised 0-mean cross-correlation")) Win.addNumericField("Number_of_objects expected", prefs.getInt("N_hit", 1), 0) Win.addMessage("If more than 1 object expected :") Win.addSlider("Score_Threshold", 0, 1, prefs.getFloat("Score_Threshold", 0.5), 0.1) #Win.addNumericField("Min_peak_height relative to neighborhood ([0-1], decrease to get more hits)", prefs.getFloat("Tolerance",0.1), 2) Win.addSlider("Maximal_overlap between Bounding boxes", 0, 1, prefs.getFloat("MaxOverlap", 0.4), 0.1) Win.addMessage("Outputs") Win.addCheckbox("Add_ROI detected to ROI manager", prefs.getInt("AddRoi", True)) Win.addCheckbox("Show_result table", prefs.getInt("ShowTable", False)) Win.addMessage("Version 1.1.2") Win.addMessage("""If you use this plugin please cite : Thomas, L.S.V., Gehrig, J. Multi-template matching: a versatile tool for object-localization in microscopy images. BMC Bioinformatics 21, 44 (2020). https://doi.org/10.1186/s12859-020-3363-7""") Win.addHelp( "https://github.com/multi-template-matching/MultiTemplateMatching-Fiji/wiki" )
# final Action (Test, Run, Write Script) gd.addChoice("Action",["Test","Write Script","Run"],"Write Script") font=Font("SansSerif",Font.BOLD,12) # Advanced options gd.setInsets(25,100,10) gd.addMessage("Advanced Options:",font) advancedoptionsf=gd.getMessage() ncores=Runtime.getRuntime().availableProcessors() defaultCores=1 if ncores >=8: defaultCores=4 elif ncores>=4: defaultCores=2 gd.addSlider("Number of cpu cores to use",1,ncores,defaultCores) gd.setInsets(0,230,10) gd.addCheckbox("Verbose log messages",False) gd.addStringField("Output folder suffix","",20) outsuffixf = gd.getStringFields().get(3) gd.addStringField("(Further) Registration Params","",50); regparamf = gd.getStringFields().get(4) gd.addStringField("Additional Arguments to munger.pl","",50); regrootf.addTextListener(RegRootListener()) imgdirf.addTextListener(ImageDirListener()) outsuffixf.addTextListener(OuputSuffixListener()) choicef.addItemListener(RegParamListener())
def previewDialog(imp): gd = GenericDialogPlus("FRETENATOR") #create a list of the channels in the provided imagePlus types = [] for i in xrange(1, imp.getNChannels()+1): types.append(str(i)) gd.addMessage("""Rowe, J. H, Rizza, A., Jones A. M. (2022) Quantifying phytohormones in vivo with FRET biosensors and the FRETENATOR analysis toolset Methods in Molecular Biology Rowe, JH., Grangé-Guermente, M., Exposito-Rodriguez, M.,Wimalasekera, R., Lenz, M., Shetty, K., Cutler, S., Jones, AM., Next-generation ABACUS biosensors reveal cellular ABA dynamics driving root growth at low aerial humidity """) #user can pick which channel to base the segmentation on if len(types)>2: gd.addChoice("Channel number to use for segmentation", types, types[2]) gd.addChoice("Channel number to use for donor", types, types[0]) gd.addChoice("Channel number to use for acceptor (FRET)", types, types[1]) gd.addChoice("Channel number to use for acceptor", types, types[2]) #print('YAY') else: gd.addChoice("Channel number to use for segmentation", types, types[-1]) gd.addChoice("Channel number to use for donor", types, types[0]) gd.addChoice("Channel number to use for acceptor (FRET)", types, types[-2]) gd.addChoice("Channel number to use for acceptor", types, types[-1]) methods=["Otsu","Default", "Huang", "Intermodes", "IsoData", "IJ_IsoData", "Li", "MaxEntropy", "Mean", "MinError", "Minimum", "Moments", "Percentile", "RenyiEntropy", "Shanbhag", "Triangle", "Yen"] gd.addChoice("Autosegmentation method", methods, methods[0]) intensities=["254", "4094", "65534"] gd.addChoice("Max Intensity", intensities, intensities[-1]) gd.addSlider("Small DoG sigma", 0.5, 10, 0.8, 0.1) gd.addSlider("Large DoG sigma", 0.5, 20, 4 ,0.1) gd.addCheckbox("TopHat background subtraction? (Slower, but better) ", False) gd.addSlider("TopHat sigma", 5, 20, 8 ,0.1) gd.setModal(False) gd.addCheckbox("Manually set threshold? ", False) gd.addSlider("Manual threshold", 10, 65534, 2000, 1) dilationOptions=["0", "1", "2","3", "4", "5", "6"] gd.addChoice("Dilation?", dilationOptions, "0") gd.addCheckbox("Size exclusion of ROI? ", False) gd.addSlider("Minimum ROI size", 0, 9999, 20, 1) gd.addSlider("Maximum ROI size", 1, 10000, 10000, 1) gd.addCheckbox("Create nearest point projection with outlines (SLOW)? ", True) gd.addCheckbox("Watershed object splitting? ", True) gd.showDialog() cal = imp.getCalibration() pixelAspect=(cal.pixelDepth/cal.pixelWidth) originalTitle=imp1.getTitle() choices=gd.getChoices() sliders=gd.getSliders() checkboxes=gd.getCheckboxes() segmentChannel=int(choices.get(0).getSelectedItem()) donorChannel=int(choices.get(1).getSelectedItem()) acceptorChannel=int(choices.get(2).getSelectedItem()) acceptorChannel2=int(choices.get(3).getSelectedItem()) thresholdMethod=choices.get(4).getSelectedItem() maxIntensity=int(choices.get(5).getSelectedItem()) gaussianSigma=sliders.get(0).getValue()/10.0 largeDoGSigma = gd.sliders.get(1).getValue()/10.0 topHat=gd.checkboxes.get(0).getState() topHatSigma=gd.sliders.get(2).getValue()/10.0 manualSegment = gd.checkboxes.get(1).getState() manualThreshold=gd.sliders.get(3).getValue() dilation=int(choices.get(6).getSelectedItem()) sizeExclude=gd.checkboxes.get(2).getState() minSize = gd.sliders.get(4).getValue() maxSize = gd.sliders.get(5).getValue() watershed = gd.checkboxes.get(4).getState() #print dir(gd.sliders.get(5)) #print maxSize segmentChannelOld=segmentChannel thresholdMethodOld=thresholdMethod maxIntensityOld=maxIntensity gaussianSigmaOld=gaussianSigma largeDoGSigmaOld= largeDoGSigma topHatOld=topHat topHatSigmaOld=topHatSigma manualSegmentOld= manualSegment manualThresholdOld=manualThreshold dilationOld=dilation sizeExcludeOld=sizeExclude minSizeOld=minSize maxSizeOld=maxSize watershedOld=watershed clij2.clear() segmentImp=extractChannel(imp1, segmentChannel, 0) try: gfx1=clij2.push(segmentImp) gfx2=clij2.create(gfx1) gfx3=clij2.create(gfx1) gfx4=clij2.create(gfx1) gfx5=clij2.create(gfx1) gfx7=clij2.create([imp.getWidth(), imp.getHeight()]) except: try: Thread.sleep(500) print("Succeeded to sending to graphics card on the second time...") gfx1=clij2.push(segmentImp) gfx2=clij2.create(gfx1) gfx3=clij2.create(gfx1) gfx4=clij2.create(gfx1) gfx5=clij2.create(gfx1) gfx7=clij2.create([imp.getWidth(), imp.getHeight()]) except: errorDialog("""Could not send image to graphics card, it may be too large! Easy solutions: Try processing as 8-bit, cropping or scaling the image, or select a different CLIJ2 GPU. This issue is often intermittent, so trying again may also work! See the "Big Images on x graphics cards' notes at: https://clij2.github.io/clij2-docs/troubleshooting for more solutions """ + str(clij2.reportMemory()) ) gfx1,gfx2,gfx3,gfx4,gfx5 = segment(gfx1,gfx2,gfx3,gfx4,gfx5, gaussianSigma, thresholdMethod,maxIntensity, largeDoGSigma, pixelAspect, originalTitle, topHat, topHatSigma , manualSegment, manualThreshold, dilation,sizeExclude, minSize, maxSize, watershed) clij2.maximumZProjection(gfx5, gfx7) labelPrevImp= clij2.pull(gfx7) IJ.setMinAndMax(labelPrevImp, 0,clij2.getMaximumOfAllPixels(gfx7)) labelPrevImp.setTitle("Preview segmentation") labelPrevImp.show() IJ.run("glasbey_inverted") while ((not gd.wasCanceled()) and not (gd.wasOKed())): segmentChannel=int(choices.get(0).getSelectedItem()) donorChannel=int(choices.get(1).getSelectedItem()) acceptorChannel=int(choices.get(2).getSelectedItem()) acceptorChannel2=int(choices.get(3).getSelectedItem()) thresholdMethod=choices.get(4).getSelectedItem() maxIntensity=int(choices.get(5).getSelectedItem()) gaussianSigma=sliders.get(0).getValue()/10.0 largeDoGSigma = gd.sliders.get(1).getValue()/10.0 topHat=gd.checkboxes.get(0).getState() topHatSigma=gd.sliders.get(2).getValue()/10.0 manualSegment = gd.checkboxes.get(1).getState() manualThreshold = gd.sliders.get(3).getValue() dilation=int(choices.get(6).getSelectedItem()) sizeExclude=gd.checkboxes.get(2).getState() minSize = gd.sliders.get(4).getValue() maxSize = gd.sliders.get(5).getValue() watershed = gd.checkboxes.get(4).getState() if (segmentChannelOld !=segmentChannel or thresholdMethodOld !=thresholdMethod or maxIntensityOld !=maxIntensity or gaussianSigmaOld !=gaussianSigma or largeDoGSigmaOld != largeDoGSigma or topHatOld !=topHat or topHatSigmaOld !=topHatSigma or manualSegmentOld != manualSegment or manualThresholdOld !=manualThreshold or dilation != dilationOld or sizeExcludeOld!=sizeExclude or minSizeOld!=minSize or maxSizeOld!=maxSize or watershedOld!=watershed ): if minSizeOld!=minSize: if minSize>=maxSize: maxSize=minSize+1 gd.sliders.get(5).setValue(maxSize) if maxSizeOld!=maxSize: if minSize>=maxSize: minSize=maxSize-1 gd.sliders.get(4).setValue(minSize) if segmentChannelOld!=segmentChannel: clij2.clear() segmentImp=extractChannel(imp1, segmentChannel, 0) gfx1=clij2.push(segmentImp) gfx2=clij2.create(gfx1) gfx3=clij2.create(gfx1) gfx4=clij2.create(gfx1) gfx5=clij2.create(gfx1) gfx7=clij2.create([imp.getWidth(), imp.getHeight()]) gfx1,gfx2,gfx3,gfx4,gfx5 = segment(gfx1,gfx2,gfx3,gfx4,gfx5, gaussianSigma, thresholdMethod,maxIntensity, largeDoGSigma, pixelAspect, originalTitle, topHat,topHatSigma, manualSegment, manualThreshold, dilation,sizeExclude, minSize, maxSize, watershed) clij2.maximumZProjection(gfx5, gfx7) labelPrevImp.close() labelPrevImp= clij2.pull(gfx7) IJ.setMinAndMax(labelPrevImp, 0,clij2.getMaximumOfAllPixels(gfx7)) labelPrevImp.setTitle("Preview segmentation") labelPrevImp.show() IJ.run("glasbey_inverted") segmentChannelOld=segmentChannel thresholdMethodOld=thresholdMethod maxIntensityOld=maxIntensity gaussianSigmaOld=gaussianSigma largeDoGSigmaOld = largeDoGSigma topHatOld=topHat topHatSigmaOld=topHatSigma manualSegmentOld= manualSegment manualThresholdOld=manualThreshold dilationOld=dilation sizeExcludeOld=sizeExclude minSizeOld=minSize maxSizeOld=maxSize watershedOld=watershed Thread.sleep(200) labelPrevImp.close() makeNearProj = gd.checkboxes.get(3).getState() return segmentChannel, donorChannel, acceptorChannel, acceptorChannel2, thresholdMethod, maxIntensity, gaussianSigma, largeDoGSigma, topHat, topHatSigma, manualSegment, manualThreshold, makeNearProj, dilation, sizeExclude, minSize, maxSize, watershed
gd.addChoice("Action", ["Test", "Write Script", "Run (Experimental)"], "Write Script") font = Font("SansSerif", Font.BOLD, 12) # Advanced options gd.setInsets(25, 100, 10) gd.addMessage("Advanced Options:", font) advancedoptionsf = gd.getMessage() ncores = Runtime.getRuntime().availableProcessors() defaultCores = 1 if ncores >= 8: defaultCores = 4 elif ncores >= 4: defaultCores = 2 gd.addSlider("Number of cpu cores to use", 1, ncores, defaultCores) gd.setInsets(0, 230, 10) gd.addCheckbox("Verbose log messages", False) gd.addStringField("Output folder suffix", "", 20) outsuffixf = gd.getStringFields().get(3) gd.addStringField("(Further) Registration Params", "", 50) regparamf = gd.getStringFields().get(4) gd.addStringField("Additional Arguments to munger.pl", "", 50) regrootf.addTextListener(RegRootListener()) imgdirf.addTextListener(ImageDirListener()) outsuffixf.addTextListener(OuputSuffixListener()) choicef.addItemListener(RegParamListener())