schnitzer-lab / EXTRACT-public

EXTRACT is a tractable and robust automated cell extraction tool for calcium imaging, which extracts the activities of cells as time series from both one-photon and two-photon calcium imaging movies.
MIT License
62 stars 16 forks source link

Error running external cell checker #4

Closed rl72 closed 3 years ago

rl72 commented 3 years ago

Hi,

I'd like to thank you first of all for sharing EXTRACT with us, it's a great tool for analyzing calcium data!

I am encountering an issue when trying to run the external cell checker (cell_check.m is giving errors too but I ran it through multiple partitions), namely it gives the following error messages and then starts repeating them on a loop for a very long time : @@@@@@@ Index exceeds matrix dimensions.

Error in compareSignalToMovie (line 101) nPoints = options.inputMovieDims(3);

Error in signalSorter>viewMontage (line 2463) croppedPeakImages = compareSignalToMovie(inputMovie, inputImage, thisTrace,'getOnlyPeakImages',1,'waitbarOn',0,'extendedCrosshairs',2,'crossHairVal',maxValMovie*options.crossHairPercent,'outlines',1,'signalPeakArray',signalPeakArray,'cropSize',cropSizeLength,'addPadding',1,'outlineVal',NaN,'xCoords',xCoords,'yCoords',yCoords,'inputDatasetName',options.inputDatasetName,'inputMovieDims',options.inputMovieDims,'hdf5Fid',options.hdf5Fid,'keepFileOpen',options.keepFileOpen);

Error in signalSorter>chooseSignals (line 981) [objCutImagesCollection{i}, ~] = viewMontage(options.inputMovie,thisImage,options,thisTrace,[signalPeakIdx{i}],minValMovie,maxValMovie,options.cropSizeLength,i,1);

Error in signalSorter (line 608) [choices, safeExit] = chooseSignals(options,1:nSignals, inputImages,inputSignals,objMap, valid, inputStr,tmpDir,sessionID,signalPeakIdx,signalSnr,inputImagesThres,inputImageSizes,peakOutputStat,ROItraces,imgStats,inputSignalSignal,inputSignalNoise,inputImagesBoundaryIndices,signalPeakIdxOriginal,signalPeaksOriginal,instructionStr); @@@@@@@ @@@@@@@ Index exceeds matrix dimensions.

Error in signalSorter>chooseSignals (line 1039) title(['imageCorr = ' num2str(round(peakOutputStat.outputMeanImageCorrs(i)*sigDig)/sigDig) 10 'Press Y to go to last sorted signal.'],'FontSize',options.fontSize,'Interpreter','tex');

Error in signalSorter (line 608) [choices, safeExit] = chooseSignals(options,1:nSignals, inputImages,inputSignals,objMap, valid, inputStr,tmpDir,sessionID,signalPeakIdx,signalSnr,inputImagesThres,inputImageSizes,peakOutputStat,ROItraces,imgStats,inputSignalSignal,inputSignalNoise,inputImagesBoundaryIndices,signalPeakIdxOriginal,signalPeaksOriginal,instructionStr); @@@@@@@ 0 0 cellmap type: max @@@@@@@ Index exceeds matrix dimensions.

Error in signalSorter>chooseSignals (line 1271) ' | imageCorr = ' num2str(round(peakOutputStat.outputMeanImageCorrs(i)*sigDig)/sigDig) ',' num2str(peakOutputStat.outputMeanImageCorrs2(i))...

Error in signalSorter (line 608) [choices, safeExit] = chooseSignals(options,1:nSignals, inputImages,inputSignals,objMap, valid, inputStr,tmpDir,sessionID,signalPeakIdx,signalSnr,inputImagesThres,inputImageSizes,peakOutputStat,ROItraces,imgStats,inputSignalSignal,inputSignalNoise,inputImagesBoundaryIndices,signalPeakIdxOriginal,signalPeaksOriginal,instructionStr); @@@@@@@ All warnings have the state 'off'. calculating movie min/max... finding centroids... Finding cell neighbors: 2|100 Done assigning neighbor IDs...

ans =

'Frame 1/22725'

Is there any way to fix this? Thanks a lot

fatihdinc commented 3 years ago

Thank you very much for your question! Currently, our cell_check module is an experimental module that works only if there are no partitions. We are working on it, it is our top priority, but it will not be fully ready for some time. Instead, we have provided a link to another sorter in the Readme file. I would suggest going through the Readme file regularly to check for updates on the matter related to cell_check.m, which we hope to update soon. Here is a direct quote from the Readme file:

"We note that this feature is still experimental and we are constantly working to improve it. We are also providing an external cell checker in case cell_check fails, which usually happens when the number of EXTRACT partitions is larger than 1."

As for the external checker, we suggest contacting their own support team and opening an issue in their repository, which is distinct from us.

I hope that this is helpful, thank you so much for your kind words towards our team.

rl72 commented 3 years ago

Thank you for the quick response! Yes I have read about the fact that cell_check is in an experimental phase so that's why I tried to run the external cell checker but these errors kept on popping up when I ran the code provided in the Readme file...

I was also wondering, where is the EXTRACT output file saved ?

fatihdinc commented 3 years ago

Thanks! All of EXTRACT's output is under the "output" struct that comes out of the code:

output=extractor(M,config);

This is the file to save, but EXTRACT doesn't save automatically. You can do so after the extraction. The external checker uses this file as well.

To check whether there is an issue with the external checker, you could perhaps try running the external checker with the example movie we provided? If there is an error there too, it might be an implementation issue

bahanonu commented 3 years ago

@rl72 Can drop CIAtah/signalSorter related questions at https://github.com/bahanonu/ciatah/issues/70 or open a new issue.

If running EXTRACT via CIAtah, there should either be a MAT-file ending in _extractAnalysis.mat or a NWB file ending in _extractAnalysis.nwb in the folder where the processed movie is located, depending on the options you selected.

rl72 commented 3 years ago

@fatihdinc thank you for your answer! It does work with your example movie, so it must be something with my movies (I have tried with different ones)... @bahanonu I answered you on the #70 issue thread, thanks a lot!

fatihdinc commented 3 years ago

Thanks @bahanonu ! I will be closing this issue now, if you have different questions, feel free to open a new one or email us at extractneurons@gmail.com !