Skip to content

Commit d19462d

Browse files
committed
Merge modifications made by @CellKai in imcf#106
1 parent c669c0f commit d19462d

1 file changed

Lines changed: 58 additions & 13 deletions

File tree

src/imcflibs/imagej/bdv.py

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import shutil
1414
import sys
1515

16-
from bdv.util.source.fused import AlphaFusedResampledSource
1716
from ch.epfl.biop.scijava.command.spimdata import (
1817
FuseBigStitcherDatasetIntoOMETiffCommand,
1918
)
@@ -1602,16 +1601,23 @@ def fuse_dataset_bdvp(
16021601
project_path,
16031602
command,
16041603
result_path=None,
1604+
fusion_method="SMOOTH AVERAGE",
1605+
range_channels="",
1606+
range_slices="",
1607+
range_frames="",
16051608
n_resolution_levels=5,
16061609
use_lzw_compression=True,
1607-
fusion_method="SMOOTH " + AlphaFusedResampledSource.AVERAGE,
1610+
split_slices=False,
1611+
split_channels=False,
1612+
split_frames=False,
1613+
override_z_ratio=False,
1614+
z_ratio=1.0,
1615+
use_interpolation=True,
16081616
):
16091617
"""Export a BigDataViewer project using the BIOP Kheops exporter.
16101618
1611-
Convert a BigDataViewer project into OME-TIFF files using the BIOP
1612-
Kheops exporter. This wraps the Scijava export command and allows
1613-
setting the output directory, compression and number of resolution
1614-
levels.
1619+
Use BIOP Kheops exporter to fuse a BigDataViewer project and save
1620+
it as pyramidal OME-TIFF.
16151621
16161622
Parameters
16171623
----------
@@ -1622,18 +1628,39 @@ def fuse_dataset_bdvp(
16221628
result_path : str, optional
16231629
Path where to store the exported files. If ``None``, files will be
16241630
saved in the same directory as the input project.
1625-
n_resolution_levels : int, optional
1626-
Number of resolution levels to export (default 5).
1627-
use_lzw_compression : bool, optional
1628-
Whether to use LZW compression for the output TIFFs (default True).
16291631
fusion_method : str, optional
16301632
Fusion method to use for exporting (default ``"SMOOTH AVERAGE"``).
1633+
range_channels : str, optional
1634+
Channels to include in the export. Default is all channels.
1635+
range_slices : str, optional
1636+
Slices to include in the export. Default is all slices.
1637+
range_frames : str, optional
1638+
Frames to include in the export. Default is all frames.
1639+
n_resolution_levels : int, optional
1640+
Number of pyramid resolution levels to use for the export. Default is 5.
1641+
use_lzw_compression : bool, optional
1642+
If True, compressed the output file using LZW. Default is True.
1643+
split_slices : bool, optional
1644+
If True, splits the output into separate files for each slice. Default is False.
1645+
split_channels : bool, optional
1646+
If True, splits the output into separate files for each channel. Default is False.
1647+
split_frames : bool, optional
1648+
If True, splits the output into separate files for each frame. Default is False.
1649+
override_z_ratio : bool, optional
1650+
If True, overrides the default z_ratio value. Default is False.
1651+
z_ratio : float, optional
1652+
The z ratio to use for the export. Default is 1.0.
1653+
use_interpolation : bool, optional
1654+
If True, interpolates during fusion (takes ~4x longer). Default is True.
16311655
16321656
Notes
16331657
-----
16341658
This function requires the PTBIOP update site to be enabled in Fiji/
16351659
ImageJ.
16361660
1661+
Examples
1662+
--------
1663+
fuse_dataset_bdvp(xml_input, cs)
16371664
"""
16381665

16391666
file_info = pathtools.parse_path(project_path)
@@ -1643,17 +1670,35 @@ def fuse_dataset_bdvp(
16431670

16441671
command.run(
16451672
FuseBigStitcherDatasetIntoOMETiffCommand,
1646-
False,
1673+
True,
16471674
"xml_bigstitcher_file",
16481675
project_path,
16491676
"output_path_directory",
16501677
result_path,
1678+
"range_channels",
1679+
range_channels,
1680+
"range_slices",
1681+
range_slices,
1682+
"range_frames",
1683+
range_frames,
16511684
"n_resolution_levels",
16521685
n_resolution_levels,
1653-
"use_lzw_compression",
1654-
use_lzw_compression,
16551686
"fusion_method",
16561687
fusion_method,
1688+
"use_lzw_compression",
1689+
use_lzw_compression,
1690+
"split_slices",
1691+
split_slices,
1692+
"split_channels",
1693+
split_channels,
1694+
"split_frames",
1695+
split_frames,
1696+
"override_z_ratio",
1697+
override_z_ratio,
1698+
"z_ratio",
1699+
z_ratio,
1700+
"use_interpolation",
1701+
use_interpolation,
16571702
).get()
16581703

16591704

0 commit comments

Comments
 (0)