spo_filter = itk.SpatialObjectToImageFilter[itk.SpatialObject[2], itk.Image[itk.UC, 2]].New()
spo_filter.SetReferenceImage(img_moving) # Oddly enough, this method is missing.
# Instead, we can set size and spacing.
spo_filter.SetSize(img_moving.GetLargestPossibleRegion().GetSize())
spo_filter.SetSpacing(img_moving.GetSpacing())
spo_filter.SetUseObjectValue(True)
spo_filter.SetInput(b_balls)
spo_filter.Update()
and…
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2024.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1570, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\JetBrains\PyCharm 2024.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:\Users\cza14\GitRepos\HyoidTrack\PhantomAs2.py", line 38, in <module>
spo_filter.SetReferenceImage(img_moving) # Oddly enough, this method is missing.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'itkSpatialObjectToImageFilterSO2IUC2' object has no attribute 'SetReferenceImage'. Did you mean: 'GetReferenceCount'?