phflot / flow_registration

Flow-Registration toolbox for 2P motion compensation
https://www.snnu.uni-saarland.de/flow-registration/
21 stars 2 forks source link

error when running longer files with beta update #10

Closed milesOIST closed 1 year ago

milesOIST commented 1 year ago

I ran the demo on a short file on my desktop and it worked. I also managed to get it working with a short (300 frame) test vid, both on my desktop and on the cluster. However, I’m now getting this error and am at a bit of a loss what to do

Starting compensation with quality setting quality and min_level = 0. Set the quality setting to fast, balanced or quality or increase min_level for fast, approximated solutions. Output format is HDF5.

Index in position 4 exceeds array bounds (must not exceed 100).

Error in compensate_recording>compensate_multi_ref_recording (line 223) c_reg(:, :, :, idx_j) = compensate_inplace(buffer(:, :, :, idx_j), reference_frames{j}, options);

Error in compensate_recording (line 27) compensate_multi_ref_recording(options);

Error in HDF5_FlowReg_deigo (line 35) compensate_recording(options);

This is the code I am trying to run


addpath(genpath('/apps/unit/KuhnU/miles/my_scripts/core'));
addpath(genpath('/apps/unit/KuhnU/miles/my_scripts/util'));

run('/apps/unit/KuhnU/miles/set_path.m');

[~,outfolder,~] = fileparts(file1);
outfolder = strcat(outfolder, '/');

options = OF_options(...
    'input_file', file1, ...
    'output_path', outfolder, ... % results folder
    'output_format', 'HDF5', ... % output file format: HDF5, MAT,
                             ... % TIFF or MULTIFILE_HDF5, ... to generate multiple files
                             ... % or CAIMAN_HDF5 for CAIMAN support
    'alpha', 4, ... % smoothness parameter
    'sigma', [1, 1, 0.1; ...  % gauss kernel size channel 1
              1, 1, 0.1], ... % gauss kernel size channel 2
    'levels', 100, ... % solver levels
    'eta', 0.75, ... % pyramid stepsize
    'iterations', 100, ... % outer iterations (the larger the better the result, but slower)
    'bin_size', 5, ... % binning over 5 frames from the 30 hz data=
    'buffer_size', 100, ... % size of blocks for the parallel evaluation (larger takes more memory)
    'quality_setting', 'quality', ...
    'reference_frames',10000:10250, ...
    'weight', [0.60,0.40], ...
    'output_typename', '', ...
    'n_references', 2, ...
    'min_frames_per_reference', 30, ...
    'save_w',false...
    );

% saving the options to txt file (for archiving):
options.save_options(fullfile(pwd, 'options.json'));

compensate_recording(options);
phflot commented 1 year ago

This is should be fixed with the latest commit to the demo branch - there was an issue with the indices for large files and multiple batches.