Search code examples
output-formattingniftynet

How to change output format for Niftynet?


Is it possible to set output format in configuration file for Niftynet? e.g. I would like to have my output as png.

My output is currently in .nii.gz format.

Thank you.


Solution

  • You can read the output array in Python with NiBabel:

    import nibabel
    data_array = nibabel.load('output_file.nii.gz').get_data()
    # shape of data_array is [width, height, depth, time, num_channels]
    

    and save the array as any other image formats.