-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROIs segmented using ImageJ cannot be converted #288
Comments
Hello! I've run into the exact same issue. Do you @just-meng mind explaining to me how to convert the RoiSet.zip to a boolean mask list that's compatible with FISSA? This is what I tried ~
I get |
I think all you have to do is to put
Btw I believe the way you create the mask only returns the boundary of the ROI but not the entire area. Maybe try this:
You can always visually check the result, e.g. by Hope this helps! :) |
Thank you for the kind explanation @just-meng ! You're right, after sending the code I realized that the only thing I masked was the boundary. I have implemented your solution to fill the entire boundary accordingly. I have indeed tried inputting the var |
That's strange. Can you post the error you get with |
Sure! Here's my full script:
Below is the full output:
If I simply call masks instead of [masks], I get the error stated previously:
Thus, I tried changing my function in the following way: This I think made things better since the error moved a few lines further down lol. It seems like FISSA has an issue with my np boolean masks, so I converted the np arrays to lists. Now it's only worried about the tuples. Again, inputing masks as a list [masks] yields the same TypeError of 'unfamiliar shape'
|
I used your code and got no error! Literally only changed the The output is too long, but here is the finishing statement:
|
I am thoroughly defeated then haha. Just to double check -- you ran the code above with [tiff_path] [masks] both listed? I guess I'll just try to reinstall FISSA...perhaps I irreparably messed with some of the internal files while trying to troubleshoot. Wish I could finish separating signals from N rois across 1 trials right now. Thanks again for your help! *Eh, reinstalling didnt work |
Yes with [tiff_path] [masks] both listed just as in your code. If you have a tiff size of 512 x 512 like me, you can try my roiset with your code. If it works, then perhaps the problem is how your export the ROIs from ImageJ. |
I resized my tif file to 512x512 (it was smaller) and used your RoiSet -- it worked. I have further news to report. First I thought it worked perhaps because you used polygon ROIs. But I believe you have a number of freehand ones. Then I thought, hey they kept the generic "RoiSet.zip" filename. Well guess what happened after I changed my roi zip filename from GC_AD_ROI.zip to RoiSet.zip? It worked : D Immense thanks once again for taking the time to get me up and running with this package. Cheers! |
Also strange, but I'm glad that your code is now working also for you! Could you maybe try reading the GC_AD_ROI.zip using a different function?
|
I tried your version of the roi import and it worked on the roi file named GC_AD_ROI.zip. However, I then re-tried my own version of the roi import on this same zip file and it worked. What changed? Well here's the order of events: I had the original zip file GC_AD_ROI.zip that I ran my code on got errors which you helped me resolve. After renaming this file to RoiSet I get no errors. Then I open RoiSet in Fiji and save another copy of it as GC_AD_ROI.zip This copy works with both roi import functions ~ roiread & ImagejRoi.fromfile(). I was running all of this on a jupyter notebook. I got everything to work...restarted the kernel...things still work. All I can think of is there was something corrupted with the original file and somehow it got fixed just by renaming it? It's 5:30am and this feels like a bad fever dream so I'm calling it a day. But thanks once again! |
Perhaps you are right with the file being corrupted. Good night! |
Hi @just-meng and @EmrickLab, |
I have the same default behavior. The solution suggested in this thread works, but the original issue should be investigated. |
Hi @nathalierochefort, as @kirolle points out, loading ROIs segmented using ImageJ requires the workaround. I agree that it would be nice to troubleshoot the original issue or incorporate the workaround into the code of FISSA. |
Thank you all for the feedback and the suggestion. We will definitely investigate the original issue. Sorry for the delay of the answers: one owner is on paternity leave and members of my lab have used our established pipeline that works well so did not encounter the problem. We will try to solve the issue in January |
Hi @just-meng @EmrickLab, and @kirolle, thank you for the patience and your suggestions. We have identified the cause of this issue and it has something to do with the versions of Meanwhile, for those who encounter similar issue, the simplest fix is to downgrade your |
My ROIs are manual segmented using ImageJ and exported as a RoiSet.zip file. I used this script to run FISSA, and run into the following error. The ROIs seem to cause problems and cannot be converted to masks.
However, when I load the RoiSet.zip and manually convert it into a list of Boolean masks, it works. It is the very same set of ROIs, though.
Is this a bug about specifically dealing with ImageJ .zip files? Can someone fix it?
The text was updated successfully, but these errors were encountered: