Skip to content

Commit

Permalink
Added image_utils.save_image (#45)
Browse files Browse the repository at this point in the history
* added image_utils

* use tmi main branch
  • Loading branch information
srivarra authored Nov 4, 2022
1 parent d497999 commit 5645497
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mibi_bin_tools/bin_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import xarray as xr

from mibi_bin_tools import io_utils, type_utils, _extract_bin
from tmi.image_utils import save_image


def _mass2tof(masses_arr: np.ndarray, mass_offset: float, mass_gain: float,
Expand Down Expand Up @@ -100,12 +101,8 @@ def _write_out(img_data: np.ndarray, out_dir: str, fov_name: str, targets: List[
# save all first images regardless of replacing
# if not replace (i=1), only save intensity images for specified targets
if i == 0 or (target in list(intensities)):
io.imsave(
os.path.join(out_dir_i, f'{target}{suffix}.tiff'),
img_data[i, :, :, j].astype(save_dtype),
plugin='tifffile',
check_contrast=False
)
fname = os.path.join(out_dir_i, f"{target}{suffix}.tiff")
save_image(fname=fname, data=img_data[i, :, :, j].astype(save_dtype))


def _find_bin_files(data_dir: str,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ matplotlib==3.4.3
numpy>=1.21.6,<2
pandas>=1.3.5,<2
scikit-image>=0.19.3,<0.20
tmi @ git+https://github.com/angelolab/tmi.git
xarray>=2022.6.0,<2023

0 comments on commit 5645497

Please sign in to comment.