Skip to content

Instantly share code, notes, and snippets.

@nikitinvv
Created May 30, 2022 23:18
Show Gist options
  • Save nikitinvv/b71b0be4487142da1afd471b94265fee to your computer and use it in GitHub Desktop.
Save nikitinvv/b71b0be4487142da1afd471b94265fee to your computer and use it in GitHub Desktop.
# open numpy array in imagej
######################################################################################
# Installation:
# 1. conda create -n pyimagej -c conda-forge pyimagej openjdk=8
# 2. conda activate pyimagej
#######################################################################################
import imagej
import numpy as np
ij = imagej.init('/home/beams/TOMO/Software/Fiji.app',mode='interactive')
ij.ui().showUI()
from jpype import JClass
WindowManager = JClass('ij.WindowManager')
a = np.random.random([5,128,128]).astype('float32')
ij.ui().show('recon', ij.py.to_dataset(a))
while True:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment