mehta-lab / recOrder

3D quantitative label-free imaging with phase and polarization
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Append channels via CLI calls #454

Closed talonchandler closed 8 months ago

talonchandler commented 8 months ago

Before this PR: This pair of CLI calls

recorder reconstruct -i input.zarr/0/0/0 -c ./phase.yaml -o output.zarr
recorder reconstruct -i input.zarr/0/0/0 -c ./DAPI.yaml -o output.zarr

would overwrite the first phase reconstruction, resulting in a DAPI-only reconstruction.

After this PR: The same CLI calls result in two channels in output.zarr as expected.

codecov[bot] commented 8 months ago

Codecov Report

Merging #454 (c3379a1) into main (2aa080e) will increase coverage by 0.61%. The diff coverage is 100.00%.

@@           Coverage Diff            @@
##            main    #454      +/-   ##
========================================
+ Coverage   8.83%   9.45%   +0.61%     
========================================
  Files         29      29              
  Lines       4561    4592      +31     
========================================
+ Hits         403     434      +31     
  Misses      4158    4158              
Files Coverage Δ
recOrder/tests/cli_tests/test_reconstruct.py 97.87% <100.00%> (+0.72%) :arrow_up:
recOrder/tests/util_tests/test_create_empty.py 100.00% <100.00%> (ø)
edyoshikun commented 8 months ago

This appending channels is also something that I was battling with mantis, especially after the registration as well. I have found that appending is tricky when the process of appending crashes ( for whatever reason, you accidentally close the terminal, end the process,etc) then if you try to restart the appending since the channel name already exists it will fail. I was running both separately to make sure I had successful reconstructions/deskewing and then appending together. Is there a an easier way to cleanup or to re-append?

Soorya19Pradeep commented 8 months ago

Thank you @talonchandler for implementing cli call for appending multiple reconstructed channels. I have tested this on the dataset from Hunter in this folder and it is working well. /hpc/projects/comp.micro/infected_cell_imaging/Image_preprocessing/Exp_2023_09_28_DENV_Fixed/ The time for processing has reduced to 1/3rd, which is great. I too have the same question as @edyoshikun. I haven't figured out how to use the same for the dragonfly dataset. I have to reconstruct just the phase channel and append the fluorescence channels. I realize the code already exists in iohub for appending channels. Is there a way to do the same using cli, @ziw-liu ?

edyoshikun commented 8 months ago

I also use the iohub code and it's relatively fast.

talonchandler commented 8 months ago

Thanks for testing @Soorya19Pradeep!

@Soorya19Pradeep and I just discussed our next steps, and we agreed that: