@@ -107,6 +107,63 @@ def test_bin_shrink_tczyx():
107107 assert multiscales .images [1 ].data .shape [2 ] == 16
108108
109109
110+ def test_bin_shrink_tzyxc ():
111+ import dask .array as da
112+
113+ test_array = da .ones (
114+ (96 , 256 , 256 , 256 , 2 ), chunks = (1 , 128 , 128 , 128 , 1 ), dtype = "uint16"
115+ )
116+ img = to_ngff_image (
117+ test_array ,
118+ dims = list ("tzyxc" ),
119+ scale = {
120+ "t" : 100_000.0 ,
121+ "z" : 0.98 ,
122+ "y" : 0.98 ,
123+ "x" : 0.98 ,
124+ "c" : 1.0 ,
125+ },
126+ axes_units = {
127+ "t" : "millisecond" ,
128+ "z" : "micrometer" ,
129+ "y" : "micrometer" ,
130+ "x" : "micrometer" ,
131+ },
132+ name = "000x_000y_000z" ,
133+ )
134+ # test_array = da.ones(
135+ # (64, 64, 64, 2), chunks=(64, 64, 64, 1), dtype="uint16"
136+ # )
137+ # img = to_ngff_image(
138+ # test_array,
139+ # dims=list("zyxc"),
140+ # scale={
141+ # "z": 0.98,
142+ # "y": 0.98,
143+ # "x": 0.98,
144+ # "c": 1.0,
145+ # },
146+ # axes_units={
147+ # "z": "micrometer",
148+ # "y": "micrometer",
149+ # "x": "micrometer",
150+ # },
151+ # name="000x_000y_000z",
152+ # )
153+ # from ngff_zarr import ngff_image_to_itk_image
154+ # itk_img = ngff_image_to_itk_image(img)
155+ # from itkwasm_image_io import write_image
156+ # write_image(itk_img, "test_bin_shrink_zyxc.iwi")
157+ # write_image(itk_img, "test_bin_shrink_zyxc.iwi.cbor")
158+
159+ multiscales = to_multiscales (
160+ img ,
161+ scale_factors = [{"z" : 2 , "y" : 2 , "x" : 2 }, {"z" : 4 , "y" : 4 , "x" : 4 }],
162+ method = Methods .ITKWASM_BIN_SHRINK ,
163+ )
164+ assert len (multiscales .images ) == 3
165+
166+
110167def test_bin_shrink_isotropic_scale_factors (input_images ):
111168 dataset_name = "cthead1"
112169 image = input_images [dataset_name ]
0 commit comments