bahanonu / ciatah

CIAtah (pronounced cheetah): a software package for calcium imaging analysis of one- and two-photon imaging datasets. Documentation: https://git.io/ciatah_docs. Formerly known as calciumImagingAnalysis (ciapkg).
https://git.io/ciatah_docs
MIT License
80 stars 20 forks source link

Error loading frame for modelPreprocessMovie #122

Open dprotter opened 1 year ago

dprotter commented 1 year ago

Hi there, I've been trying to get ciatah working on my ubuntu 20.04 machine. After some tinkering I've got videos loaded and can even take a folder with a bunch of UCLA miniscope avi files through the viewMovieRegistrationTest step.

However, when I try and run that same folder with the same regex strings through modelPreprocessMovie I get a blank image for selecting the ROI for motion correction. If I drag and double click anyway, i get an indexing error (see below).

I'm not 100% sure of the workflow here, if it would be better for me to try and downsample and convert to h5 first (running modelDownsampleRawMovies throws no errors but produces no output). Any help would be greatly appreciated!

@@@@@@@ Index in position 1 is invalid. Array indices must be positive integers or logical values.

Error in ciatah/modelPreprocessMovieFunction>localfxn_turboregCropSelection (line 2563) thisFrameCropped = thisFrame(pts(2):pts(4), pts(1):pts(3));

Error in ciatah/modelPreprocessMovieFunction (line 637) [turboRegCoords] = localfxn_turboregCropSelection(options,folderList);

Error in ciatah/modelPreprocessMovie (line 42) obj.modelPreprocessMovieFunction('folderListPath',folderListInfo,'fileFilterRegexp',options.fileFilterRegexp,'datasetName',options.datasetName,'frameList',[]);

Error in ciatah/runPipeline (line 209) obj.(thisFxn{1});

Error in ciatah/display (line 6) obj.runPipeline; @@@@@@@ Warning: User likely did not give calciumImagingAnalysis a proper raw input file regular expression or incorrect HDF5 input dataset name!

In ciatah/modelPreprocessMovieFunction (line 642) In ciatah/modelPreprocessMovie (line 42) In ciatah/runPipeline (line 209) In ciatah/display (line 6)

image

bahanonu commented 1 year ago

Thanks for reaching out, could you send an example avi (e.g. just a Box or Dropbox link)? And is this a color (RGB) AVI? That'll help me debug what the issue is as CIAtah should support most AVIs unless not supported by the OS or certain specific codecs.

dprotter commented 1 year ago

Thanks for that fast reply! Heres a test video. i left it un-concatenated the way it comes off the scope, but could concat with ffmpeg if thats a better fit for ciatah. Encoding is ffv1. Ive gotten it to play directly with gstreamer, so I have the correct codecs. It also works in the viewMovieRegistrationTest step (including selecting the MC ROI).

https://drive.google.com/drive/folders/1_m-xqXIz2sgGRVuCOwvI9LpTeThbpgXU?usp=sharing

dprotter commented 1 year ago

I took another look today and realized theres a similar "variable does not support dot indexing" error raised in io.readFrame (139) for the avi case. I know you said it wasnt optimal, but things do run if I comment that same thisFrame.cdata line out.

-edit- However, it still doesnt work for a folder with a list of files (like the one I added to google drive), where again it fails to retrieve a frame for drawing the MC ROI.