suite2p icon indicating copy to clipboard operation
suite2p copied to clipboard

Can rotations be enabled for manual segmentation?

Open diegoasua opened this issue 4 years ago • 6 comments

In the manual labelling mode (which is great for polishing up!) one can create circles and ovals. Although for "prototypical" cortical cells this works well, sometimes said neurons can have morphologies that are oval shaped, but not necessarily oriented in the ordinate axis. If the roi shape could be rotated one could easily fit these non-conventional morphologies.

It would be a matter of adding handles here.

self.ROI.addRotateHandle(pos: List, center: List)

This shouldn't otherwise affect the behaviour of the software.

Thanks ahead :brain:!

diegoasua avatar Dec 01 '20 18:12 diegoasua

unfortunately it's not that easy, you also need to use the rotation to create the ROI, I tried the built in getArrayRegion function and it doesn't take angle into account, so you have to compute it by hand somehow. if you implement it please submit a pull request and I'll be happy to accept it.

carsen-stringer avatar Feb 19 '21 02:02 carsen-stringer

if you press the Alt key when you click the ROI (outline yellow) you can rotate the ellipse with the mouse. Is this what you were looking for?

camille-lab avatar Feb 19 '21 09:02 camille-lab

@camille-lab I'm finding that this does indeed rotate the ellipse in the manual segmentation window, but when looking at the ROI that ultimately gets saved it is not rotated correctly... is anyone seeing this issue as well? Images below

Screen Shot 2021-03-06 at 12 34 23 PM Screen Shot 2021-03-06 at 12 33 10 PM

penguingiraffe2 avatar Mar 06 '21 17:03 penguingiraffe2

I had trouble getting that angle info out of pyqtgraph. very happy to accept a pull request on this though if someone wants to dig into the code, but do not plan on adding this myself since it doesn't seem straightforward sorry :(

carsen-stringer avatar Jul 23 '21 14:07 carsen-stringer

I'm trying to develop this feature for my lab but want to check if the ROI is a QWidget as it seems unfeasible if it is (https://stackoverflow.com/questions/58020983/rotate-the-widget-for-some-degree.

If not, I'll try to build an angle system for it

amorsi1 avatar Feb 09 '22 20:02 amorsi1

Could you please let me know if this just an issue with how the rotated ROIs are displayed after the fluorescence traces are extracted? Or can the fluorescence traces actually not be extracted correctly for rotated ROIs?

cgaletzka avatar Apr 05 '22 07:04 cgaletzka

duplicate of #807

carsen-stringer avatar May 14 '23 02:05 carsen-stringer