本文整理汇总了Python中slicer.app.coreIOManager函数的典型用法代码示例。如果您正苦于以下问题:Python coreIOManager函数的具体用法?Python coreIOManager怎么用?Python coreIOManager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了coreIOManager函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadNodeFromFile
def loadNodeFromFile(filename, filetype, properties={}, returnNode=False):
from slicer import app
from vtk import vtkCollection
properties['fileName'] = filename
if returnNode:
loadedNodes = vtkCollection()
success = app.coreIOManager().loadNodes(filetype, properties, loadedNodes)
return success, loadedNodes.GetItemAsObject(0)
else:
success = app.coreIOManager().loadNodes(filetype, properties)
return success
示例2: saveNode
def saveNode(self,node, filename, properties={}):
"""Save 'node' data into 'filename'.
It is the user responsability to provide the appropriate file extension.
User has also the possibility to overwrite the fileType internally retrieved using
method 'qSlicerCoreIOManager::fileWriterFileType(vtkObject*)'. This can be done
by specifiying a 'fileType'attribute to the optional 'properties' dictionary.
"""
from slicer import app
properties["nodeID"] = node.GetID();
properties["fileName"] = filename
if hasattr(properties, "fileType"):
filetype = properties["fileType"]
else:
filetype = app.coreIOManager().fileWriterFileType(node)
return app.coreIOManager().saveNodes(filetype, properties)
示例3: saveScene
def saveScene(filename, properties={}):
"""Save the current scene.
Based on the value of 'filename', the current scene is saved either
as a MRML file, MRB file or directory.
If filename ends with '.mrml', the scene is saved as a single file
without associated data.
If filename ends with '.mrb', the scene is saved as a MRML bundle (Zip
archive with scene and data files).
In every other case, the scene is saved in the directory
specified by 'filename'. Both MRML scene file and data
will be written to disk. If needed, directories and sub-directories
will be created.
"""
from slicer import app
filetype = 'SceneFile'
properties['fileName'] = filename
return app.coreIOManager().saveNodes(filetype, properties)
示例4: openAddVolumeDialog
def openAddVolumeDialog():
from slicer import app
return app.coreIOManager().openAddVolumeDialog()
示例5: openAddFiberBundleDialog
def openAddFiberBundleDialog():
from slicer import app
return app.coreIOManager().openAddFiberBundleDialog()
示例6: openSaveDataDialog
def openSaveDataDialog():
from slicer import app
return app.coreIOManager().openSaveDataDialog()
示例7: openAddColorTableDialog
def openAddColorTableDialog():
from slicer import app
return app.coreIOManager().openAddColorTableDialog()
示例8: openAddFiducialDialog
def openAddFiducialDialog():
from slicer import app
return app.coreIOManager().openAddFiducialDialog()
示例9: openAddSegmentationDialog
def openAddSegmentationDialog():
from slicer import app, qSlicerFileDialog
return app.coreIOManager().openDialog('SegmentationFile', qSlicerFileDialog.Read)
示例10: openAddTransformDialog
def openAddTransformDialog():
from slicer import app
return app.coreIOManager().openAddTransformDialog()
示例11: loadScene
def loadScene(filename, clear = True):
filetype = 'SceneFile'
properties = {'fileName':filename}
return app.coreIOManager().loadNodes(filetype, properties)
示例12: openAddScalarOverlayDialog
def openAddScalarOverlayDialog():
from slicer import app
return app.coreIOManager().openAddScalarOverlayDialog()
示例13: loadDTI
def loadDTI(filename):
from slicer import app, qSlicerIO
filetype = qSlicerIO.DTIFile
properties = {}
return app.coreIOManager().loadNodes(filetype, properties)
示例14: loadVolume
def loadVolume(filename):
from slicer import app, qSlicerIO
filetype = qSlicerIO.VolumeFile
properties = {'fileName':filename}
return app.coreIOManager().loadNodes(filetype, properties)
示例15: loadScene
def loadScene(filename, clear = True):
from slicer import app, qSlicerIO
filetype = qSlicerIO.SceneFile
properties = {'fileName':filename}
return app.coreIOManager().loadNodes(filetype, properties)