Skip to content

in write_nifti an additional dimension is added to the output image #1677

@michalhg

Description

@michalhg

In the write_nifti function that exports the 3D segmentation prediction to a nifty image file, and addition dimension is added (either for channel or batch) which makes it unreadable using ITK-SNAP or Slicer.
I propose the following solution

results_img = nib.Nifti1Image(data.squeeze().astype(output_dtype), to_affine_nd(3, target_affine)) # squeeze channel dim

for row 105 in row nifty_writer.py file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions