标签图阈值工具
主要变更
- 嵌套的
strategySpecificConfiguration对象被完全移除 - 各配置属性上移到配置对象的根层级
- 阈值配置的结构被重新组织:
threshold数组现在变成了threshold对象内部的range属性- 其他阈值相关属性(
isDynamic、dynamicRadius)也属于同一个对象
setBrushThresholdForToolGroup()的函数签名改为接受一个结构化的阈值对象- 策略专有的属性(例如
useCenterSegmentIndex)被移到了配置的根层级 activeStrategy现在是工具操作数据中的一个独立属性,不再位于某个嵌套配置内部
迁移步骤
1. 用直接属性替换 strategySpecificConfiguration
迁移前:
- configuration: {
- activeStrategy: 'THRESHOLD_INSIDE_SPHERE_WITH_ISLAND_REMOVAL',
- strategySpecificConfiguration: {
- THRESHOLD: {
- threshold: [-150, -70],
- // 其他阈值属性
- },
- useCenterSegmentIndex: true,
- },
- }
迁移后:
+ configuration: {
+ activeStrategy: 'THRESHOLD_INSIDE_SPHERE_WITH_ISLAND_REMOVAL',
+ threshold: {
+ range: [-150, -70],
+ isDynamic: false,
+ // 其他阈值属性直接写在这里
+ },
+ useCenterSegmentIndex: true,
+ }
2. 更新阈值配置的结构
迁移前:
- strategySpecificConfiguration: {
- THRESHOLD: {
- threshold: [-150, -70], // 旧的 threshold 数组形式
- isDynamic: false,
- dynamicRadius: 5
- }
- }
迁移后:
+ threshold: {
+ range: [-150, -70], // 新的 'range' 属性取代了 'threshold'
+ isDynamic: false,
+ dynamicRadius: 5
+ }
3. 更新 setBrushThresholdForToolGroup 的调用
迁移前:
- segmentationUtils.setBrushThresholdForToolGroup(
- toolGroupId,
- thresholdArgs.threshold,
- thresholdArgs
- );
迁移后:
+ segmentationUtils.setBrushThresholdForToolGroup(
+ toolGroupId,
+ fullThresholdArgs
+ );
注意 thresholdArgs 现在应当是一个具有如下结构的对象:
{
range: [min, max], // 原先叫 'threshold'
isDynamic: boolean,
dynamicRadius: number
}