Skip to content

Troubleshooting: analysis

Jeffrey Markowitz edited this page Dec 5, 2018 · 19 revisions

Q: My crowd movies are empty and the movies are 0 bytes in size but I don't see any errors, why?
A: You likely are using the wrong version of ffmpeg, or don't have the proper movie encoders. Make sure you download ffmpeg like so: conda install -c conda-forge ffmpeg.



Q: Why do I get an OpenMP error when trying to install MoSeq2-model on a Mac?
A: This is an issue with the Mac supplied version of gcc. Install the latest gcc using homebrew then set your gcc and gxx to use the homebrew version. . Note that this command is relevant for gcc-7, this may change at any point to, e.g. gcc-8.

brew install gcc
export CC=/usr/local/bin/gcc-7
export CXX=/usr/local/bin/g++-7
cd ~/python_repos/moseq2-model/
pip install -e . --process-dependency-links



Q: Why do I see a bunch of Numpy warnings about binary incompatibility?
A: This a known issue with the latest version of Numpy. As far as we know this warning is benign. The simplest way to supress this message is to downgrade Numpy to 1.14.5. See this issue.

pip install numpy==1.14.5



Q: How do I load the raw data in Python or MATLAB?
A: The depth frames are saved as binary data in 16-bit little Endian format. See this function to load in raw data in Python. In MATLAB use the following code:

width=512;
height=424;
start_point=1; % start frame
frames_to_read=100; % frames to read

fid=fopen(PATH_TO_DATA, 'rb');

bytes_per_frame = height * width * 2; %2 bytes per int16
offset = bytes_per_frame * (start_point - 1);
fseek(fid, offset, 'bof'); % seek to the correct point

% note that width and height are permuted here
raw_frames = reshape(fread(fid, (width * height) * frames_to_read, '*int16'), [width height frames_to_read]);



Q: The ROI detection isn't working, how do I fix this?
A: First, make sure that the floor of the arena is between the bounds set by --bg-roi-depth-range in moseq2-extract find-roi or moseq2-extract extract. If that doesn't work you will likely need to tweak --bg-roi-weights, which set weights for the area, extent, and distance from center for the ROI, e.g. if you only want the largest ROI by area, set to --bg-roi-weights 1 0 0, which excludes extent and distance altogether. The ROI detector finds all planes within the specified depth range and ranks them according to their area (higher weight favors larger area), extent (using the OpenCV contour definition, higher weight favors larger extent), and distance from center (higher weight favors closeness to the center). Note that only the relative magnitudes are used, the absolute mangitudes of the weights do not matter. If you find it hard to exclude walls, also turn on the gradient filter with --bg-roi-gradient-filter True.