用于分析PF*系列中的DICOM文件的基本模块。

pfdicom的Python项目详细描述


https://badge.fury.io/py/pfdicom.svghttps://travis-ci.org/FNNDSC/pfdicom.svg?branch=masterhttps://img.shields.io/badge/python-3.5%2B-blue.svg

Quick Overview

  • pfdicom主要是其他更专门的类的基模块。它通常从不单独使用。

Overview

pfdicom本身提供最小的结束值。此模块/类旨在成为更深层功能的构建块。它的目的是探测给定目录文件系统中的dicom文件并构造一个树表示(使用pftree),然后,为每个目录提供读取给定dicom文件(使用pydicom)的方法,以提供一些最小的标记提取和输出文件模板。

最重要的是,这个父类的派生类可以提供详细而强大的方法来处理包含dicom文件的目录,并将结果保存到输出文件树中。例如,在这个机箱上构建了各种模块,包括pfdicom_tagExtractpfdicom_tagSub

Installation

Dependencies

以下依赖项安装在主机系统/python3 virtual env上(如果从pypi中提取,它们也将自动安装):

  • pfmisc(pf*对象系列的各种杂项模块和类)
  • pftree(创建文件系统层次结构的字典表示)

Using ^{tt1}$

安装此脚本及其所有依赖项的最佳方法是 从pypi获取它

pip3 install pfdicom

Command line arguments

-I|--inputDir <inputDir>
Input DICOM directory to examine. By default, the first file in this
directory is examined for its tag information. There is an implicit
assumption that each <inputDir> contains a single DICOM series.

[--maxdepth <dirDepth>]
The maximum depth to descend relative to the <inputDir>. Note, that
this counts from zero! Default of '-1' implies transverse the entire
directory tree.

-i|--inputFile <inputFile>
An optional <inputFile> specified relative to the <inputDir>. If
specified, then do not perform a directory walk, but convert only
this file.

[-O|--outputDir <outputDir>]
The directory to contain all output files.

[-O|--outputDir <outputDir>]
The directory to contain all output files.

[--outputLeafDir <outputLeafDirFormat>]
If specified, will apply the <outputLeafDirFormat> to the output
directories containing data. This is useful to blanket describe
final output directories with some descriptive text, such as
'anon' or 'preview'.

This is a formatting spec, so

    --outputLeafDir 'preview-%s'

where %s is the original leaf directory node, will prefix each
final directory containing output with the text 'preview-' which
can be useful in describing some features of the output set.

-e|--extension <DICOMextension>
An optional extension to filter the DICOM files of interest from the
<inputDir>.

[-t|--threads <numThreads>]
If specified, break the innermost analysis loop into <numThreads>
threads. Please note the following caveats:

    * Only thread if you have a high CPU analysis loop. Since
      most of the operations of this module will entail reading
      and writing DICOM files, and since these operations are
      the bulk of the execution time, adding threading will not
      really help.

    * Threading will change the nature of the innermost looping
      across the problem domain, with the result that *all* of the
      problem data will be read into memory! That means all of
      DICOMs across all of the subdirs! In non-threading mode,
      only DICOMs from a single directory at a time are read
      and then discarded.

This flag is less applicable to this base class. It is here
to provide fall-through compatibility with derived classes.

[-x|--man]
Show full help.

[-y|--synopsis]
Show brief help.

[--json]
If true, dump the final return as JSON formatted string.

[--followLinks]
If specified, follow symbolic links.

[--version]
If specified, print a version string.

-v|--verbosity <level>
Set the app verbosity level.

    0: No internal output;
    1: Most important internal output -- none for 'pfdicom';
    2: As with level '1' but with simpleProgress bar in 'pftree';
    3: As with level '2' but with list of input dirs/files in 'pftree';

String processing on tag values

pfidcom提供了一些关于标记值的函数,这些函数通常是基于字符串的。语法为:

%_<functionName>|<arg>_<tagName>

例如,

%_md5|7_PatientID

已确定PatientID的md5哈希。在结果字符串中,使用前7个字符。这将作为PatientID标记的值返回。

%_strmsk|******01_PatientBirthDate

PatientBirthDate值被屏蔽,因此前六个字符被保存,但最后两个字符被“01”替换。这会将PatientBirthDate设置为出生月份的第一天。

%_nospc|-_ProtocolName

处理ProtocolName以删除所有空白,并使用“-”字符而不是任何空白组件。

Examples

在目标树上运行,创建特定文件和目录结构的内部表示。

pfdicom         -I /var/www/html                \
                -O /tmp                         \
                -o %PatientID-%PatientAge       \
                -e .dcm                         \
                -v 0 --json

which will output only at script conclusion and will log a JSON formatted string.

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

推荐PyPI第三方库


热门话题
java从CSV读取并批量插入数据库Netezza   java如何减少Apache CXF客户端存根对象的内存大小?   ServletsJava。lang.NullPointerException:未设置FileItemFactory   Android中的java,是否有任何使用类格式化一组视图的方法?   java无法使用JACOB创建ActiveXComponent   java组织。日食swt。小部件。组,这个类可以被滚动吗   java如何隐藏javabean中的方法,使其不出现在wsdl中   Java函数式编程:如何将for循环中的ifelse梯形图转换为函数式?   java Openshift:在应用程序之间共享MySQL cartrige   JavaHTTPPOST请求返回HTML代码而不是JSON数据   java为什么我的合并排序比快速排序慢?   java JMH基准测试Neo4j   java在底部导航器上处理rotate,在片段上导航   java错误:链接有关字符串资源的文件资源失败   Javaservlet+ajax+jsp   java:加载带有客户端证书的HTTPS url   java如何使用自定义ConstraintValidator将ConstraintViolations添加到索引i处的列表元素   java是否可以在某些布局中对容器中的组件重新排序?