mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[PR #1960] [MERGED] Feat/add new tool to dicom reader #2175
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-official-plugins/pull/1960
Author: @crazywoola
Created: 10/29/2025
Status: ✅ Merged
Merged: 10/29/2025
Merged by: @crazywoola
Base:
main← Head:feat/add-new-tool-to-dicom-reader📝 Commits (6)
62ef00eadd some tools4b1c51eadd: more toolsf272e68add: more tools163f8abadd: more tools2c203fcUpdate tools/dicom_reader/tools/dicom_spatial.py4eda9b5Update tools/dicom_reader/tools/_utils.py📊 Changes
31 files changed (+2365 additions, -36 deletions)
View changed files
📝
tools/dicom_reader/README.md(+72 -27)📝
tools/dicom_reader/manifest.yaml(+1 -1)📝
tools/dicom_reader/provider/dicom_reader.yaml(+11 -0)➕
tools/dicom_reader/readme/README_ja_JP.md(+31 -0)➕
tools/dicom_reader/readme/README_pt_BR.md(+31 -0)➕
tools/dicom_reader/readme/README_zh_Hans.md(+31 -0)➕
tools/dicom_reader/tools/__init__.py(+2 -0)➕
tools/dicom_reader/tools/_utils.py(+280 -0)➕
tools/dicom_reader/tools/dicom_hu_correction.py(+78 -0)➕
tools/dicom_reader/tools/dicom_hu_correction.yaml(+63 -0)➕
tools/dicom_reader/tools/dicom_metadata.py(+107 -0)➕
tools/dicom_reader/tools/dicom_metadata.yaml(+38 -0)➕
tools/dicom_reader/tools/dicom_model_input.py(+135 -0)➕
tools/dicom_reader/tools/dicom_model_input.yaml(+87 -0)➕
tools/dicom_reader/tools/dicom_multiframe.py(+81 -0)➕
tools/dicom_reader/tools/dicom_multiframe.yaml(+75 -0)➕
tools/dicom_reader/tools/dicom_pixel_ops.py(+132 -0)➕
tools/dicom_reader/tools/dicom_pixel_ops.yaml(+132 -0)➕
tools/dicom_reader/tools/dicom_pixels.py(+86 -0)➕
tools/dicom_reader/tools/dicom_pixels.yaml(+63 -0)...and 11 more files
📄 Description
Related Issues or Context
This pull request refactors the DICOM reader plugin to split the original monolithic tool into multiple focused tools, each handling a specific DICOM processing task. It introduces shared utility functions for code reuse, updates documentation to reflect the new structure, and adds new tool definitions and implementations for granular operations such as metadata extraction, pixel manipulation, and HU correction. The changes improve modularity, maintainability, and clarity for both developers and users.
Plugin refactor and multi-tool architecture:
dicom_metadata,dicom_pixels,dicom_hu_correction, etc.) handling a distinct DICOM processing function. The original combined tool is retained for backward compatibility. (README.md,provider/dicom_reader.yaml) [1] [2]Shared utilities and code reuse:
tools/dicom_reader/tools/_utils.pyto reduce duplication and standardize behavior across tools. (_utils.py)New tool implementations:
dicom_metadata(extracts key metadata),dicom_hu_correction(applies HU correction and generates previews), with corresponding YAML definitions for parameters, descriptions, and outputs. (dicom_metadata.py,dicom_hu_correction.py,dicom_hu_correction.yaml) [1] [2] [3]Documentation and manifest updates:
README.mdis rewritten to describe the new multi-tool structure, use cases, common parameters, and shared utilities. The plugin version is incremented inmanifest.yamlto 0.0.2 to reflect the changes. (README.md,manifest.yaml) [1] [2]Project structure and initialization:
__init__.pyto thetools/dicom_reader/toolspackage for proper module initialization. (__init__.py)This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.6.0is in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.