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

modelPreprocessMovie NormCorre bug #120

Open Antorithms opened 1 year ago

Antorithms commented 1 year ago

Hi Biafra, When trying to use NormCorre from the modelPreprocessMovie function in the gui, I run in the error below. I guess it must be related to me not having run getNoRMCorreParams, but I am not sure..

Thanks again for your help, Anto

`Getting NoRMCorre params... @@@@@@@ Unable to resolve the name 'normcorre.NoRMCorreSetParms'.

Error in ciapkg.motion_correction.getNoRMCorreParams (line 75) optsNC = normcorre.NoRMCorreSetParms(...

Error in ciapkg.motion_correction.turboregMovie/turboregMovieParallel (line 602) optsNoRMCorre = ciapkg.motion_correction.getNoRMCorreParams(size(inputMovieCropped),'guiDisplay',0);

Error in ciapkg.motion_correction.turboregMovie (line 377) turboregMovieParallel();

Error in ciapkg.api.turboregMovie (line 10) [inputMovie, ResultsOutOriginal] = ciapkg.motion_correction.turboregMovie(inputMovie,'passArgs', varargin);

Error in ciatah/modelPreprocessMovieFunction/subfxn_turboregInputMovie (line 2019) [thisMovie(:,:,movieSubset), ResultsOutOriginal{iterationNo}{thisSet}] = turboregMovie(thisMovie(:,:,movieSubset),'options',ioptions);

Error in ciatah/modelPreprocessMovieFunction (line 906) subfxn_turboregInputMovie();

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; @@@@@@@ @@@@@@@ Unable to resolve the name 'normcorre.normcorre_batch'.

Error in ciapkg.motion_correction.turboregMovie/turboregMovieParallel (line 610) [~,ResultsOut,template2] = normcorre.normcorre_batch(...

Error in ciapkg.motion_correction.turboregMovie (line 377) turboregMovieParallel();

Error in ciapkg.api.turboregMovie (line 10) [inputMovie, ResultsOutOriginal] = ciapkg.motion_correction.turboregMovie(inputMovie,'passArgs', varargin);

Error in ciatah/modelPreprocessMovieFunction/subfxn_turboregInputMovie (line 2019) [thisMovie(:,:,movieSubset), ResultsOutOriginal{iterationNo}{thisSet}] = turboregMovie(thisMovie(:,:,movieSubset),'options',ioptions);

Error in ciatah/modelPreprocessMovieFunction (line 906) subfxn_turboregInputMovie();

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)`

bahanonu commented 1 year ago

Glad to help, what is the output when you run normcorre.NoRMCorreSetParms('d1',512,'d2',512) from the command window?

Antorithms commented 1 year ago

Hi Biafra, I get Unable to resolve the name 'normcorre.NoRMCorreSetParms'.

bahanonu commented 1 year ago

Seems my packaged version of normcorre (https://github.com/bahanonu/NoRMCorre) might either not be downloaded or in the path (should under _external_programs\normcorre). Can use ciapkg.io.loadDependencies; on the command line then ciapkg.loadBatchFxns;.

Antorithms commented 1 year ago

Thanks! I thought just cloning the repo would actually also download NormCorre automatically in external programs and this led to me not checking. Sorry about that. Trying to run it now I get this error.

Template initialization complete.  Now registering all the frames with new template. 
4415 out of 4415 frames registered, iteration 1 out of 1..
Elapsed time is 131.539202 seconds.
Elapsed time is 131.706235 seconds.
registering frames...
@@@@@@@
Error using mat2cell
Input arguments, D1 through D4, must sum to each dimension of the input matrix size, [7  10   1   2].

Error in normcorre.apply_shifts (line 229)
                parfor ii = 1:lY 

Error in ciapkg.motion_correction.turboregMovie/registerMovie (line 656)
                inputMovie = normcorre.apply_shifts(inputMovie,ResultsOut,optsNC,bound/2,bound/2); % apply the shifts to the removed percentile

Error in ciapkg.motion_correction.turboregMovie (line 446)
    registerMovie();

Error in ciapkg.api.turboregMovie (line 10)
    [inputMovie, ResultsOutOriginal] = ciapkg.motion_correction.turboregMovie(inputMovie,'passArgs', varargin);

Error in ciatah/modelPreprocessMovieFunction/subfxn_turboregInputMovie (line 2019)
                [thisMovie(:,:,movieSubset), ResultsOutOriginal{iterationNo}{thisSet}] = turboregMovie(thisMovie(:,:,movieSubset),'options',ioptions);

Error in ciatah/modelPreprocessMovieFunction (line 906)
                                    subfxn_turboregInputMovie();

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;
@@@@@@@
bahanonu commented 1 year ago

What are the dimensions of the movie? And could you send a screenshot of the normcorre settings you used along with the _preprocess.log file in the processing_info?

bahanonu commented 1 year ago

Also, if you want to send me an email with a link to an example movie, I can take a look on my end and get back.

Antorithms commented 1 year ago

Hi Biafra, Here the log and the settings from the ModelPreprocessMovie gui. Frame dimensions are 400 640 and n of frames is around 35000. Maybe relevant is that i manage to run preprocessing with the same video and turboreg. Thanks a lot for your help. Anto

20230125_132040_preprocess.log image

dprotter commented 1 year ago

was there any resolution here? I am running into the same error.

Antorithms commented 1 year ago

Not yet! Will post on this issue once solution is available