本文整理汇总了Python中ij.io.DirectoryChooser.replace方法的典型用法代码示例。如果您正苦于以下问题:Python DirectoryChooser.replace方法的具体用法?Python DirectoryChooser.replace怎么用?Python DirectoryChooser.replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.io.DirectoryChooser
的用法示例。
在下文中一共展示了DirectoryChooser.replace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from ij.io import DirectoryChooser [as 别名]
# 或者: from ij.io.DirectoryChooser import replace [as 别名]
def run():
bPrintLog(' ', 0)
bPrintLog('=====================================', 0)
bPrintLog('Running bAlign_Batch_v7', 0)
bPrintLog('=====================================', 0)
if len(sys.argv) < 2:
print " We need a hard-drive folder with .tif stacks as input"
print " Usage: ./fiji-macosx bALign_Batch_7 <full-path-to-folder>/"
# Prompt user for a folder
sourceFolder = DirectoryChooser("Please Choose A Directory Of .tif Files").getDirectory()
if not sourceFolder:
return 0
strippedFolder = sourceFolder.replace(' ', '')
if sourceFolder != strippedFolder:
print 'found a space in specified path. Pease remove spaces and try again.'
print 'path:', sourceFolder
errorDialog = GenericDialog('Align Batch 7 Options')
errorDialog.addMessage('bAlignBatch7 Error !!!')
errorDialog.addMessage('There can not be any spaces in the path.')
errorDialog.addMessage('Please remove spaces and try again.')
errorDialog.addMessage('Offending path is:')
errorDialog.addMessage(sourceFolder)
errorDialog.showDialog()
return 0
else:
sourceFolder = sys.argv[1] #assuming it ends in '/'
if not os.path.isdir(sourceFolder):
bPrintLog('\nERROR: run() did not find folder: ' + sourceFolder + '\n',0)
return 0
if (Options(sourceFolder)):
runOneFolder(sourceFolder)
bPrintLog('=====================================', 0)
bPrintLog('Done bAlign_Batch_v7', 0)
bPrintLog('=====================================', 0)
bPrintLog(' ', 0)