0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

napariで連番付きtif画像を開きたい

Posted at

やりたいこと

ディレクトリに含まれる連番付きのtif画像をまとめて開いてnapariで見たい。Image Jで言うところの「Open Image Sequence」。

コード

visualize_tif_sequence.py
import glob
import napari
import numpy as np

from skimage import io


dir_name = "./data"
file_names = glob.glob(dir_name + "/*.tif")
stack = np.array([io.imread(file_name) for file_name in file_names])

viewer = napari.view_image(stack)
napari.run()

ポイント

連番付きの画像ファイルをnumpy配列に格納する

stack = np.array([io.imread(file_name) for file_name in file_names])
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?