python - Jupyter 内核在尝试另存为 .VTP 文件时死机
问题描述
我正在尝试执行一个需要.VTP
文件作为输入的 vmtkfunction,但我需要一个.VTP
文件作为输出。但是,每次将输出文件位置指定为.VTP
文件时,我都会收到一条错误消息,提示我的内核自动停止并需要重新启动。当运行相同的命令行但使用.vti
文件作为输出时,笔记本工作并运行。但是,对于我要执行的下一个操作,我需要一个.vtp
文件作为输入。
我的代码如下:
from vmtk import vmtkscripts
vmtk_image = vmtkscripts.vmtkImageReader() #load vmtkImageReader to read images
vmtk_image.InputFileName = 'input.vti'
vmtk_image.Execute() #actually executing of the file being read.
vmtk_to_numpy_image = vmtkscripts.vmtkImageToNumpy()
vmtk_to_numpy_image.Image = vmtk_image.Image
vmtk_to_numpy_image.Execute()
vmtk_segmentation = vmtkscripts.vmtkLevelSetSegmentation() #import the LevelSetSegmentation function in jupyter notebook
vmtk_segmentation.Image = vmtk_to_numpy_image.Image #define which image has to be segmentated
vmtk_segmentation.LevelSetsOutputFileName = 'output.vtp'
vmtk_segmentation.Execute()
vmtk_segmentation.IOWrite()
vmtk_smoothing_surface = vmtkscripts.vmtkSurfaceSmoothing()
vmtk_smoothing_surface.SurfaceInputFileName = 'output.vtp'
vmtk_smoothing_surface.Execute()
解决方案
推荐阅读
- javascript - 根据包括键名在内的值进行排序
- apache-spark - 有条件的 PySpark 窗口
- arrays - 在 Swift 中通过多个关键字过滤对象
- python - tensorflow:InvalidArgumentError 同时找到 AUC 分数
- java - Camel DynamicEndpoint toD 和 Http-Component 的问题
- javascript - 赫斯基 5 .huskey gitignore
- mapstruct - MapStruct:从多个变量映射到一个集合
- git - 将子文件夹推送到 GitHub,而不是父目录
- hibernate-search - 检查索引字段是否存在
- datetime - 如何以用户定义的日期格式从 Google 地球引擎导出带有属性数据和关联日期的 csv 文件?