TOPAS MC上有安装general extension的教程,在To add User Extensions部分中。GitHub dicom-interface的readme应该是由于长时间没有更新,所以有些错误。本文是在Linux系统下安装RTion extension,其他系统应该也能借鉴。计算机小白,很多地方都是试错试出来,或者在论坛上找回答。
1. 下载Geant4Headers_106P3.zip
把Geant4Headers_106P3.zip拖到topas的路径下后解压,会得到一个在topas路径下的Geant4Headers文件夹,里面有一些头文件。
2. 如果没有cmake,需要下载安装cmake
TOPAS有安装教程,CMake for Debian 10: apt install -y cmake
如果在没有root权限的服务器安装cmake,可以查看 (12条消息) Ubuntu非root用户安装CMake_L_by_D的博客-CSDN博客
-bash: ./bootstrap: Permission denied 的解决方法(12条消息) cmake在非foot时安装教程及Permission denied解决方案_superdan5的博客-CSDN博客
我的服务器还没有装gcc和g++。。所以装cmake的时候会报错。以下是在装好cmake的虚拟机进行的
3. 下载dicom-interface扩展包,rti.git
下载地址GitHub - topasmc/dicom-interface: DICOM RT Interface for TOPAS
扩展包不要放在topas路径下,我放在/home/username/Desktop/topas_extensions中。
或者直接用命令行
$ cd /home/username/Desktop/topas_extensions
$ git clone https://github.com/topasmc/dicom-interface rti.git
4. 下载gdcm
下载2.4或2.6版本,因为作者说
“ GDCM (tested versions are 2.4 and 2.6.) library (header and objects) is required. tested versions are 2.4 and 2.6. version 3.0 doesn't work with RTI (thank to Dohyeon). ”
我下载的GDCM-2.6.9-Linux-x86_64,下载地址 Release v2.6.9: Fix bug 427 · malaterre/GDCM · GitHub
5. 修改topas路径下的CMakeLists.txt, 在include_directories中添加两行
include_directories (
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/extensions
${PROJECT_SOURCE_DIR}/Geant4Headers
${PROJECT_SOURCE_DIR}/include
/home/username/Desktop/topas_extensions/rti.git/
/home/username/Desktop/GDCM-2.6.9-Linux-x86_64/include/gdcm-2.6/
)
README.md 中写的是
include_directories ( ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/extensions ${PROJECT_SOURCE_DIR}/Geant4Headers ${PROJECT_SOURCE_DIR}/include /<your_sw_path>/rti.git/ /<your_gdcm_include_path>/gdcm-<version>/ )但如果最后一行只写到/home/username/Desktop/GDCM-2.6.9-Linux-x86_64/,会报错
6. 我也不知道这一步叫啥
在topas的路径下打开终端(即目前目录位于topas路径中),输入命令行
$ cmake -DTOPAS_EXTENSIONS_DIR=/home/username/Desktop/topas_extensions/rti.git/rti/topas/rtion .
$ make -j4
第一行的最后有个“空格+.”,我不知道为什么(捂脸),readme里是这么写的,如果不加这个的话会报cmake warning, 但不会影响后面的make。随后的make也会有warning (不管上一行有没有加“空格+.”)。作者说
“Don't worry about any "Warning" messages. Only worry about messages that say "Error".”
如果后续还需要其他扩展
“If you add additional extensions to your extensions directory, again run the full cmake -DTOPAS_EXTENSIONS_DIR=/Applications/topas_extensions make”
7. 测试是否安装成功
$ cd /home/username/Desktop/topas_extensions/rti.git/rti/topas/tutorial
$ /home/username/Desktop/topas/bin/topas view.txt
以上!
2022.10.23