本文整理汇总了Python中ij.io.DirectoryChooser.setDefaultDirectory方法的典型用法代码示例。如果您正苦于以下问题:Python DirectoryChooser.setDefaultDirectory方法的具体用法?Python DirectoryChooser.setDefaultDirectory怎么用?Python DirectoryChooser.setDefaultDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.io.DirectoryChooser
的用法示例。
在下文中一共展示了DirectoryChooser.setDefaultDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from ij.io import DirectoryChooser [as 别名]
# 或者: from ij.io.DirectoryChooser import setDefaultDirectory [as 别名]
def main():
#filename = sys.argv[1]
#exportDir = sys.argv[2]
inputDir = "/mnt/med-groups-lmu/ls1/users/l/lsalomie/"
defaultName = "lif.lif"
outputDir = "/home/hajaalin/tmp/lifexporttest"
filename = OpenDialog("Choose LIF",inputDir,defaultName).getPath()
if not filename:
# user canceled dialog
return
chooser = DirectoryChooser("Choose export directory")
chooser.setDefaultDirectory(outputDir)
exportDir = chooser.getDirectory()
if not exportDir:
# user canceled dialog
return
# EDF parameters
params = Parameters()
params.setQualitySettings(params.QUALITY_HIGH)
params.nScales = 10
worker = EdfWorker(exportDir,params)
iterateLif(filename,worker)
示例2: actionPerformed
# 需要导入模块: from ij.io import DirectoryChooser [as 别名]
# 或者: from ij.io.DirectoryChooser import setDefaultDirectory [as 别名]
def actionPerformed(self, event):
dlg = DirectoryChooser("Choose an output directory for the classifier")
if os.path.exists(self.path):
dlg.setDefaultDirectory(self.path)
self.path = dlg.getDirectory()
IJ.log("Added path: "+self.path)