dattalab / moseq2-app

MoSeq2 Jupyter Notebook platform used to run all of the MoSeq2 tools in a GUI.
Other
32 stars 10 forks source link

Ghosted syllables #214

Open espy1412 opened 2 years ago

espy1412 commented 2 years ago

Expected Behavior

In most syllables, the entire figure of the mouse appears.

Current Behavior

In a few syllables (some restricted to particular animals/conditions), a dark spot appears over the centroid of the animal in the crowd movies. There are other syllables that are whole. I have no idea whether these are being analyzed properly, though I assume so. What is more concerning are the syllables that look like faint rims of color and do not move very much.

Possible Solution

Well, I already faced the possibility that this was an analysis artifact when I recorded at the wrong height. Now that I am recording at the height of 685 mm and this type of problem persists, however, I think there is something else going on.

Steps to Reproduce (for bugs)

  1. Run "MoSeq2-Extract-Modeling-Notebook"
  2. Run "MoSeq2-Analysis-Visualization-Notebook"
  3. Examine crowd movies

Screenshots

Examples of moderate and severe ghosting are below.

https://user-images.githubusercontent.com/72632579/152223533-43dff8f1-36fe-47fe-b74c-74248a173591.mp4

https://user-images.githubusercontent.com/72632579/152223535-58d61970-e964-4976-8023-232f5ce1a3ef.mp4

Context

Ideally, I want to be able to prevent these types of syllables from being extracted, since they do not appear to be representative of the actual movement pattern of the mouse. It is unclear how to do that, though.

Your Environment

https://user-images.githubusercontent.com/72632579/152223591-c460b32a-fcd8-4603-9c57-9153460ab8f6.mp4

https://user-images.githubusercontent.com/72632579/152223594-86e6b61e-efb5-453a-bf14-e606981bc51f.mp4

wingillis commented 2 years ago

Hi @espy1412. Typically, if a mouse doesn't move for a majority of the session, its body will contaminate the background image, as the background image is computed using a sample of frames across the session. Have you looked at the background images generated by MoSeq for these extractions? You will likely see the body of the mouse present in the background image. Also, I'd expect that these dark spots also show up in the extraction videos.

The simplest workaround is to use the plane background parameter when computing the background image for these sessions. It fits a plane to the floor and removes the mouse's influence on computing the background image

espy1412 commented 2 years ago

1) Where is the place to examine the background image? I am assuming you are talking about the bground.tiff file that shows up in the proc subdirectory for each analyzed session? If so, I took a look at a few of these and did not see anything that looked like an animal's body.

2) Are there any instructions for how exactly to "use the plane background parameter"? Is that a particular line in the notebooks or a modifiable variable?

Thanks!

jonahpearl commented 2 years ago

Did this get resolved? For the tiff files, to see such a slight variation in the background, you might have to load it in and mess with the colorscale. The way it gets saved, a difference of a few mm in the background would be hard to pick up.