本文整理匯總了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)