SchmollerLab/Cell_ACDC

Error in function `gui_mouseReleaseEventImg1` v1.4.27

Closed this issue · 14 comments

Description:

Application keeps showing error after a few button click (uses). Then says to restart to use the application. This issue has persisted since v1.4.16.
.2024-04-18_15-26-34_acdc_gui_969f6c97-a4f6-49ba-b1a8-ca9ef0dd40e8_stdout.log

Way to reproduce:

No response

(Optional) Link to data to reproduce error:

No response

Terminal output:

Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\envs\acdc\lib\site-packages\cellacdc\__init__.py", line 386, in inner_function
    result = func(self, *args)
  File "C:\ProgramData\anaconda3\envs\acdc\lib\site-packages\cellacdc\gui.py", line 6584, in gui_mouseReleaseEventImg1
    self.trackManuallyAddedObject(posData.brushID, self.isNewID)
  File "C:\ProgramData\anaconda3\envs\acdc\lib\site-packages\cellacdc\gui.py", line 21825, in trackManuallyAddedObject
    trackedID = tracked_lab[mask][0]
IndexError: index 0 is out of bounds for axis 0 with size 0

Version information:

v1.4.27

Hi @Akankshazmaze,

Unfortunately I cannot replicate the error, so I will need more information. Can you tell me the steps you do to trigger the error? Do you start with and empty segmentation file on timelapse data? Does this happen when you add a new object with the brush?

If you can, it would be very helpful to record the steps you do to trigger the error. To do so you can use the software LICEcap that you can download from here https://licecap.en.softonic.com/.

Once installed you can run LICEcap and you will get a window that you can place around Cell-ACDC gui window. Press the Record button and use acdc to trigger the error. Then send here the GIF file generated. Thanks!

Another option is to zip the position folder and send it to me (you can put it on your cloud of choice and share it to my email padovaf@tcd.ie) with instructions on how to replicate the error.

Thank you for your patience!

So I went to the Position_n/Images folder. Issue is, there is one .npy file for the entire time-lapse data. While I have separate .npy file for each frames.
Is there a way I can combine them all?

Unfortunately there is no feature in Cell-ACDC to combine them, but it's pretty simple to do with a Python script. I can send you one but I need some information. Do you have the files all in a folder without any other file in it? How are the single frame files named? If you send me a screenshot of the File Explorer on the folder where you have the single frame files I can help you writing a very small Python script to combine them.

Also in Cell_ACDC, is there a way to manually segment each frame and have the data automatically saved?

Cell-ACDC saves only when you click the Save button. There actually is an autosave function, you can activate it with the Toggle in the bottom-left of the GUI (see screenshot below). However, this function is more for recovery of unsaved data so I recommend that you save yourself by simply pressing Ctrl+S. This will only save the segmentation file.

In case you need to recover from the autosaved data, Cell-ACDC will ask you to recover from there when you load the same Position again. Let me know if it's clear enough, thanks!

image

So what I do is:
Segment the file using one of the segmentation modules.
And some some bacteria do not get segmented correctly. Here, I will remove and make correct boundaries using the Brush and Eraser tool in the ACDC_GUI.
After a few actions, the program will show me the error: ACDC.
Autosave segmentation, is working! just worked with this.
The error also shows when I try to use the function: Select object to keep. The error will pop us when I try to save the hgihlighted objects.
Error is as follows:

File "C:\ProgramData\anaconda3\envs\acdc\lib\site-packages\cellacdc\gui.py", line 18303, in applyKeepObjects
    self.highlightHoverIDsKeptObj(0, 0, hoverID=0)
  File "C:\ProgramData\anaconda3\envs\acdc\lib\site-packages\cellacdc\gui.py", line 20746, in highlightHoverIDsKeptObj
    objIdx = posData.IDs_idxs[hoverID]
KeyError: 0

Unfortunately there is no feature in Cell-ACDC to combine them, but it's pretty simple to do with a Python script. I can send you one but I need some information. Do you have the files all in a folder without any other file in it? How are the single frame files named? If you send me a screenshot of the File Explorer on the folder where you have the single frame files I can help you writing a very small Python script to combine them.

This will be very helpful!
I have segm_npy and the respective image in the same folder. Respective png file of the segm files also present, but they can be deleted.
SS attached
image
Thank you

Ok, I think I fixed the two errors you reported. I did not release a new version because I would like you to test the fixes first.

To upgrade to the latest version activate the acdc environment and run the following command

pip install --upgrade "git+https://github.com/SchmollerLab/Cell_ACDC.git"

If it complains that the command git cannot be found, please close the terminal, install Git (link below) and try the upgrade again. Let me know if the issues are fixed. Once you are happy with it I can release a new version, thanks!

Git link: https://git-scm.com/download/win

Best,
Francesco

Unfortunately there is no feature in Cell-ACDC to combine them, but it's pretty simple to do with a Python script. I can send you one but I need some information. Do you have the files all in a folder without any other file in it? How are the single frame files named? If you send me a screenshot of the File Explorer on the folder where you have the single frame files I can help you writing a very small Python script to combine them.

This will be very helpful! I have segm_npy and the respective image in the same folder. Respective png file of the segm files also present, but they can be deleted. SS attached image Thank you

Are the p00, p01, etc the individual time points?

Btw, are those seg.npy files generated from the cellpose GUI? Because if that's the case, one easier option is to run cellpose from Cell-ACDC. You can also run your custom cellpose model in Cell-ACDC. This way the correct segmentation file is generated by Cell-ACDC.

Btw, are those seg.npy files generated from the cellpose GUI? Because if that's the case, one easier option is to run cellpose from Cell-ACDC. You can also run your custom cellpose model in Cell-ACDC. This way the correct segmentation file is generated by Cell-ACDC.

Yes, I segmented them using custom model trained in Cellpose. I had to segment them on Cellpose, as ACDC was crashing😅. Now I don't have this crashing issue while segmenting. I'll continue here.

Are the p00, p01, etc the individual time points?

Yes :)

But I guess, I may not need this as you fixed the crashing issue!

I have another request:
How do I annotate a cell manually with a specific ID given in the previous frame?

To upgrade to the latest version activate the acdc environment and run the following command

pip install --upgrade "git+https://github.com/SchmollerLab/Cell_ACDC.git"

I was able to install this easily, thanks to your instructions.

However, the manual correction I am making in each frames are not getting saved automatically. When I go back to the last frame, where I made correction, the segments were not the one I made. For eg:
image
The region highlighted in black has a cell that has been fragmented in 3 parts, I make the correction, move onto to other frames, and when I come back to this frame, the cell is fragmented again.

Another issue with keep objects:
Error in function:applyKeepObjects.
.2024-04-18_21-27-10_acdc_gui_e45a477c-3515-4e35-af8a-15c96b501e52_stdout.log

After the new update, if 2 cells overlap, the one of the cell is split in 2 cells.

I have another request:
How do I annotate a cell manually with a specific ID given in the previous frame?

To change the ID manually there is a button on the top toolbar with this icon Edit ID icon. Activate that button and then right-click on a cell. You will get an entry box where to type the new ID. Let me know if it works, thanks.

The region highlighted in black has a cell that has been fragmented in 3 parts, I make the correction, move onto to other frames,

Can you please send me two screenshots of the entire GUI (I also need to see the scrollbars below the image) one after correcting and one after going back to the frame where the correction is not there anymore? Thanks!

After the new update, if 2 cells overlap, the one of the cell is split in 2 cells.

I will also need a screenshot here to understand better.

If you can, it would be much easier if you share the Position folder with me (you can use my email padovaf@tcd.ie). This way I can test the issues as well. Thank you very much!

Best,
Francesco

Segmentation issue occuring when using omnipose. I have attached the critical error displayed and the log. The version used: 1.4.30.dev5+g7d6335c,
image

.2024-04-29_15-31-48_main_21eee7e8-1e0b-498e-8e99-455e1bbaf8c0_stdout.log

If you can, it would be much easier if you share the Position folder with me (you can use my email padovaf@tcd.ie). This way I can test the issues as well. Thank you very much!

I do not understand what is it that I am doing so wrong. I have shared with you on Google drive the Positions_n folder. Please have a look. Thankyou. Choice of segmentation module: either Omnipose or cellpose 3.0
https://drive.google.com/drive/folders/1_CuJlotiQBh9K1FGQNC7QpSEjdPRSl0Z?usp=drive_link

Thankyou
Akanksha

Hi @Akankshazmaze,

I sent you an invitation to join our Slack workspace for acdc users. It might be much easier to communicate there, thanks!

Best,
Francesco

Hi @Akankshazmaze, I will close this since it seems that re-installing Cell-ACDC solved it, right? Feel free to re-open it (or open a new issue) should you have more comments to add. Talk to you on Slack!