How to upload .nii file from streamlit web st.file_uploader byte
I tried to deploy my ai to website by using streamlit. Then I want to upload the .nii file from st.file_uploader command to be the model input, so I want to upload and then open the .nii file. But the command give me as a byte from .getvalue(). I don’t know a way to convert byte to .nii(3d neuroimage file) so I first convert bytes to numpy array by np.frombuffer then convert it to .nii by nib.Nifti1Image but np.frombuffer give a single 1d(16777568) array that cannot reshape to 3d (256,256,256) because 1677568-(256256256) = 352 that is header of nifti file.