This release is a pre-release and may not be stable for production use.
神经元数据处理工具(npu)
图像与 SWC 需同名,例如 1.tif / 1.swc。
安装
pip install neuron-process-utils
# 开发:
# pip install -e .
距离类型(--dist-type / -t)
| 类型 | 别名 | 含义 |
|---|---|---|
soft_centerline(默认) |
neurolink |
NeuroLink 线性 soft:细骨架 EDT → 1 - D/d_M(d_M = lns/2) |
sironi |
soft_centerline_exp |
Sironi TPAMI 指数 soft:exp(a(1-D/d_M))-1(默认 a=6,峰值归一化到 [0,1]) |
pointtree |
pointtree_log / segnet_log |
PointTree Seg_Net 代码:局部距离 → -log soft(kernel_len=3) |
pointtree_gaussian |
segnet_gaussian |
PointTree 论文:Gaussian soft(sigma=3)再峰值归一化 |
inside_edt |
tubular |
实心管腔(用 SWC 半径)→ 前景内部 EDT(≈ 局部半径),背景为 0 |
后续新类型:在 npu/distance.py 的 DIST_TYPE_REGISTRY 注册即可。
命令
# 处理 SWC:orphan parent → -1,并从 1 连续编号
npu_swc_process -i ./CWMBS/swc
npu_swc_process -i ./CWMBS/swc -o ./CWMBS/process_swc
# SWC → mask(可用 -r 覆盖全部节点半径)
npu_swc_to_mask -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_mask
npu_swc_to_mask -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_mask -r 1
# SWC → dist(默认 soft_centerline,中间 mask 自动 r=1)
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t soft_centerline --lns 10
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t sironi --lns 10 --sironi-a 6
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t pointtree --kernel-len 3
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t pointtree_gaussian --sigma 3
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t inside_edt
npu_swc_to_dist -i ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist -t inside_edt --normalize --uint8
# Mask → dist
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist -t soft_centerline --lns 10
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist -t inside_edt --normalize
# nnUNet 概率图 .npz → tif
npu_nnunet_prob_to_tif -i ./preds -o ./preds_tif --uint8 -c 1
--uint8(旧旗标 --s 仍可用)将结果缩放到 [0,255] 存 uint8;默认 float32。
Metadata
Release files for neuron-process-utils 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuron_process_utils-0.1.0a1.tar.gz | 11.2 kB | Without provenance | Details for neuron_process_utils-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuron_process_utils-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for neuron_process_utils-0.1.0a1-py3-none-any.whl |
Total release size: 24.1 kB
Release files / neuron_process_utils-0.1.0a1.tar.gz
| Download URL | neuron_process_utils-0.1.0a1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06eeefe3f8ae11f052cea55c06f6ed7a88295873f546ed292e55cf642d347952
|
|
BLAKE2b-256 checksum How to use checksums |
19090d2f476d65b456f0c32fe17195a41c399cef09a717a91c79fc050b0deba9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / neuron_process_utils-0.1.0a1-py3-none-any.whl
| Download URL | neuron_process_utils-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e20bbabdad3890e3833f1b3987782adbb09a8a2758b23b0a988c518401c99912
|
|
BLAKE2b-256 checksum How to use checksums |
8cd748e5e6f9e5d7f472f9d5e243509e5fb72ac3b83c2e10cc987a68a0776c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for neuron-process-utils 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.