本文整理汇总了Python中importer.Importer.makeImport方法的典型用法代码示例。如果您正苦于以下问题:Python Importer.makeImport方法的具体用法?Python Importer.makeImport怎么用?Python Importer.makeImport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类importer.Importer
的用法示例。
在下文中一共展示了Importer.makeImport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImportChooser
# 需要导入模块: from importer import Importer [as 别名]
# 或者: from importer.Importer import makeImport [as 别名]
#.........这里部分代码省略.........
caption = QtGui.QApplication.translate(
"ImportChooser", "Select the directory of DICOMs", None, QtGui.QApplication.UnicodeUTF8
)
options = QtGui.QFileDialog.ShowDirsOnly
dialog = QtGui.QFileDialog.getExistingDirectory(self, caption, lastdir, options)
if dialog:
# while QtCore.QCoreApplication.hasPendingEvents():
# QtCore.QCoreApplication.processEvents()
self.loadDirectory(dialog)
settings.setValue("ImportChooser-last-dir", dialog)
def slotActionImport(self):
logging.debug("In ImportChooser::slotActionImport()")
self._firstImport = True
self._msg = QtGui.QApplication.translate(
"ImportChooser", "Importing series...", None, QtGui.QApplication.UnicodeUTF8
)
series = []
for i in range(self.itemModel.rowCount()):
if self.itemModel.data(self.itemModel.index(i, 1), QtCore.Qt.CheckStateRole) == QtCore.Qt.Checked:
series.append(self.itemModel.data(self.itemModel.index(i, 6)))
self._importer.series[self.itemModel.data(self.itemModel.index(i, 6))]["error"] == False
if len(series) == 0:
QtGui.QMessageBox.information(
self,
QtGui.QApplication.translate("ImportChooser", "Warning", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate(
"ImportChooser", "There is no serie selected!", None, QtGui.QApplication.UnicodeUTF8
),
)
elif len(series) <= self._availableStudies or self._availableStudies == -1:
self.cancelButton.setDisabled(False)
self._importer.makeImport(series)
self.addButton.setDisabled(True)
self.importButton.setDisabled(True)
self.stopButton.setEnabled(True)
self.recursiveCheck.setDisabled(True)
self.tableView.setEnabled(False)
self.progressLabel.show()
self.updateProgress()
else:
QtGui.QMessageBox.critical(
self,
QtGui.QApplication.translate("ImportChooser", "Error", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate(
"ImportChooser",
"You do not have sufficient series available. Please uncheck the excess!",
None,
QtGui.QApplication.UnicodeUTF8,
),
)
def updateWidgets(self):
logging.debug("In ImportChooser::updateWidgets()")
self.itemModel = QtGui.QStandardItemModel()
self.itemModel.setHorizontalHeaderLabels(
[
" ",
" ",
QtGui.QApplication.translate("ImportChooser", "Progress", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate("ImportChooser", "Patient", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate("ImportChooser", "Description", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate("ImportChooser", "Images", None, QtGui.QApplication.UnicodeUTF8),
QtGui.QApplication.translate("ImportChooser", "UID", None, QtGui.QApplication.UnicodeUTF8),
]