File Opening Issue with Python

File Opening Issue with Python  

  By: vertin on Aug. 3, 2024, 10:22 a.m.

  1. When I open this file in Python, there will be an error message saying 'ValueError: too many values to unpack (expected 3)'. How can I solve this problem? The code is as follows:

  2. When my code converts lesion msk to. png, the image is completely black. I don't know where the problem lies with my code:

  3. The converted image is different from the one opened with ITK-SNAP. It is not as smooth and has been flipped left and right. This should cause the segmentation mask output to also flip left and right. Will this affect my grades?

code for question1:

code for question2:

Re: File Opening Issue with Python  

  By: ezequieldlrosa on Aug. 5, 2024, 3:18 p.m.

Unfortunately, I am not familiar with nifti to png conversion. Perhaps you can try by skipping the 'np.fliplr(np.rot90(img))'? I would also take a look to the data types when exporting the .png. Good luck, Ezequiel.

Re: File Opening Issue with Python  

  By: vertin on Aug. 7, 2024, 9:02 a.m.

Hi, Ezequieldlrosa, have just found a successful way to read the image, and I have successfully read it. Thank you for your help!( ^-^)