本文整理汇总了Python中ij.measure.ResultsTable.open方法的典型用法代码示例。如果您正苦于以下问题:Python ResultsTable.open方法的具体用法?Python ResultsTable.open怎么用?Python ResultsTable.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.measure.ResultsTable
的用法示例。
在下文中一共展示了ResultsTable.open方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: IJ
# 需要导入模块: from ij.measure import ResultsTable [as 别名]
# 或者: from ij.measure.ResultsTable import open [as 别名]
# IJ BAR: https://github.com/tferr/Scripts#scripts
#
# Imports numeric values copied to the clipboard into the Results table. Useful, since
# BARs that analyze tabular data can only read values from the main IJ "Results" table
#
# Requirements: Requires BAR_-XX.jar to be installed in the plugins folder of IJ
#
# NB: When copying data from withing IJ (e.g., lists from histograms or plot profiles),
# Use Edit>Options>Input/Output... to specify if column headers/row numbers should be
# copied to the clipboard
import os, sys, tempfile
from bar import Utils as barUtils
from ij import IJ
from ij.plugin.filter import Analyzer
import ij.measure.ResultsTable as RT
fd, path = tempfile.mkstemp()
try:
os.write(fd, barUtils.getClipboardText())
os.close(fd)
rt = RT.open(path) #IOException if getClipboardText()==""
if Analyzer.resetCounter():
rt.show("Results")
except:
IJ.error("Could not place clipboard into Results table.")
finally:
os.remove(path)
示例2: str
# 需要导入模块: from ij.measure import ResultsTable [as 别名]
# 或者: from ij.measure.ResultsTable import open [as 别名]
# Process list of images
for (counter, f) in enumerate(files):
# Display progress
IJ.showStatus("Processing file "+ str(counter+1) +"/"+ str(len(files)))
# Open each image and process it
imp = IJ.openImage(f)
myRoutines(imp)
# Save processed image in out_dir (enforcing .tif extension)
newpath = os.path.splitext(out_dir + imp.getTitle())[0] +".tif"
IJ.saveAsTiff(imp, newpath)
imp.close()
# Log paths of processed files
csvWriter.writerow([f, newpath])
# Display CSV log
csvFile.close()
rt = ResultsTable.open(csvPath)
rt.show("_ProcessedFileList.csv")
# Proudly inform that processing terminated
if IJ.showMessageWithCancel("All done","Reveal output directory?"):
Utils.revealFile(out_dir);
else:
# Inform no filtered files were found
IJ.error("No matches for the selected extension(s).")
示例3: CompositeImage
# 需要导入模块: from ij.measure import ResultsTable [as 别名]
# 或者: from ij.measure.ResultsTable import open [as 别名]
image_two = HyperStackConverter.toHyperStack(image,2,z_slices,1)
image = CompositeImage(image_two)
image.show()
rt = run_comdet(image)
rt.save(directory+"/"+filename+"_results.csv" )
image = IJ.getImage()
if auto_cell:
mask = generate_mask(image_green, auto_cell_thresh)
fs = FileSaver(mask)
filepath = directory + "/" + filename + "_mask.tiff"
fs.saveAsTiff(filepath)
rest = ResultsTable.open(directory+"/"+filename+"_results.csv")
#print(rest.getColumnHeadings())
remove_outside_cell(rest,mask)
rest.save(directory+"/"+filename+"_results.csv" )
else:
rest = rt
image.setDimensions(2, z_slices, 1)
image.setOpenAsHyperStack(True)