rework of original background substraction#24
Conversation
Corrected the help description for the pyramid_levels argument
backsub/backsub.py
Outdated
|
|
||
| outdir.mkdir(parents=True, exist_ok=True) | ||
| #out_file_path= outdir / f'{file_name}.tif' | ||
| out_file_path=outdir / file_name |
There was a problem hiding this comment.
in main the outpath is given as an input for this function which treats it as the outdir - it should just be treated as the outpath here
backsub/backsub.py
Outdated
|
|
||
| #Write updated markers.csv | ||
| markers_updated = markers_updated.drop(columns=['keep','ind','processed','factor','bg_idx']) | ||
| markers_updated .to_csv(args.markerout / "markers_bs.csv", index=False) |
There was a problem hiding this comment.
| markers_updated .to_csv(args.markerout / "markers_bs.csv", index=False) | |
| markers_updated.to_csv(args.markerout, index=False) |
There was a problem hiding this comment.
I made the correction suggested above. The latest commit (added saveRAM argument) includes the following features:
Commit features:
- Markerout corrected to be a path to output file (CLIand backsub.py) line 77 and 252 respectively
- Added the saving ram option
- Added dask-image to new_environment.yml required for saving ram
Issued solved:
4. (#23) Read channel name from markers csv and add it to the ome metadata
5. (#18) Sends warning with repeated backsub column name (line 56 backsub.py)
6. (#22) Apply lossless compression to the out tif to reduce output file size
7. (#15) Numpy version is updated, no more limited to <1.22
|
Hello Mr. Bestak, I think this is the final outcome of the rework, I optimized the RAM usage as to have it in the range of values you had in version 0.4.1. Nonetheless, I have set two RAM profiles, one with moderate RAM usage, this is the default. And a second one with similar performance as in v0.4.1, this one is implemented when using the --save_ram argument in the CLI. I have also updated the README.md file accordingly and listed the features of this new version. I think the only missing part is updating the Dockerfile to include the libraries you require for Nextflow. Can you please do that. |
|
Amazing work @VictorDidier ! Dockerfile: in new_env.yaml add the extra |
|
I think compression should be provided as an argument, with "LZW" as default, what do you think? |
In the way we are writing the output images, i.e. channel by channel, the "LZW" algorithm is recommendable for lossless compression. The other lossless option is jpeg2000 but this works better when writing a whole stack at once or RGB (Check this link: https://forum.image.sc/t/creating-a-multi-channel-pyramid-ome-tiff-with-tiffwriter-in-python/76424/6). But since we are not saving the whole-stack at once, "LZW" compression becomes the best option. If compression becomes an argument, I think we could define it as a boolean flag, i.e. -nc (--no_compression) and mention that by default "LZW" is applied unless -nc is given. What do you think? |
Added the rework of the tool in a folder called backsub:
New features:
!!! No changes were made to the original script background_subtraction.py, all the features above are in the added backsub folder.!!!