Skip to content

Commit 1b74b86

Browse files
committed
Separate approval flags in transducer tracking result (OpenwaterHealth#182)
1 parent 723b7a5 commit 1b74b86

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/openlifu/db/session.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from dataclasses import asdict, dataclass, field
66
from datetime import datetime
77
from pathlib import Path
8-
from typing import Dict, List, Tuple, Optional
8+
from typing import Dict, List, Tuple
99

1010
import numpy as np
1111

@@ -44,9 +44,13 @@ class TransducerTrackingResult:
4444
photoscan_to_volume_transform: ArrayTransform
4545
"""Transform output by the transducer tracking algorithm to register the photoscan model the volume's skin segmentation"""
4646

47-
transducer_tracking_approved: Optional[bool] = False
48-
"""Approval state of transducer tracking result. `True` means the user has provided some kind of
49-
confirmation that the transducer transforms in this result agrees with reality."""
47+
transducer_to_photoscan_tracking_approved: bool = False
48+
"""Approval state of transducer to photoscan tracking result. `True` means the user has provided some kind of
49+
confirmation that the transform result agrees with reality."""
50+
51+
photoscan_to_volume_tracking_approved: bool = False
52+
"""Approval state of photoscan to volume tracking result. `True` means the user has provided some kind of
53+
confirmation that the transform result agrees with reality."""
5054

5155
@dataclass
5256
class Session:
@@ -155,7 +159,8 @@ def from_dict(d:Dict):
155159
t['photoscan_id'],
156160
ArrayTransform(np.array(t['transducer_to_photoscan_transform']['matrix']),t['transducer_to_photoscan_transform']['units']),
157161
ArrayTransform(np.array(t['photoscan_to_volume_transform']['matrix']), t['photoscan_to_volume_transform']['units']),
158-
t['transducer_tracking_approved']
162+
t['transducer_to_photoscan_tracking_approved'],
163+
t['photoscan_to_volume_tracking_approved']
159164
)
160165
for t in d['transducer_tracking_results']
161166
]

tests/resources/example_db/subjects/example_subject/sessions/example_session/example_session.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
],
6565
"units": "mm"
6666
},
67-
"transducer_tracking_approved": false
67+
"transducer_to_photoscan_tracking_approved": false,
68+
"photoscan_to_volume_tracking_approved": false
6869
}
6970
]
7071
}

0 commit comments

Comments
 (0)