Metadata-Version: 2.4
Name: neuron-process-utils
Version: 1.0.0
Summary: neuron process utils
Author-email: jiang yan <1900812927@qq.com>
License: MIT License
        
        Copyright (c) 2025 还能热爱多久
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://gitee.com/Eason596/nnunetv2_extend
Project-URL: repository, https://gitee.com/Eason596/nnunetv2_extend
Keywords: neuron process
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: swcgeom>=0.20.0
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Dynamic: license-file

# 神经元数据处理工具
注：需要图像和swc文件同名，例如(1.tif, 1.swc)
```shell
# 处理swc，将parent指向节点不存在于swc文件中的值置为-1，对swc进行reindex
# 保存到原目录
npu_swc_process -i ./CWMBS/swc
# 保存到新目录
npu_swc_process -i ./CWMBS/swc -o ./CWMBS/process_swc

# swc转mask，根据xyz和r，将xyz点r范围内的像素设为255
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(需要swc转为mask时的r为1)，以0-1 float32存储
npu_swc_to_dist -m ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist
# 设置邻域范围
npu_swc_to_dist -m ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist --lns 10
# 以0-255 uint8存储
npu_swc_to_dist -m ./CWMBS/img -s ./CWMBS/process_swc -o ./CWMBS/process_dist --s

# mask转dist(需要swc转为mask时的r为1)，以0-1 float32存储
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist
# 设置邻域范围
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist --lns 10
# 以0-255 uint8存储
npu_mask_to_dist -m ./CWMBS/process_mask -o ./CWMBS/process_dist --s
```
