`read_dicom_auto` can return any one of `(Scan | PET | StructureSet | Dose | Segmentation | None)`
for baseImage
I'm assuming it should must return a Scan
type?
reason:
the baseImage.image
will only work if baseImage
is of type Scan
, and we can provide better logging/error handling
segMasks = makeMask(
segImage,
baseImage.image,
existing_roi_indices={"background": 0},
ignore_missing_regex=False,
)
if so, should verify this type before proceeding with something like:
from imgtools.modules import scan
...
baseImage = read_dicom_auto(baseImageDirPath)
assert isinstance(baseImage, scan.Scan), f"baseImage is not a Scan object. has type {type(baseImage)}"
or something
Originally posted by @jjjermiah in #31 (comment)