Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/imcflibs/imagej/bioformats.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Memoizer,
MetadataTools,
ZeissCZIReader,
Region,
)


Expand Down Expand Up @@ -186,6 +187,7 @@ def import_image(
t_start=None,
t_end=None,
t_interval=None,
region=None,
):
"""Open an image file using the Bio-Formats importer.

Expand Down Expand Up @@ -229,8 +231,11 @@ def import_image(
only import a subset of time points ending with this one. Requires to
set t_start and t_interval.
t_interval : int, optional
only import a subset of time points with thsi interval. Requires to set
only import a subset of time points with this interval. Requires to set
t_start and t_end.
region : list, optional
Bio-Formats crop region, by default None.
Format = [start_x, start_y, width in px, height in px]

Returns
-------
Expand Down Expand Up @@ -276,6 +281,12 @@ def import_image(
options.setTEnd(series_number, t_end)
options.setTStep(series_number, t_interval)

if region is not None:
options.setCrop(True)
options.setCropRegion(
series_number, Region(region[0], region[1], region[2], region[3])
)

log.info("Reading [%s]", filename)
orig_imps = BF.openImagePlus(options)
log.debug("Opened [%s] %s", filename, type(orig_imps))
Expand Down
Loading