You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, we would like to use to_multiscale to generate downscaled pyramids of label arrays. Unfortunately, it looks like the ITK_LABEL_GAUSSIAN method only works for certain data types. Please see the snippet below:
importdask.arrayasdaimportnumpyasnpfrommultiscale_spatial_imageimportto_multiscale, Methodsfromspatial_imageimportto_spatial_image, SpatialImagedeftry_multiscale_label():
""" types: - int8 failed -> itk.support.extras.TemplateTypeError: itk.Image is not wrapped for input type `itk.SC, int`. - int16 worked, but max val not big enough - int32 failed -> itk.support.extras.TemplateTypeError: itk.BinShrinkImageFilter is not wrapped for input type `None`. - int64 failed -> itk.support.extras.TemplateTypeError: itk.Image is not wrapped for input type `itk.SL, int`. - uint8 worked, but max val not big enough - uint16 worked, but max val not big enough - uint32 failed -> itk.support.extras.TemplateTypeError: itk.BinShrinkImageFilter is not wrapped for input type `None`. - uint64 failed -> itk.support.extras.TemplateTypeError: itk.BinShrinkImageFilter is not wrapped for input type `None`. """labels_arr: da.Array=da.zeros(shape=(100, 100), dtype=np.uint64)
labels_arr[:50, :50] =1labels: SpatialImage=to_spatial_image(labels_arr, dims=("y", "x"))
to_multiscale(
labels,
scale_factors=[dict(y=2, x=2)],
method=Methods.ITK_LABEL_GAUSSIAN,
)
if__name__=="__main__":
try_multiscale_label()
For int8, int32, int64, uint32, and uint64, there is an error thrown, and it seems like this will take me into the weeds a bit. If you have any suggestions on how to approach fixing this I am all ears.
Hello, we would like to use
to_multiscale
to generate downscaled pyramids of label arrays. Unfortunately, it looks like theITK_LABEL_GAUSSIAN
method only works for certain data types. Please see the snippet below:For int8, int32, int64, uint32, and uint64, there is an error thrown, and it seems like this will take me into the weeds a bit. If you have any suggestions on how to approach fixing this I am all ears.
Edit: the dependencies for the above snippet are:
Thank you,
Seb
The text was updated successfully, but these errors were encountered: