Giter Club home page Giter Club logo

patchwarp's People

Contributors

ryhattori avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

patchwarp's Issues

Setting ops.n_ch = 2 quarters the amount of saved images.

First, thank you again for this great toolbox and the last fix for two-channel data.
Working with your toolbox, I found another potential bug. When using two-channel data and setting ops.n_ch = 2, ops.run_rigid_mc = 1, and ops.run_affine_wc = 1, when calling patchwarp(ops), the resulting images contain only a quarter of the original.
The expected behavior would be half of the images.
The issue is related to the parameter n_ch being passed to both correction functions.
My quick and dirty fix is to hardcode ops.n_ch = 1 in the patchwarp_affine.m file. This should make the most sense for most applications.
Sincerely

  • Kilian Rolle

Index error in patchwarp_affine `warp_success` variable call

Hi, thanks again for putting up the code for PatchWarp. Using most recent PatchWarp main branch on Matlab 2020a. PatchWarp encounters an error within patchwarp_affine when attempting to call variable warp_success with certain movies.

It appears this is because warp_success is defined as a scalar/binary output in ecc_patchwarp, see

if mean(ones_map(:)) > 0.4 % At least 40% area needs to overlap.
rho_best = rho_final_image;
warp_best = final_warp;
warp_success = 1;
else
rho_best = rho_original_image;
warp_best = [1 0 0; 0 1 0];
warp_success = 0;
end

And yet in patchwarp_affine it is called with (warp_success(i1,i2,i3) == 0), or as a 3D matrix leading to index issues. This error usually is not encountered as the short-circuit || leads to that expression not being called since it is second.

if (sum(sum(abs(warp_cell{i1,i2,i3}) > affinematrix_abssum_threshold)) > 0) || (warp_success(i1,i2,i3) == 0)

This could potentially be fixed if warp_success in the below line is changed to warp_success(i1,i2,i3).

[~, warp_cell{i1,i2,i3}, ~, rho(i1,i2,i3), warp_success]= ...

Error when attempting warp correction

Running the rigid motion correction works fine. I'm using the demo file as a template. After finishing this part and starting the warp correction, I receive the following warnings and errors:

Loading downsampled_perstack file...

Warning: Total frames are not a multiple of n_ch.

In read_tiff (line 62)

In patchwarp_affine (line 55)

In patchwarp (line 150)

In patchwarp_demo (line 123)

Estimating affine transformation matrices...

n_split4warpinit is too large
n_split4warpinit was changed to 4
Applying affine transformations...
Error using patchwarp_affine
warp number does not match file number

Error in patchwarp (line 150)
patchwarp_affine(save_path_prewarp, save_path_postwarp, ops.n_ch, ops.align_ch, ops.affine_norm_radius, ops.warp_template_tiffstack_num, ops.warp_movave_tiffstack_num, ops.warp_blocksize, ops.warp_overlap_pix_frac, ops.n_split4warpinit, ops.edge_remove_pix, ops.affinematrix_abssum_threshold, ops.affinematrix_abssum_jump_threshold, ops.affinematrix_rho_threshold, ops.affinematrix_medfilt_tiffstack_num, ops.transform, ops.warp_pyramid_levels, ops.warp_pyramid_iterations, ops.downsample_frame_num, ops.worker_num, ops.network_temp_copy);

Error in patchwarp_demo (line 123)
patchwarp(ops);

I would appreciate an idea of the issue and a potential solution.

Big Tiff support?

It seems like this doesn't support Big Tiffs. When I input a bigtiff, it only spits out a 4 GB tiff file for rigid correction, and I get an error with the nonrigid.
Do you forsee any problems if I switch the tiff read/write support utilities to those from my github repo, supporting bigtiffs? https://github.com/jmstujenske/Matlab_FastTiffReadWrite It also have a TiffViewer utility based on memory mapping that can load the tiffs quickly for checking the motion correction quality, which may be helpful.

Java.io.File does not work when paths are specified using character vectors

Hi,
I am excited to try out this new motion correction algorithm. Just wanted to report a small issue, namely that java.io.File fails if paths are specified as character vectors and not strings. I got this error from the fastdir function:

No constructor 'java.io.File' with matching signature found.

Error in fastdir (line 11)
    jif = java.io.File(dir_name);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.