Skip to content

Commit e1c26c6

Browse files
Standardize DVC data for #380 and #381 changes
- Update standardization script, noting that writing of TransducerArray is not supported now. - Fix Solutions in DVC data -- they had transducer_id rather than Transducer attribute in them - Run standardization script on DVC data
1 parent af8d8f6 commit e1c26c6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

db_dvc.dvc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
outs:
2-
- md5: 67e3e857253eb8f72c6914dc91c4afe5.dir
2+
- md5: 223b1f68581e98c6eca9fd45b5fb099c.dir
33
nfiles: 437
44
hash: md5
55
path: db_dvc
6-
size: 1522837809
6+
size: 1523256583

scripts/standardize_database.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
"""
1616
from __future__ import annotations
1717

18+
import logging
1819
import pathlib
1920
import shutil
2021
import sys
2122
import tempfile
2223

2324
from openlifu.db import Database
2425
from openlifu.db.database import OnConflictOpts
26+
from openlifu.xdc import Transducer
2527

2628
if len(sys.argv) != 2:
2729
raise RuntimeError("Provide exactly one argument: the path to the database folder.")
@@ -35,7 +37,10 @@
3537

3638
db.write_transducer_ids(db.get_transducer_ids())
3739
for transducer_id in db.get_transducer_ids():
38-
transducer = db.load_transducer(transducer_id)
40+
transducer = db.load_transducer(transducer_id, convert_array=False)
41+
if not isinstance(transducer, Transducer):
42+
logging.warning(f"Skipping {transducer_id} because TransducerArray writing is not supported.")
43+
continue
3944
assert transducer_id == transducer.id
4045
db.write_transducer(transducer, on_conflict=OnConflictOpts.OVERWRITE)
4146

0 commit comments

Comments
 (0)