flatironinstitute / NoRMCorre

Matlab routines for online non-rigid motion correction of calcium imaging data
GNU General Public License v2.0
144 stars 89 forks source link

Image registration progress on command line #8

Closed ehennestad closed 7 years ago

ehennestad commented 7 years ago

Hi,

I think it is great to have the progress printed to the command line, but it results in a lot of text, and sometimes I want to see messages printed before I started image registration.

I have some few pieces of code that I use in my scripts to update the the textstring on the command line, instead of printing a new one:

str=[num2str(n), 'out of ', num2str(nFrames), 'frames registered'];
refreshdisp(str, prevstr, n);
prevstr=str; 

where refreshdisp looks like this:

function refreshdisp(str,prevstr,iteration)

if ~exist('iteration')
    iteration=2;
end

if iteration==1
    fprintf(str)
else
    fprintf(char(8*ones(1,length(prevstr))));
    fprintf(str);
end

also need to initialize prevstr.

Maybe this could be added to normcorre?

epnev commented 7 years ago

Thank for the suggestion, I incorporated it!