NICALab / SUPPORT

Accurate denoising of voltage imaging data through statistically unbiased prediction, Nature Methods.
https://www.nature.com/articles/s41592-023-02005-8
GNU General Public License v3.0
69 stars 14 forks source link

Using GUI to denosie my movie but the output is only one image? #4

Closed ZyHUpenn closed 1 year ago

ZyHUpenn commented 1 year ago

I tried to use python's cv2.imread(denoised.tif,-1) to read the output tiff file, it seems the result is only one image instead of a whole 3-D movie. I checked the testGUI.py is using tifffile.imwrite(append = 'True'), so I don't know what's wrong with it?

SteveJayH commented 1 year ago

In our side, we're not sure if that issue exist... With test_GUI, I checked that denoised.tif contains multiple frames, not only one frame. Did you tried with demo data at src/sample_data.tif ??

I just tried as followings.

  1. python -m src.GUI.test_GUI to open GUI.
  2. Browse src/sample_data.tif. Then, start index will be 1 and end index will be displayed as 300. Also, save path will be automatically selected as data/SUPPORT/current_timestamp/.
  3. Press Run button. And if you go to the save path, you may see the size of denoised.tif will keep increasing as the inference goes on. I'm not sure of cv2.imread, but if I open the denoised.tif with ImageJ/fiji, the data contains 300 frames.

If you did not tried with demo data, please check if our code with this data works well. Let me know if it works or not.

Also, if the code with demo data works well, but not for your custom data, let me know. We can find if the code is going wrong with your data.

ZyHUpenn commented 1 year ago

Right, when I open the denoised.tif in imageJ it shows all the frames. The code should be all good, thank you very much! Maybe I need to find another way to load it on python, the denoised.tif 's 32-bit format may cause cv2's problem I guess anyway.

SteveJayH commented 1 year ago

Ah okay, I also do not use cv2 when dealing with these microscopy images (I feel like they are well suited to 8bit "natural" images). I think tifffile package or skimage.io package will be nice to load 16 or 32-bit images. (Internally, skimage.io will use tifffile to read and write with tif images)

starquakes commented 1 year ago

Right, when I open the denoised.tif in imageJ it shows all the frames. The code should be all good, thank you very much! Maybe I need to find another way to load it on python, the denoised.tif 's 32-bit format may cause cv2's problem I guess anyway.

Hi! May I ask if you resolved the problem already? I tried skimage.io but it still only gives one frame image. I checked the metadata in ImageJ, the problem seems to be a wrong dimension (the T dimension was written as the Z dimension).

ZyHUpenn commented 1 year ago

Yes, the skimage cannot deal with this problem. I used matlab to open the file then it works. Hopefully it will help you.

On Mon, Jan 2, 2023 at 05:01 Xiaohan Xue @.***> wrote:

Right, when I open the denoised.tif in imageJ it shows all the frames. The code should be all good, thank you very much! Maybe I need to find another way to load it on python, the denoised.tif 's 32-bit format may cause cv2's problem I guess anyway.

Hi! May I ask if you resolved the problem already? I tried skimage.io but it still only gives one frame image. I checked the metadata in ImageJ, the problem seems to be a wrong dimension (the T dimension was written as the Z dimension).

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/NICALab/SUPPORT/issues/4*issuecomment-1368793307__;Iw!!IBzWLUs!XffsRdAoZTL_A_2_5GaMUd7honfYlp31vTiWi5o4HFO4ak8XzuWTfvSeB3aHy3tpgtw9L-DLiToNFEr0WIJ8i_F92pI$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A3J5DZZGFE22DM2COXHDVMLWQKRO5ANCNFSM6AAAAAAS3TU62Q__;!!IBzWLUs!XffsRdAoZTL_A_2_5GaMUd7honfYlp31vTiWi5o4HFO4ak8XzuWTfvSeB3aHy3tpgtw9L-DLiToNFEr0WIJ8y2GnqBo$ . You are receiving this because you authored the thread.Message ID: @.***>