Nrrdwrite.m of 2d image

Hi, I’m trying to use nrrdwrite.m to create nrrds, but it doesn’t work on 2D images. Does anyone know if/how in Octave I can convert these to 3D images with one voxel in the 3rd dimension?

Alternatively, I can submit a patch to nrrdwrite, if such an interpretation is desirable.

I think they will need to be one slice 3d nrrd files.

I’ve updated this nrrdwrite function to be able to save 2D image (as single-slice 3D volume):

1 Like

Works great. Thanks!

I suggest a tiny little change: line 76 would benefit from a semi-colon!

1 Like

Thank you, I’ve fixed it.