带附加实用程序的ortanc rest api python包装器

pyorthanc的Python项目详细描述


Pyorthanc

包装orthanc rest api并促进数据操作的python库。

链接到orthanc网站:https://www.orthanc-server.com/

注释: 请注意,这是包装器的早期版本(version<;1.0)。 因此,某些方法描述(可能还有名称)可能会更改,因为 它们没有充分描述相应的orthanc rest api路由的行为。 还要注意这个图书馆还在开发中。 如果Orthanc方法的描述与计划的 行为,请做一个问题。

但是,“pyorthanc”包含的对象和函数可能是 对于编写python脚本以与orthanc交互的任何人都很有用。

还要注意,测试(python setup.py test)可能只起作用 在Linux机器上。

安装

$ pip install pyorthanc

或者从存储库:

pip install git+https://gitlab.physmed.chudequebec.ca/gacou54/pyorthanc.git

或者,如果您没有安装git,请克隆存储库:

pip install -e pyorthanc.zip

特定版本

如果要查找特定版本,请使用所需的 标记arhttps://gitlab.physmed.chudequebec.ca/gacou54/pyorthanc/tags

用法示例

一定要确保奥桑奇在跑。默认url(如果在本地运行)是http://localhost:8042

使用orthanc服务器:

frompyorthancimportOrthancorthanc=Orthanc('http://localhost:8042')orthanc.setup_credentials('username','password')# If needed# To get patients identifier and main informationpatients_identifiers=orthanc.get_patients()forpatient_identifierinpatients_identifiers:patient_information=orthanc.get_patient_information(patient_identifier)# To get patient's studies identifier and main informationa_patient_identifier=patients_identifiers[0]studies_identifiers=orthanc.get_studies(a_patient_identifier)forstudy_identifierinstudies_identifiers:study_information=orthanc.get_study_information(study_identifier)

获取远程模式列表:

frompyorthancimportOrthancorthanc=Orthanc('http://localhost:8042')orthanc.setup_credentials('username','password')# If neededorthanc.get_modalities()

从远程成像设备查询(C-find)和检索(C-move):

frompyorthancimportRemoteModality,Orthancremote_modality=RemoteModality(Orthanc('http://localhost:8042'),'modality')remote_modality.setup_credentials('username','password')# If needed# Query (C-Find) on modalitydata={'Level':'Study','Query':{'PatientID':'*'}}query_response=remote_modality.query(data=data)# Retrieve (C-Move) results of query on a target modality (AET)remote_modality.move(query_response['QUERY_ID'],'target_modality')

为orhanc实例中的所有患者构建患者树结构:

每个病人都是一棵树。每棵树的层是Patient->;Study->;Series->;Instance

frompyorthancimportOrthanc,datastructurepatient_forest=datastructure.build_patient_forest(Orthanc('http://localhost:8042/'))forpatientinpatient_forest:patient_info=patient.get_main_information()forstudyinpatient.get_studies():...

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用Java代码从包含嵌套数据的Json数组中获取值   java休眠每个实体两个表   java用新行合并两个字符串   JavaGuice是否对特定实例使用注入?   java仅为安装程序和应用程序将jre嵌入WInrun4j一次   在JAVA usng Gson中解析JSON   在Java中一次遍历二叉树就能得到树的最小高度和最大高度?   按子列表中的项对Java列表进行排序   java如何使用SpringJPA存储库正确保存带有外键的对象?   java Eclipse OSGI未满足的约束   滑动菜单库的java问题   java在推断具有整数基数约束的实例时遇到的问题   java如何通过Spring Boot/Tomcat发送带有GET参数的json?   java无法解析AndroidWeetSheet库的依赖项   使用RESTAPI上载到Azure Blob存储时,java Zip存档文件会损坏   java如何在单击JButton时使用swing创建新窗口   java如何从数据库中获取序列的下一个值,并使用oracle 10g在netbeans的JOptionPane中显示它?   java Android从值中获取字符串资源Id   java在maven中将jar添加到部署程序集中的等价物是什么