3Dslicer Developer FAQ: General | 开发人员常遇到的问题:综述

1.What is Slicer ?

3D Slicer is a free open source extensible software application for medical image computing and visualization. Mainly written in C++ and based on the NA-MIC kit, 3D Slicer relies on a variety of libraries: VTK, ITK, CTK, CMake, Qt and Python.
To ensure the stability of the application, relying on a robust software process, the source code is compiled and tested on a daily basis on a variety of platform configurations.The testing results are summarized and reported using a web-based centralized CDash dashboard. Developers of 3D Slicer can also report issues on the open mailing list or using the web-based bug tracking system.
3D Slicer consists of both a lean application core (精细的应用程序内核)and modules offering specific functionality.The core implements the user interface, provides support for data input/output (IO) andvisualization and also exposes developer interfaces that support extension of the application with new modules.
Multiple types of modules are supported: CLI, Loadable module, Scripted module(脚本模块)and Editor effect. While the developer has to choose between one of these types to implement its module, the end user won't notice the difference as they all share the same look & feel. The choice for a given type of module is usually based on the type of inputs/parameters for a given module.These modules can be either built-in or installed on demand via the extensions manager.

2.How can I get help debugging my code?

You can post questions to the developer mailing list.
Please consider:
Review the mailing list archives for similar questions(查找邮件列表档案,是否有相似问题)
If you ask a coding question, try to use a Short Self-Contained Correct Example
It's a friendly community but people are busy so if you get a terse(简短的)response don't take it personally 

3.Should core feature be implemented(实现)in C++ or Python ?

There is no one-size-fits-all answer to this.
There are many examples of "core' features of Slicer implemented using a variety of programming languages and techniques.
# MRML and most Logic operations(逻辑运算)are in C++, implemented as VTK subclasses(子类)
# the Application and most GUI functionality is in C++, implemented as QWidget subclasses (QT)
# most bundled modules are implemented as "loadable" modules, combining VTK and Qt parent classes
# many important modules bundled with Slicer are implemented as python scripted modules (LabelStatistics, ExtensionWizard...) or with hybrid C++ and Python solutions (Editor, DICOM, DataProbe...)
# other "core" features rely on JavaScript and web technologies (Charts, SceneViews, Extension Manager....)
The implementation choice depends heavily on the use case and the best judgement of the people who commit to maintain the code. If you are contributing an extension that you will maintain, you have a lot of flexibility. If you are hoping to pass off your code to others and you expect them to maintain it, then you should carefully follow the example of similar code that is already being maintained so that your code will be a pleasure to work with and not a misfit that causes trouble.
There are many reasons for implementing Slicer core in C++, we just list here few reasons:
# C++ rigor and extensive compile-time checks increases the chance of catching errors earlier. C++ enforces many things that in Python are managed by good programming practices (that are not enforced and in general not followed by Slicer developers).
# C++ memory management is much more explicit(明确的), which is more difficult to learn than Python, but allows much better efficiency (you can prevent memory fragmentation(内存碎片), optimize memory reallocations, etc), which is useful for code that may run hundreds of times per second (this code does).
# There are lots of good examples of solid, fast C++ displayable managers. Python displayable managers are more at the experimental level.
# Accessibility of Python classes from C++ modules is cumbersome. Accessibility of C++ classes is very convenient from both Python and C++ modules.
Some projects don't use Python and don't want to use it (Python brings in huge amount of additional code, which is a problem if you want to minimize the amount of code that goes through regulatory approval监管机构)
Profiling and optimization of mixed C++/Python code is very difficult (both C++ and Python profilers treat the "other side" as black hole). Since all the rest of the Slicer core is implemented in C++ (with a few small exceptions), it is much easier to implement this in C++, too.
That said, we love Python programming, do it extensively, but implementing Slicer core features in Python has just too many disadvantages.(也就是说,我们很喜欢用Python进行编程,Python也广泛应用,但是应用它来实现Slicer的核心特征就会带来很多缺点)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值