ryhattori / patchwarp Goto Github PK
View Code? Open in Web Editor NEWImage processing pipeline to correct motion artifacts and complex image distortions in neuronal calcium imaging data.
License: GNU General Public License v2.0
Image processing pipeline to correct motion artifacts and complex image distortions in neuronal calcium imaging data.
License: GNU General Public License v2.0
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
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
PatchWarp/PatchWarp/utils/ecc_patchwarp/ecc_patchwarp.m
Lines 420 to 428 in c6203f4
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.
PatchWarp/PatchWarp/patchwarp_affine.m
Line 177 in c6203f4
This could potentially be fixed if warp_success
in the below line is changed to warp_success(i1,i2,i3)
.
PatchWarp/PatchWarp/patchwarp_affine.m
Line 165 in c6203f4
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.
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.
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.