Replies: 1 comment
-
After |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I'd like to save the result of the following preprocessing of a batch of data.
Here's the preprocess and save transforms:
When I extract a batch of data as follows and then attempt to save, it fails:
Here's the error it throws:
Traceback (most recent call last):
File "C:\Dev\plar.py", line 362, in
main()
File "C:\Dev\plar.py", line 309, in main
save(b)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\transforms\io\dictionary.py", line 295, in call
self.saver(img=d[key], meta_data=meta_data)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\transforms\io\array.py", line 458, in call
raise RuntimeError(
RuntimeError: SaveImage cannot find a suitable writer for output\IXI249-Guys-1072-T1.nii_crop.nii.gz.
Please install the writer libraries, see also the installation instructions:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies.
The current registered writers for .nii.gz: (<class 'monai.data.image_writer.NibabelWriter'>, <class 'monai.data.image_writer.ITKWriter'>).
Traceback (most recent call last):
File "C:\Users\15142\anaconda3\lib\site-packages\monai\transforms\io\array.py", line 445, in call
writer_obj.set_metadata(meta_dict=meta_data, **self.meta_kwargs)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\data\image_writer.py", line 591, in set_metadata
self.data_obj, self.affine = self.resample_if_needed(
File "C:\Users\15142\anaconda3\lib\site-packages\monai\data\image_writer.py", line 270, in resample_if_needed
output_array = resampler(data_array[None], dst_affine=target_affine, spatial_size=output_spatial_shape)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\utils\deprecate_utils.py", line 221, in wrapper
return func(*args, **kwargs)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\transforms\spatial\array.py", line 251, in call
src_affine = to_affine_nd(spatial_rank, src_affine_).to(_dtype)
File "C:\Users\15142\anaconda3\lib\site-packages\monai\data\utils.py", line 929, in to_affine_nd
raise ValueError(f"affine must have 2 dimensions, got {affine_np.ndim}.")
ValueError: affine must have 2 dimensions, got 3.
Beta Was this translation helpful? Give feedback.
All reactions