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
82 stars 21 forks source link

Incomplete data upload during CNMF-E cell extraction #65

Open miguelvmc opened 3 years ago

miguelvmc commented 3 years ago

Hi Biafra,

I am a new user of your analysis pipeline for calcium imaging. First, a big thank you developing this great tool.

We are currently using the pipeline to analyse calcium imaging data acquired with UCLA miniscopes. The data acquisition system saves the miniscope videos in separate files, each with 1000 frames. The videos we want to analyse correspond to a 20min session during wich calcium signals were acquired at 30fps. The initial videos were saved with GREY compression and we had to convert them to .TIF in order to run them through the pipeline.

We successfully managed to run modelPreprocessMovie with a downsampling factor of 4 and got the expected output. Our issue came when running modelExtractSignalsFromMovie with CNMF-E. Apparently out of 37 videos, each with 1000 frames the pipeline only uploaded 1000 frames, leading to the error copied below.

information at the beginning of modelExtractSignalsFromMovie The data has 608 X 608 pixels X 1000 frames. Loading all data (double precision) requires 2.754 GB RAM

error message during modelExtractSignalsFromMovie @@@@@@@ Error using calciumImagingAnalysis/modelExtractSignalsFromMovie/saveRunTimes (line 587) Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-37. Error in calciumImagingAnalysis/modelExtractSignalsFromMovie (line 365) saveRunTimes('cnmfe'); Error in calciumImagingAnalysis/runPipeline (line 202) obj.(thisFxn{1}); Error in calciumImagingAnalysis/display (line 817) obj.runPipeline; @@@@@@@

Any idea why the pipeline might be skipping the upload of the rest of the data?

All the best, Miguel

bahanonu commented 3 years ago

@miguelvmc

Hope all's well and glad you-all are finding the tool useful.

It looks like CNMF-e ran correctly but the post cell-extraction step to save the runtimes to a file ran into an issue. A couple quick questions to help debug:

miguelvmc commented 3 years ago

Hi Biafra,

Thanks for the quick reply!

bahanonu commented 3 years ago

Sure thing!

re: greyscale videos, CIAtah should be able to read 8-bit compressed grayscale AVIs, what error do you get when you try to run the processing pipeline on those movies?

miguelvmc commented 3 years ago

Hi Biafra,

Thanks for the quick reply. Turns out I did choose the incorrect files based on the regular expression I passed (duh!). Having chosen the dfof HDF5 output file I managed to run cell extraction all the way to the end.

After that I restarted MATLAB and tried to upload extraction results in order to run viewCellExtractionOnMovie but got a message that there were no files, even though the .mat file with extraction results was present:

image

Is there any addtional file I should have saved?

Finally, regarding the .avi issue I mentioned. I tried uploading the original greyscale compressed .avi movies and got the following error message:

@@@@@@@ Error using VideoReader/initReader (line 734) Unable to determine the required codec.

Error in audiovideo.internal.IVideoReader (line 136) initReader(obj, fileName, currentTime);

Error in VideoReader (line 104) obj@audiovideo.internal.IVideoReader(varargin{:});

Error in loadMovieList (line 269) xyloObj = VideoReader(thisMoviePath);

Error in calciumImagingAnalysis/modelPreprocessMovieFunction>turboregCropSelection (line 1962) thisFrame = loadMovieList(inputFilePath,'convertToDouble',0,'frameList',options.refCropFrame,'inputDatasetName',options.datasetName,'treatMoviesAsContinuous',options.turboreg.treatMoviesAsContinuousSwitch,'loadSpecificImgClass','single');

Error in calciumImagingAnalysis/modelPreprocessMovieFunction (line 466) [turboRegCoords] = turboregCropSelection(options,folderList);

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

Error in calciumImagingAnalysis/runPipeline (line 202) obj.(thisFxn{1});

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

In calciumImagingAnalysis/modelPreprocessMovieFunction (line 471) In calciumImagingAnalysis/modelPreprocessMovie (line 37) In calciumImagingAnalysis/runPipeline (line 202) In calciumImagingAnalysis/display (line 817)

Best, Miguel

bahanonu commented 3 years ago

@miguelvmc

Hope all is well, see below.

re: viewCellExtractionOnMovie, is the absolute path input into "modelAddNewFolders" pointing to the correct folder or is the mat file the expected size (e.g. if it is <1 MB there might have been a save issue with modelExtractSignalsFromMovie)? Another possibility is that you need to select CNMF from the main CIAtah interface, e.g. see below.

image

re: greyscale compressed movies, that looks like it is an outside codec issue that may involve checking that your system/MATLAB has access to the right codec. Do you know how the file was compressed? And which OS are you running? If you can email me a link to one of the videos, I can likely take a look to see if there is a way to resolve this.

cheers, -Biafra

miguelvmc commented 3 years ago

Hi Biafra,

Sorry for the delay following up on this and thanks for the reply. Indeed Iwasnæt selectig the correct cell extraction method.

Regarding the greyscale movie. I don't know how the specifics of how the movie is compressed, but I can get in contact with the develpers of the miniscopes to get more details. Regardless, I will email you a link to one of my videos.

Best, Miguel

bahanonu commented 3 years ago

@miguelvmc Try loading one of your greyscale videos after installing https://codecguide.com/download_k-lite_codec_pack_standard.htm.