Code Monkey home page Code Monkey logo

pyimagej's Introduction

PyImageJ: Python wrapper for ImageJ2

Image.sc Forum Build Status codecov Binder

PyImageJ provides a set of wrapper functions for integration between ImageJ2 and Python. It also supports the original ImageJ API and data structures.

A major advantage of this approach is the ability to combine ImageJ and ImageJ2 with other tools available from the Python software ecosystem, including NumPy, SciPy, scikit-image, CellProfiler, OpenCV, ITK and many more.

Quick Start

Jump into the documentation and tutorials to get started!

System Requirements

Hardware Requirements

PyImageJ requires at minimum a standard computer with enough RAM and CPU performance to support the workflow operations defined by the user. While PyImageJ will run on a range of hardware, we recommend the following RAM and CPU specifications:

  • RAM: >= 2 GB (64 MB minimum)
  • CPU: >= 1 core

Notably, PyImageJ can be installed and used on server infrastructure for large scale image processing.

OS Requirements

PyImageJ has been tested on the following operating systems:

  • Linux (Ubuntu 20.04 LTS)
  • Windows
  • macOS

Software Requirements

PyImageJ requires the following packages:

PyImageJ will not function properly if dependency versions are too old.

In addition, PyImageJ requires OpenJDK and Maven to be installed.

Installation

On Mac and Linux, PyImageJ can be installed using Conda+Mamba. Here is how to create and activate a new conda environment with PyImageJ available:

conda install mamba -n base -c conda-forge
mamba create -n pyimagej -c conda-forge pyimagej openjdk=8
conda activate pyimagej

You can also pip install pyimagej, but will then need to install OpenJDK and Maven manually.

Installation time takes approximately 20 seconds. Initializing PyImageJ takes an additional ~30 seconds to ~2-3 minutes (depending on bandwidth) while it downloads and caches the needed Java libraries.

For detailed installation instructions and requirements, see Installation.

Usage

The first step when using PyImageJ is to create an ImageJ2 gateway. This gateway can point to any official release of ImageJ2 or to a local installation. Using the gateway, you have full access to the ImageJ2 API, plus utility functions for translating between Python (NumPy, xarray, pandas, etc.) and Java (ImageJ2, ImgLib2, etc.) structures.

For instructions on how to start up the gateway for various settings, see How to initialize PyImageJ.

Here is an example of opening an image using ImageJ2 and displaying it:

# Create an ImageJ2 gateway with the newest available version of ImageJ2.
import imagej
ij = imagej.init()

# Load an image.
image_url = 'https://imagej.net/images/clown.jpg'
jimage = ij.io().open(image_url)

# Convert the image from ImageJ2 to xarray, a package that adds
# labeled datasets to numpy (http://xarray.pydata.org/en/stable/).
image = ij.py.from_java(jimage)

# Display the image (backed by matplotlib).
ij.py.show(image, cmap='gray')

For more, see the tutorial notebooks.

API Reference

For a complete reference of the PyImageJ API, please see the API Reference.

Getting Help

The Scientific Community Image Forum is the best place to get general help on usage of PyImageJ, ImageJ2, and any other image processing tasks. Bugs can be reported to the PyImageJ GitHub issue tracker.

Contributing

All contributions, reports, and ideas are welcome. Contribution is done via pull requests onto the pyimagej repository.

Most development discussion takes place on the pyimagej GitHub repository. You can also reach the developers at the Image.sc Zulip chat.

For details on how to develop the PyImageJ codebase, see Development.md.


pyimagej's People

Contributors

binli123 avatar canying0913 avatar ctrueden avatar elevans avatar gselzer avatar hadim avatar hanslovsky avatar hinerm avatar imagejan avatar jan-glx avatar kant avatar kkangle avatar lnyng avatar macarse avatar mpinkert avatar oeway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyimagej's Issues

pyimagej not able to convert Views into a python format

The following script throws a segfault at result = ij.py.from_java(inverted):

import imagej
from skimage import io

ij = imagej.init()
img = io.imread('https://samples.fiji.sc/new-lenna.jpg')

inverted = ij.op().transform().invertAxisView(ij.py.to_java(img), 1)
result = ij.py.from_java(inverted)
ij.py.show(result)

From this line we know that the line above returns an IntervalView. Thus it is IntervalView that ij.py.from_java needs to know how to convert.

imagej.server no installed by conda

I recently installed pyimagej through conda, as per your instructions (in fact I installed conda for the first to do it as I mush prefer pip). I note that this installs version 0.4.0 and not the latest release.

However, when I try to access imagej.server.IJ() I seem unable to. I have tried:

import imagej
test = imagej.server.IJ()

and

import imagej
test = imagej.server().IJ()

and

import imagej.server as ijserver
test = ijserver.IJ()

All to no avail.

I then when into anaconda's tree and realised the pyimagej bins don't actually have the imagej.server file.

Is this meant to be included in the package?

Improve type coercion somehow

>>> img = io.imread('http://samples.fiji.sc/_malaria_parasites.tif')
>>> import numpy as np
>>> img = np.mean(img, axis=2)
>>> vessels = np.zeros(img.shape, dtype=img.dtype)
>>> ij.op().filter().frangiVesselness(imglyb.to_imglib(vessels), imglyb.to_imglib(img), [1, 1], 20)
<net.imglib2.RandomAccessibleInterval at 0x10b379048 jclass=net/imglib2/RandomAccessibleInterval jself=<LocalRef obj=0x7f8a3ec44e08 at 0x136257cb0>>
>>> ij.scifio().datasetIO().save(imglyb.to_imglib(vessels), 'out.png')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "jnius/jnius_export_class.pxi", line 906, in jnius.JavaMultipleMethod.__call__ (jnius/jnius.c:29616)
  File "jnius/jnius_export_class.pxi", line 632, in jnius.JavaMethod.__call__ (jnius/jnius.c:25965)
  File "jnius/jnius_conversion.pxi", line 68, in jnius.populate_args (jnius/jnius.c:8922)
  File "jnius/jnius_utils.pxi", line 207, in jnius.check_assignable_from (jnius/jnius.c:6212)
jnius.JavaException: Invalid instance of 'net/imglib2/python/ReferenceGuardingRandomAccessibleInterval' passed for a 'net/imagej/Dataset'

imagej.init() pyjnius.jar not found error in Linux

Environment

Linux Mint 19.2 64 bits
python 3.7.3 anaconda
pyimagej installation using pip in an activated virtualenv

Problem description

After installing the pyimagej package using pip in my activated virtual environment, I tried to import and initialize like in the documentation.
I got an error related to pyjnius.jar not been able to be found and being required by scyimage.jar

import imagej
ij = imagej.init('/Applications/Fiji.app')

gives the following output.

Added 394 JARs to the Java classpath.
Unable to import scyjava: pyjnius JAR not found.
Traceback (most recent call last):
  File "/home/flo/bin/anaconda/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3325, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-0f50100f883c>", line 1, in <module>
    ij = imagej.init("/home/flo/bin/Fiji.app")
  File "/home/flo/bin/anaconda/lib/python3.7/site-packages/imagej/imagej.py", line 70, in init
    import imglyb
  File "/home/flo/bin/pycharm-anaconda-2019.2.3/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/flo/bin/anaconda/lib/python3.7/site-packages/imglyb/__init__.py", line 38, in <module>
    config, _ = _init_jvm_options()
  File "/home/flo/bin/anaconda/lib/python3.7/site-packages/imglyb/__init__.py", line 33, in _init_jvm_options
    import scyjava
  File "/home/flo/bin/pycharm-anaconda-2019.2.3/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/home/flo/bin/anaconda/lib/python3.7/site-packages/scyjava/__init__.py", line 142, in <module>
    raise ImportError('Unable to import scyjava dependency jnius.')
ImportError: Unable to import scyjava dependency jnius.

Working with Plugins: WindowManager.getCurrentImage() doesn't work

Trying to use a plugin within a Python kernel Jupyter Notebook, as per the tutorial (https://nbviewer.jupyter.org/github/imagej/tutorials/blob/master/notebooks/1-Using-ImageJ/6-ImageJ-with-Python-Kernel.ipynb section 6.2).

However, my output from WindowManager.getCurrentImage() is the same both before and after running ij.py.run_plugin(). Any ideas?

My code (using pyimagej 0.4 as that's what's on conda forge):

ij = imagej.init('/home/chas/Fiji.app', headless=False)

# Load UI and send NumPy Array
ij.ui().showUI()
np_Slice = np_allChannels[26,:,:,0].copy()
ij.ui().show('Image',ij.py.to_java(np_Slice))

# Run Plugin
plugin = 'Mean'
args = { 
    'block_radius_x': 100,
    'block_radius_y': 100
}
ij.py.run_plugin(plugin, args)

# Create a window manager for interacting with the UI
windowManager = jnius.autoclass('ij.WindowManager')

# Get back data
results = ij.py.from_java(windowManager.getCurrentImage())
display(np_Slice-results)

# Display
f, axes = plt.subplots(1,2)  # Create one subplot (1x1 grid)
(aO, aM) = axes.flatten()

aO.grid(False)
aO.imshow(np_allChannels[26,:,:,0], cmap='gray', interpolation='none')

aM.grid(False)
aM.imshow(results, cmap='gray', interpolation='none')

plt.show()

My data np_allChannels is a 52x1024x1024x4 numpy array of float64 dtype.

Make it possible to spin up ImageJ without a local installation present

The imagej module could invoke jrun to download all of net.imagej:imagej, instead of relying on a user installation of ImageJ or Fiji. Then we can add an alternate API method to create a wrapped net.imagej.ImageJ instance without requiring a local installation of ImageJ or Fiji.

This is what @hanslovsky does in imglyb:

    primary_endpoint, workspace = jrun.jrun.resolve_dependencies(
        '+'.join([IMGLIB2_IMGLYB_ENDPOINT] + imglyb_config.get_endpoints()),
        cache_dir=IMGLYB_JAR_CACHE_DIR,
        m2_repo=LOCAL_MAVEN_REPO,
        repositories=imglyb_config.get_repositories(),
        verbose=2
    )
    jnius_config.add_classpath(os.path.join(workspace, '*'))

@hanslovsky wrote:

Replace imglyb_config.get_endpoints() with [endpoint1, endpoint2, ...], endpointN in the sense of jrun endpoints. In some sense, jrun is now what scyjava was supposed to be (without adding new jars at runtime, though), cf scijava/scyjava#3.

See also this discussion on forum.image.sc.

We need to make sure to fulfill the following use cases:

  1. Ability to spin up the latest release version of net.imagej:imagej.

  2. Ability to spin up an explicitly specified version of net.imagej:imagej, for reproducibility.

  3. Ability to mix in other JAR files so that your ImageJ can have desired plugins. The jrun syntax is already flexible enough for this using the + symbol; we also have components like sc.fiji:fiji that it would be nice to be able to execute directly to include all of its goodies.

importing imagej into spyder

Hello,

I am trying to import the imageJ module into python, i use spyder on Linux. once i try to import imageJ i receive this error:

ModuleNotFoundError: No module named 'jnius_config'

i thought downloading pyjnius module would solve the issue but it hasn't. I've downloaded pyimage through conda on my terminal.

what should i do to get ImageJ working? thank you

After OS Catalina Update, Invokespecial Instruction Error

I have a Python app that registers multiple images that worked prior to updating my Mac's OS to Catalina. After the update, I currently get the following error any time I try to register images or even make an image stack.

java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    ij/gui/GenericDialog.show()V @1: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0x0000000: 2ab7 0311 2ab4 0314 9a00 0c13 0316 1303
    0x0000010: 18b8 031b b1
  Stackmap Table:
    same_frame(@20)

	at SIFT_ExtractPointRoi.run(SIFT_ExtractPointRoi.java:141)
	at ij.IJ.runUserPlugIn(IJ.java:231)
	at ij.IJ.runPlugIn(IJ.java:194)
	at ij.Executer.runCommand(Executer.java:148)
	at ij.Executer.run(Executer.java:66)
	at ij.IJ.run(IJ.java:313)
	at ij.IJ.run(IJ.java:324)
	at ij.macro.Functions.doRun(Functions.java:625)
	at ij.macro.Functions.doFunction(Functions.java:97)
	at ij.macro.Interpreter.doStatement(Interpreter.java:275)
	at ij.macro.Interpreter.doStatements(Interpreter.java:261)
	at ij.macro.Interpreter.run(Interpreter.java:157)
	at ij.macro.Interpreter.run(Interpreter.java:91)
	at ij.macro.Interpreter.run(Interpreter.java:102)
	at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
	at ij.IJ.runMacro(IJ.java:149)
	at ij.IJ.runMacro(IJ.java:138)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1108)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1104)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1055)
	at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1104)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:147)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:228)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I reinstalled JDK8 on my computer as I was originally having an issue that was mentioned here about the Java Runtime Error https://github.com/kivy/pyjnius/pull/441/commits/9700c47cd44ba51b55c593d42a21c0b110ed3deb error. I resolved that by pip installing the latest commit of PyJNIus into my conda environment where pyimagej is located. Opening images and a few other basic commands seems to work ok, but others do not. Here is the contents of the .yaml file of my current conda environment that opens my app but fails when Fiji tries to run anything more than opening images.

name: pyimagej_app
channels:
  - conda-forge
  - defaults
dependencies:
  - appnope=0.1.0=py37_1000
  - asn1crypto=1.2.0=py37_0
  - attrs=19.3.0=py_0
  - backcall=0.1.0=py_0
  - bleach=3.1.0=py_0
  - blosc=1.17.0=h6de7cb9_1
  - bokeh=1.4.0=py37_0
  - bzip2=1.0.8=h01d97ff_1
  - ca-certificates=2019.9.11=hecc5488_0
  - certifi=2019.9.11=py37_0
  - cffi=1.13.2=py37h33e799b_0
  - chardet=3.0.4=py37_1003
  - click=7.0=py_0
  - cloudpickle=1.2.2=py_0
  - cryptography=2.5=py37hdbc3d79_1
  - curl=7.63.0=heae2a1f_1000
  - cycler=0.10.0=py_2
  - cytoolz=0.10.1=py37h0b31af3_0
  - dask=2.8.0=py_1
  - dask-core=2.8.0=py_0
  - dbus=1.13.6=h2f22bb5_0
  - decorator=4.4.1=py_0
  - defusedxml=0.6.0=py_0
  - dill=0.3.1.1=py37_0
  - distributed=2.8.0=py_1
  - entrypoints=0.3=py37_1000
  - expat=2.2.5=h4a8c4bd_1004
  - fastcache=1.1.0=py37h0b31af3_0
  - freetype=2.10.0=h24853df_1
  - fsspec=0.6.0=py_0
  - gettext=0.19.8.1=h46ab8bc_1002
  - git=2.19.1=pl526h28b1069_1001
  - glib=2.58.3=py37h577aef8_1002
  - gmp=6.1.2=h0a44026_1000
  - gmpy2=2.1.0b1=py37h4160ff4_0
  - h5py=2.10.0=nompi_py37h106b333_100
  - hdf5=1.10.5=nompi_h3e39495_1104
  - heapdict=1.0.1=py_0
  - hyperspy=1.5.2=py37_0
  - hyperspy-base=1.5.2=py37h01d97ff_0
  - hyperspy-gui-ipywidgets=1.2=py_2
  - hyperspy-gui-traitsui=1.2=py_0
  - icu=58.2=h0a44026_1000
  - idna=2.8=py37_1000
  - imageio=2.6.1=py37_0
  - imglyb=0.3.5=py37h5ca1d4c_0
  - importlib_metadata=0.23=py37_0
  - ipykernel=5.1.3=py37h5ca1d4c_0
  - ipyparallel=6.2.4=py37_0
  - ipython=7.9.0=py37h5ca1d4c_0
  - ipython_genutils=0.2.0=py_1
  - ipywidgets=7.5.1=py_0
  - jedi=0.15.1=py37_0
  - jgo=0.5.0=py37_0
  - jinja2=2.10.3=py_0
  - joblib=0.14.0=py_0
  - jpeg=9c=h1de35cc_1001
  - json5=0.8.5=py_0
  - jsonschema=3.1.1=py37_0
  - jupyter=1.0.0=py_2
  - jupyter_client=5.3.3=py37_1
  - jupyter_console=6.0.0=py_0
  - jupyter_core=4.5.0=py_0
  - jupyterlab=1.2.3=py_0
  - jupyterlab_server=1.0.6=py_0
  - kiwisolver=1.1.0=py37ha1b3eb9_0
  - krb5=1.16.2=h24a3359_1000
  - libblas=3.8.0=14_openblas
  - libcblas=3.8.0=14_openblas
  - libcurl=7.63.0=h76de61e_1000
  - libcxx=9.0.0=h89e68fa_1
  - libedit=3.1.20170329=hcfe32e1_1001
  - libffi=3.2.1=h6de7cb9_1006
  - libgfortran=4.0.0=2
  - libiconv=1.15=h01d97ff_1005
  - liblapack=3.8.0=14_openblas
  - libllvm8=8.0.1=h770b8ee_0
  - libopenblas=0.3.7=h4bb4525_3
  - libpng=1.6.37=h2573ce8_0
  - libsodium=1.0.17=h01d97ff_0
  - libssh2=1.8.0=hf30b1f0_1003
  - libtiff=4.1.0=ha78913b_1
  - link-traits=1.0.2=py37_1002
  - llvm-openmp=9.0.0=h40edb58_0
  - llvmlite=0.30.0=py37h05045ef_1
  - locket=0.2.0=py_2
  - lz4-c=1.8.3=h6de7cb9_1001
  - markupsafe=1.1.1=py37h0b31af3_0
  - matplotlib=3.1.1=py37_2
  - matplotlib-base=3.1.1=py37h11da6c2_2
  - maven=3.6.0=0
  - mistune=0.8.4=py37h0b31af3_1000
  - more-itertools=7.2.0=py_0
  - mpc=1.1.0=h4160ff4_1006
  - mpfr=4.0.2=h44b798e_0
  - mpmath=1.1.0=py_0
  - mrcz=0.5.3=py37_0
  - msgpack-python=0.6.2=py37ha1b3eb9_0
  - natsort=6.2.0=py_0
  - nbconvert=5.6.1=py37_0
  - nbformat=4.4.0=py_1
  - ncurses=6.1=h0a44026_1002
  - networkx=2.4=py_0
  - nodejs=12.4.0=h6de7cb9_0
  - notebook=6.0.1=py37_0
  - numba=0.46.0=py37h4f17bb1_1
  - numexpr=2.7.0=py37h4f17bb1_0
  - numpy=1.17.2=py37h6b0580a_0
  - olefile=0.46=py_0
  - openjdk=8.0.192=h1de35cc_1003
  - openssl=1.0.2t=h1de35cc_0
  - packaging=19.2=py_0
  - pandas=0.25.3=py37h4f17bb1_0
  - pandoc=2.7.3=0
  - pandocfilters=1.4.2=py_1
  - parso=0.5.1=py_0
  - partd=1.0.0=py_0
  - patsy=0.5.1=py_0
  - pcre=8.43=h4a8c4bd_0
  - perl=5.26.2=haec8ef5_1006
  - pexpect=4.7.0=py37_0
  - pickleshare=0.7.5=py37_1000
  - pillow=5.3.0=py37hbddbef0_1000
  - pint=0.9=py37_2
  - pip=19.3.1=py37_0
  - prometheus_client=0.7.1=py_0
  - prompt_toolkit=2.0.10=py_0
  - psutil=5.6.5=py37h0b31af3_0
  - ptable=0.9.2=py_0
  - ptyprocess=0.6.0=py_1001
  - pycparser=2.19=py37_1
  - pyface=6.1.2=py_0
  - pygments=2.4.2=py_0
  - pyopenssl=19.0.0=py37_0
  - pyparsing=2.4.5=py_0
  - pyqt=5.9.2=py37h2a560b1_4
  - pyrsistent=0.15.5=py37h0b31af3_0
  - pysocks=1.7.1=py37_0
  - python=3.7.1=h145921a_1000
  - python-blosc=1.8.1=py37h0a44026_0
  - python-dateutil=2.8.1=py_0
  - pytz=2019.3=py_0
  - pywavelets=1.1.1=py37h3b54f70_0
  - pyyaml=5.1.2=py37h0b31af3_0
  - pyzmq=18.1.1=py37h4bf09a9_0
  - qt=5.9.7=h93ee506_2
  - qtconsole=4.5.5=py_0
  - readline=7.0=hcfe32e1_1001
  - requests=2.22.0=py37_1
  - scikit-image=0.15.0=py37h86efe34_2
  - scikit-learn=0.21.3=py37hd4ffd6c_0
  - scipy=1.3.2=py37h82752d6_0
  - scyjava=0.4.0=py37_0
  - send2trash=1.5.0=py_0
  - setuptools=41.6.0=py37_1
  - sip=4.19.8=py37h0a44026_1000
  - six=1.13.0=py37_0
  - sortedcontainers=2.1.0=py_0
  - sparse=0.8.0=py_0
  - sqlite=3.28.0=h9721f7c_0
  - statsmodels=0.10.1=py37h3b54f70_2
  - sympy=1.4=py37_0
  - tblib=1.4.0=py_0
  - terminado=0.8.3=py37_0
  - testpath=0.4.4=py_0
  - tk=8.6.8=ha441bb4_1000
  - toolz=0.10.0=py_0
  - tornado=6.0.3=py37h0b31af3_0
  - tqdm=4.38.0=py_0
  - traitlets=4.3.3=py37_0
  - traits=5.1.2=py37h0b31af3_1
  - traitsui=6.1.3=py_0
  - urllib3=1.25.7=py37_0
  - wcwidth=0.1.7=py_1
  - webencodings=0.5.1=py_1
  - wheel=0.33.6=py37_0
  - widgetsnbextension=3.5.1=py37_0
  - xz=5.2.4=h1de35cc_1001
  - yaml=0.1.7=h1de35cc_1001
  - zeromq=4.3.2=h6de7cb9_2
  - zict=1.0.0=py_0
  - zipp=0.6.0=py_0
  - zlib=1.2.11=h0b31af3_1006
  - zstd=1.4.4=he7fca8b_1
  - pip:
    - cython==0.29.14
    - opencv-python==4.1.1.26
    - pyimagej==0.5.0
    - pyjnius==1.2.1.dev0
    - pysimplegui==4.6.0

Thank you for any help

Make ij.py.show better

As discussed on the Image.sc Forum, we want ij.py.show to do a reasonable thing as conveniently as possible, while also supporting passing in hints for how best to render. Considerations:

  1. No extra dependencies. We can use matplotlib or pillow or whatever to do the rendering, but we don't want to require any of those as hard dependencies because not everyone wants to use the show function. It would be nice to have a reasonable series of fallbacks for default behavior that checks whether various supported libraries are available.

  2. Ability to pass arguments stating A) which renderer to preferentially use if available, and B) optionally, "hints" parameters for that renderer. We can use kwargs, with each supported viz backend looking for its own key/value argument pairs.

Installation instructions incomplete & example code misleading

Dear all,

I was just struggling to get started with pyimagej on Windows. I'm documenting the issue here hoping that the documentation can be improved in order to lower the entry-level boundary. Details can be found here

  • The installation instructions are incomplete. Either it is necessary to create an environment variable JAVA_HOME or it is necessary to install maven before the first pyimagej program runs.

  • The very first example located here doesn't work as expected. I would recommend changing it something like:

import imagej
ij = imagej.init('2.0.0-rc-68')
print(ij.getVersion())
  • Furthermore (sorry for iterating on this): Would it be possible to have first a code example which does something like: Thresholding blobs.gif, counting cells and measuring their size? I would love to see how to play with ImageJ images and ROIs using ImageJ-methods called from python before complicated mixtures of numpy-ImageJ-conversions are introduced. Showing the people first how to do complicated conversion might again be deterrent. Having simple image-analysis instead of examples like the following would be super helpful for people getting started:
    image

I hope that helps!

Cheers,
Robert

RealCursor confusion

from skimage import io
from jnius import autoclass

BitType = autoclass('net.imglib2.type.logic.BitType')
Views = autoclass('net.imglib2.view.Views')

img = io.imread('https://imagej.net/images/blobs.gif')
imgj = ij.py.to_java(img)
bw = ij.op().run('create.img', imgj, BitType())

cur = Views.flatIterable(imgj).cursor()
rac = bw.randomAccess()
while cur.hasNext():
    cur.fwd()
    rac.setPosition(cur)

throws:

---------------------------------------------------------------------------
JavaException                             Traceback (most recent call last)
<ipython-input-9-256892e4c758> in <module>
     13 while cur.hasNext():
     14     cur.fwd()
---> 15     rac.setPosition(cur)

jnius/jnius_export_class.pxi in jnius.JavaMultipleMethod.__call__()

jnius/jnius_export_class.pxi in jnius.JavaMethod.__call__()

jnius/jnius_conversion.pxi in jnius.populate_args()

jnius/jnius_utils.pxi in jnius.check_assignable_from()

JavaException: Invalid instance of 'net/imglib2/RealCursor' passed for a 'net/imglib2/Localizable'

But trying to get a (integer) cursor

Views.raster(imgj)

... will cause:

---------------------------------------------------------------------------
JavaException                             Traceback (most recent call last)
<ipython-input-10-ddced3e14dcc> in <module>
----> 1 Views.raster(imgj)
      2 
      3 
      4 

jnius/jnius_export_class.pxi in jnius.JavaMethod.__call__()

jnius/jnius_conversion.pxi in jnius.populate_args()

jnius/jnius_utils.pxi in jnius.check_assignable_from()

JavaException: Invalid instance of 'net/imglib2/python/ReferenceGuardingRandomAccessibleInterval' passed for a 'net/imglib2/RealRandomAccessible'

so the cursors do not seem to behave in the expected way.

pyimagej initialization interferes with python multiprocessing

I am trying to parallelize a python program that uses pyimagej for stitching of images. For this purpose, I'm using python multiprocessing. When imagej is initialized within the process, it interferes with the process terminating normally. Here is a simple example:

import imagej
from multiprocessing import Pool

def f(x):
    ij = imagej.init('/Applications/Fiji.app')
    print(x)

with Pool(processes=2) as pool:
    for i in range(10):
        pool.apply_async(f, args=(i,))

    pool.close()
    pool.join()

When the imagej initialization is commented out, this script prints:

0
1
2
3
4
5
6
7
8
9

Process finished with exit code 0

When the imagej initialization is not commented out, it prints:

Added 379 JARs to the Java classpath.
Added 379 JARs to the Java classpath.
0
1

Process finished with exit code 0

For a reason I don't understand, the imagej initialization leads to the process terminating with exit code 0 after running just one round per process (2 instead of 10 total).

Any idea what is causing this? Looking at the pyimagej api, there does not seem to be a way to turn off the VM from pyimagej once it is initialized. This would be very helpful to allow for parallelization of workflows via multiprocessing.

If imagej is initialized outside of the function being run, then it does not lead to this behavior. But it constantly grows in memory usage. Therefore, it would be great to be able to initialize per process and have the whole process, together with all the pyimagej memory usage, shut down again at the end.

PS:
Also, this is tangentially related to the discussion here in the image.sc forum, but I thought this issue is specific and low-level enough to be a github issue and not a forum discussion. If you prefer to have those posts there, let me know, I'm happy to post it in the forum.

Cannot invoke ImageJ1 plugins with Maven-based initialization

As noted in #35 (comment), if you initialize an ImageJ gateway that includes ImageJ1 plugin artifacts on the classpath, for example a standard Fiji installation as follows...

ij = imagej.init('sc.fiji:fiji:2.0.0-pre-10')

...then it is not possible to invoke the ImageJ1 plugins via ij.py.run_plugin. You'll see an error similar to:

Unrecognized command: "Grid/Collection stitching"

This is because ImageJ1 needs a system property plugins.dir set to a local file path containing all the plugin JARs. ImageJ1 cannot run plugins present on the classpath but not present in a single folder pointed at by this system property.

It is likely possible to work around this limitation. For example, one solution might be to use the ij1.plugin.dirs property, added by ImageJ2's ij1-patcher integration layer, setting it to match directories above all entries of java.class.path, so that all JARs present on the classpath are also available to ImageJ1. But I have not tried doing this yet. So I do not know if it work, and if so, what the performance implications would be.

Cannot initialize pyimagej on Linux

After import imagej, the ij = imagej.init() command results in the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/imagej/imagej.py", line 126, in init
    import imglyb
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/imglyb/__init__.py", line 38, in <module>
    config = _init_jvm_options()
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/imglyb/__init__.py", line 33, in _init_jvm_options
    import scyjava
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/scyjava/__init__.py", line 140, in <module>
    jnius = _init_jvm()
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/scyjava/__init__.py", line 131, in _init_jvm
    import jnius
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/jnius/__init__.py", line 42, in <module>
    from .reflect import *  # noqa
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/jnius/reflect.py", line 17, in <module>
    class Class(with_metaclass(MetaJavaClass, JavaClass)):
  File "/home/zoltan/anaconda3/envs/imagej/lib/python3.7/site-packages/six.py", line 856, in __new__
    return meta(name, resolved_bases, d)
  File "jnius/jnius_export_class.pxi", line 114, in jnius.MetaJavaClass.__new__
  File "jnius/jnius_export_class.pxi", line 164, in jnius.MetaJavaClass.resolve_class
  File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv
  File "jnius/jnius_jvm_dlopen.pxi", line 118, in jnius.get_platform_jnienv
  File "jnius/jnius_jvm_dlopen.pxi", line 87, in jnius.create_jnienv
SystemError: Error calling dlopen(b'/home/zoltan/anaconda3/envs/imagej/lib/server/libjvm.so': b'/home/zoltan/anaconda3/envs/imagej/lib/server/libjvm.so: cannot open shared object file: No such file or directory'

java --version prints:

openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)

The error holds even though I installed pyimagej with conda create -n pyimagej pyimagej openjdk=8.

Improve installation instructions?

Hey @ctrueden ,

I'm just installing pyimagej on ubuntu 18.04 and this time, I read the right installation instructions
from here:

conda config --add channels conda-forge 
conda install pyimagej openjdk=8

Together with your suggestion from here it works nicely:

conda create -n imagej pyimagej openjdk=8
conda activate imagej

Furthermore, to make some of the examples run, it is necessary to install sk-image:

conda install scikit-image

Wouldn't it make sense to put these lines together in the readme or in a dedicated installation script?

I hope that helps!

Cheers,
Robert

Issue converting ImagePlus into numpy image.

I'm running pyimagej with my local copy of Fiji with pyimagej version 0.5.0 and ImageJ version 2.0.0-rc-69/1.52p. I'm in UI mode (not headless).

When I try run WindowManager.getCurrentImage(), I get the java object fine but when I run ij.py.from_java I get: "Attribute Error: 'net.imagej.ops.OpService' object has no attribute 'run'."

Can't Find Stats Attribute

I'm using pyimagej on Ubuntu 18.04 in a conda environment with Python 3.6 and a system running OpenJDK 11.

This is part of the script I'm running trying to reproduce someone's work:

ij = imagej.init()
img = io.imread(filename1)
fiji_image = rgb2gray(img)
number = ij.op().stats().mean(fiji_image)

And it's throwing this error on the last line:

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Traceback (most recent call last):
  File "od-calc.py", line 50, in <module>
    number = ij.op().stats().mean(fiji_image)
AttributeError: 'net.imagej.ops.OpService' object has no attribute 'stats'

Checking the documentation the location of the stats module is correct. What could be the problem?

ij.py.run_macro() failing with java.lang.NullPointerException

When I try to run a script version of the run_macro example from the Jupyter notebook it is failing.

The script:

import imagej
ij = imagej.init()
print(ij.getVersion())

macro = """
#@ String name
#@ int age
#@ String city
#@output Object greeting
greeting = "Hello " + name + ". You are " + age + " years old, and live in " + city + "."
"""
args = {
    'name': 'Chuckles',
    'age': 13,
    'city': 'Nowhere'
}
result = ij.py.run_macro(macro, args)
print(result.getOutput('greeting'))

The error message:

(pyimagej_conda) hb ~/Code/temp$ python ij_macro.py 
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2.0.0-rc-71
[ERROR] Module threw exception
java.lang.NullPointerException
	at org.scijava.script.ScriptModule.getEngine(ScriptModule.java:108)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:129)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Traceback (most recent call last):
  File "ij_macro.py", line 17, in <module>
    result = ij.py.run_macro(macro, args)
  File "/home/hbabcock/miniconda3/envs/pyimagej_conda/lib/python3.7/site-packages/imagej/imagej.py", line 201, in run_macro
    raise exc
  File "/home/hbabcock/miniconda3/envs/pyimagej_conda/lib/python3.7/site-packages/imagej/imagej.py", line 198, in run_macro
    return self._ij.script().run("macro.ijm", macro, True, to_java(args)).get()
  File "jnius/jnius_export_class.pxi", line 1044, in jnius.JavaMultipleMethod.__call__
  File "jnius/jnius_export_class.pxi", line 766, in jnius.JavaMethod.__call__
  File "jnius/jnius_export_class.pxi", line 843, in jnius.JavaMethod.call_method
  File "jnius/jnius_utils.pxi", line 91, in jnius.check_exception
jnius.JavaException: JVM exception occurred: java.lang.NullPointerException

This is with pyimagej 0.5.0, pyjnius 1.2.0 and conda 4.7.12 on Ubuntu 18.04.

conda create -n pyimagej_conda pyimagej pyjnius=1.2.0 openjdk=8 scikit-image requests

Problem with MVN after installing on Windows

I try your sample code:

import imagej
ij = imagej.init('D:\\Fiji.app')

But I get the following error:

Added 370 JARs to the Java classpath.
---------------------------------------------------------------------------
ExecutableNotFound                        Traceback (most recent call last)
<ipython-input-4-27b35f8f1453> in <module>
     19 
     20 import imagej
---> 21 ij = imagej.init('D:\\Fiji.app')

~\Anaconda3\envs\noah\lib\site-packages\imagej\imagej.py in init(ij_dir)
     68     num_jars = set_ij_env(ij_dir)
     69     print("Added " + str(num_jars + 1) + " JARs to the Java classpath.")
---> 70     import imglyb
     71     from jnius import autoclass
     72     ImageJ = autoclass('net.imagej.ImageJ')

~\Anaconda3\envs\noah\lib\site-packages\imglyb\__init__.py in <module>
     73 
     74 
---> 75 config = _init_jvm_options()
     76 
     77 if sys.version_info[0] < 3:

~\Anaconda3\envs\noah\lib\site-packages\imglyb\__init__.py in _init_jvm_options()
     61         m2_repo=LOCAL_MAVEN_REPO,
     62         repositories=imglyb_config.get_repositories(),
---> 63         verbose=2
     64     )
     65     jnius_config.add_classpath(os.path.join(workspace, '*'))

~\Anaconda3\envs\noah\lib\site-packages\jrun\jrun.py in resolve_dependencies(endpoint_string, cache_dir, m2_repo, update_cache, force_update, manage_dependencies, repositories, shortcuts, verbose)
    409 
    410     try:
--> 411         mvn     = executable_path_or_raise('mvn')
    412         mvn_out = run_and_combine_outputs(mvn, *mvn_args)
    413     except subprocess.CalledProcessError as e:

~\Anaconda3\envs\noah\lib\site-packages\jrun\jrun.py in executable_path_or_raise(tool)
    141     path = executable_path(tool)
    142     if path is None:
--> 143         raise ExecutableNotFound(tool, os.getenv('PATH'))
    144     return path
    145 

ExecutableNotFound: mvn not found on path 

Add imagej launch script

We can add:

    entry_points={
        'console_scripts': [
            'imagej=imagej.imagej:imagej_main'
        ]
    },

to the setup.py.

However, to do this, we need to implement imagej_main. Will need to think a little what this function does. Probably just jgo net.imagej:imagej at latest release version. But it would be nice if it had the ability to override which version of ImageJ is used, point to a local installation, etc.

Initialize pyimagej not working on Windows

Hello i am quite new to coding.
I try to call a Fiji ImageJ (1.52n) Macro out of my Python (2.7.16) code using pyimagej.
While initializing (ij = imagej.init()) i got this error:

ERROR 2019-07-05 13:38:03,541: Unable to import scyjava: PYJNIUS_JAR environment variable not defined. Traceback (most recent call last): File "Compare_tsv_05_07_2019.py", line 9, in <module> ij = imagej.init() File "C:\ProgramData\Anaconda3\lib\site-packages\imagej\imagej.py", line 104, in init import imglyb File "C:\ProgramData\Anaconda3\lib\site-packages\imglyb\__init__.py", line 41, in <module> config, _ = _init_jvm_options() File "C:\ProgramData\Anaconda3\lib\site-packages\imglyb\__init__.py", line 36, in _init_jvm_options import scyjava File "C:\ProgramData\Anaconda3\lib\site-packages\scyjava\__init__.py", line 57, in <module> raise ImportError('Unable to import scyjava dependency jnius.') ImportError: Unable to import scyjava dependency jnius.

I dont have a clue how to interpret or solve this problem. Any solutions or explanations for me?
Thanks a lot

Make `imagej.init()` more resilient

At the moment when you call twice imagej.init() in a notebook (it often happens that I run all the cells from start without restarting the kernel), you get the following error:

ValueError: VM is already running, can't set options

Don't you think we should be able to call it twice without having Python throwing an error about it? It will silently fail. Maybe we could add a Python warning import warnings instead of raising an error.

Class Not Found

I'm using pyimagej on Ubuntu 18.04 running OpenJDK 11 in a conda environment. I had it working before but now its throwing a class error after some upgrades:

  • Python 3.6 -> Python 3.7
  • conda 4.? -> conda 4.8.2

Now when I run this:

import imagej
ij = imagei.init()

I get this error:

$ python processing-pipeline.py
Traceback (most recent call last):
  File "processing-pipeline.py", line 25, in <module>
    ij = imagej.init()
  File "/home/gordon/miniconda3/envs/vader/lib/python3.7/site-packages/imagej/imagej.py", line 104, in init
    import imglyb
  File "/home/gordon/miniconda3/envs/vader/lib/python3.7/site-packages/imglyb/__init__.py", line 41, in <module>
    from .ndarray_like_as_img import \
  File "/home/gordon/miniconda3/envs/vader/lib/python3.7/site-packages/imglyb/ndarray_like_as_img.py", line 5, in <module>
    from . import accesses
  File "/home/gordon/miniconda3/envs/vader/lib/python3.7/site-packages/imglyb/accesses.py", line 5, in <module>
    Accesses            = autoclass('net.imglib2.img.basictypeaccess.Accesses')
  File "/home/gordon/miniconda3/envs/vader/lib/python3.7/site-packages/jnius/reflect.py", line 159, in autoclass
    c = find_javaclass(clsname)
  File "jnius/jnius_export_func.pxi", line 26, in jnius.find_javaclass
jnius.JavaException: Class not found b'net/imglib2/img/basictypeaccess/Accesses'

I tried conda update pyimagej but I got the same error.

Redirecting stdout of Fiji plugins

Is there a way to redirect the stdout of a Fiji plugin? I'm using the 'Grid/Collection stitching' plugin and want to get the parameters of the transformation out. They are printed when the plugin is run in the following way:

ij = imagej.init('/Applications/Fiji.app')
plugin = 'Grid/Collection stitching'
            args = {'type': '[Filename defined position]', 'order': '[Defined by filename         ]',
                    'grid_size_x': '3', 'grid_size_y': '3', 'tile_overlap': '8', 'first_file_index_x': str(index_x),
                    'first_file_index_y': str(index_y), 'directory': img_path,
                    'file_names': 'Tile_{yyy}-{xxx}-000000_0-000.tif', 'output_textfile_name': 'TileConfiguration.txt',
                    'fusion_method': '[Intensity of random input tile]', 'regression_threshold': '0.15',
                    'max/avg_displacement_threshold': '0.20', 'absolute_displacement_threshold': '0.30',
                    'compute_overlap': True, 'computation_parameters': '[Save memory (but be slower)]',
                    'image_output': '[Write to disk]'}
ij.py.run_plugin(plugin, args)

Example excerpt from the print:

Finished registration process (12645 ms).
Tile_002-010-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]) 0.0
Tile_002-011-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 3744.0], [0.0, 1.0, 136.0]]) 0.0
Tile_002-012-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 7398.0], [0.0, 1.0, 265.0]]) 0.0
Tile_003-010-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, -20.0], [0.0, 1.0, 4087.0]]) 0.0
Tile_003-011-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 3718.0000000000005], [0.0, 1.0, 4210.0]]) 4.482534314920437E-26
Tile_003-012-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 7373.0], [0.0, 1.0, 4257.0]]) 0.0
Tile_004-010-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, -91.99999999999955], [0.0, 1.0, 7808.0]]) 0.0
Tile_004-011-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 3655.0], [0.0, 1.0, 7914.0]]) 0.0
Tile_004-012-000000_0-000.tif: [3,3](AffineTransform[[1.0, 0.0, 7329.0], [0.0, 1.0, 8025.0]]) 2.0679515313825692E-25
Writing registered TileConfiguration: [REDACTED]
Fuse & Write to disk (into directory [REDACTED]
Finished fusion (26801 ms)

I need to get the details after the AffineTransform. I have tried standard python stdout redirecting, but that does not catch the stdout of ImageJ. It is still printed and the f variable that is supposed to catch the print info is empty.

ij = imagej.init('/Applications/Fiji.app')
plugin = 'Grid/Collection stitching'
f = io.StringIO()
with contextlib.redirect_stdout(f):
    ij.py.run_plugin(plugin, args)

stitching_output = f.getvalue()
print('Catching Fiji print:')
print(stitching_output)
ij.py.run_plugin(plugin, args)

I have read that redirecting stdout of code of a different language is more complicated, see example here for C code being run in python: https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/

How is the Java stdout handled and sent to python? Does anyone have an idea how I could redirect that to a variable in python? Or any other approach to catch this information from the plugin?

Find a better workaround for macOS access to OpenJDK

When running imagej.init on a macOS system without Apple Java 6 installed, an error is given when attempting to load Java via JNI:

No Java runtime present, requesting install.

And a dialog box appears saying "You need to install the legacy Java SE 6 runtime." Unfortunately, this is no longer possible on current versions of macOS.

A workaround is to edit the Info.plist of your Java installation to include <string>JNI</string> in the capabilities, as described at kivy/pyjnius#277 (comment). However, there is no guidance to do this. And it would be better if we could automagically make things work without requiring the user to perform an administrator-level action.

Log more output (stdout/stderr/etc.?) in a better way

In a Jupyter notebook, the following cell:

IJ = autoclass('ij.IJ')
noise = IJ.createImage("Noise", "32-bit noise", 400, 234, 1)
IJ.run(noise, "Kuwahara Filter", "sampling=5")

Emits the following output on the terminal:

"Kuwahara Filter" requires an image of type:

	8-bit grayscale
	8-bit color
	16-bit grayscale
	RGB color

The question is: why does the Jupyter notebook not pick up on this output, and display it below the cell? And how can we make it do so?

Potential performance improvement of rai_to_numpy

Hi all,

I recently received an issue report from a user who experienced slow performance of the rai_to_numpy method. I was able to trace it down to this line which copies content of an RAI to another RAI:

self._ij.op().run("copy.rai", self.to_java(result), rai)

I implemented a workaround which does that copy operation straight forward:

Cursor<RealType> cursor = Views.iterable(rai).cursor();
Cursor<RealType> target_cursor = Views.iterable(target).cursor();

while(cursor.hasNext() && target_cursor.hasNext()) {
    target_cursor.next().set(cursor.next());
}

Would it be possible to implement something similar in pyimagej? IMHO performance is key when sending images between python and imagej universes....

Cheers,
Robert

Installation issue Windows

Hi all,

I'm having issues in getting pyimagej to run on a windows machine (on others it works). That's the code I run from a notebook:

import numpy as np
import skimage
import skimage.io
import matplotlib.pyplot as plt

import imagej
ij = imagej.init('c:/programs/fiji-win64/Fiji_clij.app/')
ij.getVersion()

And that's the error:

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-1-7a1c26643a35> in <module>
      5 
      6 import imagej
----> 7 ij = imagej.init('c:/programs/fiji-win64/Fiji_clij.app/')
      8 ij.getVersion()
      9 

~\.conda\envs\imagej\lib\site-packages\imagej\imagej.py in init(ij_dir_or_version_or_endpoint, headless)
    102 
    103     # Must import imglyb (not scyjava) to spin up the JVM now.
--> 104     import imglyb
    105     from jnius import autoclass
    106 

~\.conda\envs\imagej\lib\site-packages\imglyb\__init__.py in <module>
     36 
     37 
---> 38 config, _ = _init_jvm_options()
     39 
     40 from .imglib_ndarray import ImgLibReferenceGuard as _ImgLibReferenceGuard

~\.conda\envs\imagej\lib\site-packages\imglyb\__init__.py in _init_jvm_options()
     31     scyjava_config.add_endpoints(IMGLIB2_IMGLYB_ENDPOINT)
     32 
---> 33     import scyjava
     34 
     35     return jnius_config, scyjava

~\.conda\envs\imagej\lib\site-packages\scyjava\__init__.py in <module>
    120         return None
    121 
--> 122 jnius = _init_jvm()
    123 if jnius is None:
    124     raise ImportError('Unable to import scyjava dependency jnius.')

~\.conda\envs\imagej\lib\site-packages\scyjava\__init__.py in _init_jvm()
    106             cache_dir=scyjava_config.get_cache_dir(),
    107             repositories=repositories,
--> 108             verbose=scyjava_config.get_verbose()
    109         )
    110         jnius_config.add_classpath(os.path.join(workspace, '*'))

~\.conda\envs\imagej\lib\site-packages\jgo\jgo.py in resolve_dependencies(endpoint_string, cache_dir, m2_repo, link_type, update_cache, force_update, manage_dependencies, repositories, shortcuts, verbose)
    456         _logger.info("* Try with an explicit version number (release metadata might be wrong).")
    457         print()
--> 458         raise e
    459 
    460 

~\.conda\envs\imagej\lib\site-packages\jgo\jgo.py in resolve_dependencies(endpoint_string, cache_dir, m2_repo, link_type, update_cache, force_update, manage_dependencies, repositories, shortcuts, verbose)
    447     try:
    448         mvn     = executable_path_or_raise('mvn')
--> 449         mvn_out = run_and_combine_outputs(mvn, *mvn_args)
    450     except subprocess.CalledProcessError as e:
    451         _logger.info("Failed to bootstrap the artifact.")

~\.conda\envs\imagej\lib\site-packages\jgo\jgo.py in run_and_combine_outputs(command, *args)
    198 
    199 def run_and_combine_outputs(command, *args):
--> 200     return subprocess.check_output((command,) + args, stderr=subprocess.STDOUT)
    201 
    202 

~\.conda\envs\imagej\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
    393 
    394     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 395                **kwargs).stdout
    396 
    397 

~\.conda\envs\imagej\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    485         if check and retcode:
    486             raise CalledProcessError(retcode, process.args,
--> 487                                      output=stdout, stderr=stderr)
    488     return CompletedProcess(process.args, retcode, stdout, stderr)
    489 

CalledProcessError: Command '('C:\\Users\\rhaase\\.conda\\envs\\pyimagej\\Library\\bin\\mvn.CMD', '-B', '-f', 'C:/programs/fiji-win64/Fiji_clij.app/RELEASE+net.imglib-imglib2-imglyb-0.3.0\\pom.xml', 'dependency:resolve')' returned non-zero exit status 1.

I have issues reading the error message. Did I miss installing something?

Thanks for your support!

Cheers,
Robert

CLASSPATH setup not working properly on Windows 10 (Python 3.6)

When trying to use ImageJ in Python (on Windows) using the following code:
import imagej
ij = imagej.init('C:/(path to fiji)/fiji-win64/Fiji.app')

I kept getting the following error:
jnius.JavaException: Class not found b'net/imagej/ImageJ'

I ended up scratching and realized that my jars were not being added properly to the classpath.

The root of the problem was line 55 in imagej.py
https://github.com/imagej/imagej.py/blob/f7dd08ac6e237c34b0bbf07b5795d08bf62a9f4d/imagej/imagej.py#L55

After changing the colon : to a semi-colon ; like this: jnius_config.add_classpath(";".join(jars)) everything worked perfectly.

I realize this is a Windows specific error, but maybe have a simple conditional that checks the operating system.

Error converting Java image back to Python

Noticed by @thewtex.

$ python
Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 15:43:19)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import imagej
>>> ij = imagej.init()
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
>>> ij.getVersion()
'2.0.0-rc-71'
>>> import numpy as np
>>> z = np.zeros([5, 7])
>>> jz = ij.py.to_java(z)
>>> jz
<net/imglib2/python/ReferenceGuardingRandomAccessibleInterval at 0x1359e6f68 jclass=net/imglib2/python/ReferenceGuardingRandomAccessibleInterval jself=<LocalRef obj=0x7fd9c27362a0 at 0x10cb19e70>>
>>> ij.py.from_java(jz)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/miniconda3/envs/scijava/lib/python3.7/site-packages/imagej/imagej.py", line 225, in from_java
    return self.rai_to_numpy(rai)
  File "/usr/local/miniconda3/envs/scijava/lib/python3.7/site-packages/imagej/imagej.py", line 152, in rai_to_numpy
    self._ij.op().run("copy.rai", self.to_java(result), rai)
  File "jnius/jnius_export_class.pxi", line 1044, in jnius.JavaMultipleMethod.__call__
  File "jnius/jnius_export_class.pxi", line 766, in jnius.JavaMethod.__call__
  File "jnius/jnius_export_class.pxi", line 843, in jnius.JavaMethod.call_method
  File "jnius/jnius_utils.pxi", line 91, in jnius.check_exception
jnius.JavaException: JVM exception occurred: net.imglib2.python.ReferenceGuardingRandomAccessibleInterval cannot be cast to net.imglib2.IterableInterval
>>> imagej.imagej.__version__
'0.4.0'

SIGSEV on tab-completion with osx / OpenJDK 8

Fresh setup recently with:

conda create -n ij -c conda-forge pyimagej openjdk=8
source activate ij
Click to expand packages

(ij) ~ $conda list
# packages in environment at /opt/anaconda/envs/ij:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.6             h1de35cc_1002    conda-forge
ca-certificates           2019.3.9             hecc5488_0    conda-forge
certifi                   2019.3.9                 py37_0    conda-forge
cycler                    0.10.0                     py_1    conda-forge
freetype                  2.10.0               h24853df_0    conda-forge
imglyb                    0.3.4           py37h24bf2e0_1000    conda-forge
jgo                       0.3.0                 py37_1000    conda-forge
kiwisolver                1.0.1           py37h04f5b5a_1002    conda-forge
libblas                   3.8.0                4_openblas    conda-forge
libcblas                  3.8.0                4_openblas    conda-forge
libcxx                    8.0.0                         1    conda-forge
libcxxabi                 8.0.0                         1    conda-forge
libffi                    3.2.1             h6de7cb9_1006    conda-forge
libgfortran               3.0.1                         0    conda-forge
liblapack                 3.8.0                4_openblas    conda-forge
libpng                    1.6.36            ha441bb4_1000    conda-forge
matplotlib                3.0.3                    py37_0    conda-forge
matplotlib-base           3.0.3            py37hf043ca5_0    conda-forge
maven                     3.6.0                         0    conda-forge
ncurses                   6.1               h0a44026_1002    conda-forge
numpy                     1.16.2           py37hbb3c62a_1    conda-forge
openblas                  0.3.5             h436c29b_1001    conda-forge
openjdk                   8.0.192           h1de35cc_1003    conda-forge
openssl                   1.1.1b               h01d97ff_2    conda-forge
pip                       19.0.3                   py37_0    conda-forge
pyimagej                  0.4.0                 py37_1001    conda-forge
pyjnius                   1.2.0            py37h90b5fae_0    conda-forge
pyparsing                 2.4.0                      py_0    conda-forge
python                    3.7.3                h0d93f26_0    conda-forge
python-dateutil           2.8.0                      py_0    conda-forge
readline                  7.0               hcfe32e1_1001    conda-forge
scyjava                   0.1.0                 py37_1001    conda-forge
setuptools                41.0.0                   py37_0    conda-forge
six                       1.12.0                py37_1000    conda-forge
sqlite                    3.26.0            h1765d9f_1001    conda-forge
tk                        8.6.9             ha441bb4_1001    conda-forge
tornado                   6.0.2            py37h01d97ff_0    conda-forge
wheel                     0.33.1                   py37_0    conda-forge
xz                        5.2.4             h1de35cc_1001    conda-forge
zlib                      1.2.11            h1de35cc_1004    conda-forge

Initialized with:

import imagej
ij = imagej.init("sc.fiji:fiji")

import jnius
ImageReader = jnius.autoclass("loci.formats.ImageReader")
ir = ImageReader()
ir.setId("/a.fake")

Typing ir.<tab> segfaults. Capturing here in case anyone else is having similar issues.

Click to expand error

>>> ir.setId("/a.fake")
17:49:46.135 [AWT-AppKit] DEBUG loci.common.NIOByteBufferProvider - Using mapped byte buffer? false
17:49:46.149 [AWT-AppKit] INFO  loci.formats.ImageReader - FakeReader initializing /a.fake
17:49:46.151 [AWT-AppKit] DEBUG loci.formats.FormatHandler - FakeReader initializing /a.fake
17:49:46.151 [AWT-AppKit] DEBUG loci.formats.FormatHandler - loci.formats.in.FakeReader.initFile(/a.fake)
17:49:46.173 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Loaded properties from: services.properties
17:49:46.391 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.POIService and implementation class loci.formats.services.POIServiceImpl
17:49:46.393 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.MDBService and implementation class loci.formats.services.MDBServiceImpl
17:49:46.393 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.JPEGTurboService and implementation class loci.formats.services.JPEGTurboServiceImpl
17:49:46.396 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface ome.codecs.services.LuraWaveService and implementation class ome.codecs.services.LuraWaveServiceImpl
17:49:46.398 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.JAIIIOService and implementation class loci.formats.services.JAIIIOServiceImpl
17:49:46.401 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.WlzService and implementation class loci.formats.services.WlzServiceImpl
17:49:46.402 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.JHDFService and implementation class loci.formats.services.JHDFServiceImpl
17:49:46.404 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.NetCDFService and implementation class loci.formats.services.NetCDFServiceImpl
17:49:46.405 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.EXIFService and implementation class loci.formats.services.EXIFServiceImpl
17:49:46.406 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.MetakitService and implementation class loci.formats.services.MetakitServiceImpl
17:49:46.406 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.LuraWaveService and implementation class loci.formats.services.LuraWaveServiceImpl
17:49:46.408 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.OMEXMLService and implementation class loci.formats.services.OMEXMLServiceImpl
17:49:46.409 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface ome.codecs.services.JAIIIOService and implementation class ome.codecs.services.JAIIIOServiceImpl
17:49:46.410 [AWT-AppKit] DEBUG loci.common.services.ServiceFactory - Added interface interface loci.formats.services.JPEGXRService and implementation class loci.formats.services.JPEGXRServiceImpl
>>> ir.#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000109820051, pid=51954, tid=0x0000000000000307
#
# JRE version: OpenJDK Runtime Environment (8.0_192-b01) (build 1.8.0_192-b01)
# Java VM: OpenJDK 64-Bit Server VM (25.192-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x2eb051]  jni_GetIntField+0x96
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/jamoore/hs_err_pid51954.log
#
# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
#
Abort trap: 6

Cannot import imglyb in init method

I have successfully installed pyjnius, imglib2-imglyb and imagej and I am able to import pyjnius and imglyb without any problem.

The problem comes when I want to import imglyb in init method. I pass the correct path to ij_dir and 363 Jars are added to CLASSPATH. But, when it gets to the import imglyb line, it throws this error:

Traceback (most recent call last):
  File "E:/test_project/main.py", line 8, in <module>
    ij = imagej.init('D:/fiji-win64/Fiji.app')
  File "D:\Miniconda3\envs\test\lib\site-packages\imagej\imagej.py", line 204, in init
    import imglyb
  File "D:\Miniconda3\envs\test\lib\site-packages\imglyb\__init__.py", line 50, in <module>
    from .util import \
  File "D:\Miniconda3\envs\test\lib\site-packages\imglyb\util.py", line 11, in <module>
    from .imglib_ndarray import ImgLibReferenceGuard
  File "D:\Miniconda3\envs\test\lib\site-packages\imglyb\imglib_ndarray.py", line 9, in <module>
    Intervals = autoclass( 'net.imglib2.util.Intervals' )
  File "D:\Miniconda3\envs\test\lib\site-packages\jnius\reflect.py", line 158, in autoclass
    c = find_javaclass(clsname)
  File "jnius\jnius_export_func.pxi", line 25, in jnius.find_javaclass
jnius.JavaException: Class not found b'net/imglib2/util/Intervals'

and this is the exact code that I used:

import imagej
ij = imagej.init('D:/fiji-win64/Fiji.app')

I am on 64bit windows and I created conda environment (called test) for this code.

Throw exceptions if ij_dir does not exist

[imagej.init(ij_dir)](https://github.com/imagej/imagej.py/blob/master/imagej/imagej.py#L188) returns without failure when an invalid path is specified as Fiji.app dir. This is confusing for users who do not have any Java knowledge and do not specify a valid ij_dir. imagej.init should throw an exception in these cases. Possible options are:

  • Check if ij_dir exists and is directory, throw otherwise
  • Check if ij_dir exists and is directory, and contains at least jars directory, throw otherwise
  • Check if num_jars is greater than 0, throw otherwise

Maybe it is best to add all these checks with specific exceptions, e.g.

  • ij_dir does not exist
  • ij_dir exists but does not seem to be valid Fiji.app directory
  • did not find any jars in ij_dir.

Ship a logging implementation

PyImageJ does not currently ship a log4j implementation, which results in an obnoxious warning at startup:

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

We can fix it by making imagej.init() include a log4j implementation on the classpath.

Plugins not found on MacOS

Hi,

I have successfully setup and used Py ImageJ. However, I am not able to call upon any of the numerous plugins from python.

from skimage import io
import cv2
import os
import imagej
ij = imagej.init('<my-local-path>/Fiji.app')
import imglyb
from PIL import Image

Returns:

Added 375 JARs to the Java classpath.

However, when I attempt to run a Macro:

def improve_raw(impath):
    macro = """open("{}");
               run("Normalize Local Contrast", "block_radius_x=40 block_radius_y=40 standard_deviations=3 center stretch");
               run("Enhance Local Contrast (CLAHE)", "blocksize=127 histogram=256 maximum=3 mask=*None*");
               run("Gaussian Blur 3D...", "x=2 y=2 z=2");
               saveAs("TIFF", "{}");""".format(impath, impath.replace("Tiff_masks", "Tiff_masks_cleaned"))
    ij.script().run('Macro.ijm', macro, True).get()
    return(1)

I receive the following error message:

Unrecognized command: "Normalize Local Contrast"

The macro successfully runs from within ImageJ. Any idea why the same macro doesn't work from within Python?

Thanks.

Best,
Noah

pyimage forces logging to console

I want my application using pyimagej to log some important information to a file. I've set my logging up in a basic way according to the logging documentation. If I also initialize imagej in this script (or in a module that gets imported), the logging only goes to the console. Here is a simple example of this. Without initializing ij, it logs all 3 statements to the example.log file. If ij is initialized, it prints info & warning to the console and ignores debug. So something in pyimagej or its imports seems to mess with the logging configuration (both saving to file and logging level are overwritten).

import logging
import imagej

ij = imagej.init('sc.fiji:fiji:2.0.0-pre-10+ch.fmi:faim-ij2-visiview-processing:0.0.1')

logging.basicConfig(filename='example.log', level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')

I first thought that may just be an issue with the root logger, so I would use a named logger like logger = logging.getLogger(__name__) and just log to this logger. But that does not work either.

Maybe this is related to the warnings I get when initializing imagej about log4j not being initialized properly?

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Edit: Also, if the java side initialization of the logger is the issue, I would need some way to fix this on the python side, without manually setting classpaths. The application should be deployed easily to new machines, without a necessity of setting these kind of paths if possible.

Add axis convention handling to conversion functions

Numpy and matplotlib have limited axis handling capabilities when it comes to plotting. There is no way to specify a custom axis, such as XYCT vs XYTC, except by manually plotting it with foreknowledge of the axis.

In addition, numpy indexing is in row-major form (ZYX) which is reversed from Java (XYZ). However, as an exception, python plotting libraries assume that the image is RGB if the last channel is 3-dimensional. E.g. YXC or ZYXC. This complicates conversion back and forth between ImageJ and Numpy, as ImageJ opens RGB as XYZC, and so you can't simply reverse the axis order if you want to make the numpy image directly plotable.

The pyimagej conversion functions from_java and to_java should have some way of specifying channel conventions, and the view function should plot that convention correctly. This is particularly important in cases where ops/filters alter the axis order, which can quickly cause unintended errors.

@ctrueden suggests some form of hint variable or other way of passing through Metadata, but the implementation and edge-case handling needs to be determined.

Plugin usage example

Hi,

I wish to use the Temporal-Color Code plugin through pyimagej but I can't seem to understand how to run plugins using the library.

The basic steps work as expected:
imagej.init(path_to_fiji))
>>> Added X JARs to the Java classpath.

I can show an image using ij.py.show() but as I mentioned - I can't run a plugin. It says that There are no images open in line 1, which is true, since I had to close the figure window in order for the script to continue running (the block argument from matplotlib.pyplot.show() is inaccessible).

When I run the same script from Jupyter with either the Temporal-Color Code or the Mean plugin (as seen in one of the examples), it returns the following object: <org.scijava.script.ScriptModule at 0x7fcb802b9258 jclass=org/scijava/script/ScriptModule jself=<LocalRef obj=0x562870b51168 at 0x7fcbe20e95b0>>ย , which is a step forward, but I'm still unsure of how to proceed from here.

Thanks in advance.

Issue with thresholding an image

Hey all,

I tried to add some image processing workflow to this notebook.

In section 4, I added

tHuang = ij.op().threshold().huang(cell_colony)
ij.py.show(tHuang);

Causing this error:

---------------------------------------------------------------------------
JavaException                             Traceback (most recent call last)
<ipython-input-6-0327982ad689> in <module>
----> 1 tHuang = ij.op().threshold().huang(cell_colony)
      2 ij.py.show(tHuang);

jnius\jnius_export_class.pxi in jnius.JavaMultipleMethod.__call__()

jnius\jnius_export_class.pxi in jnius.JavaMethod.__call__()

jnius\jnius_conversion.pxi in jnius.populate_args()

jnius\jnius_utils.pxi in jnius.check_assignable_from()

JavaException: Invalid instance of 'net/imagej/DefaultDataset' passed for a 'net/imglib2/histogram/Histogram1d'

I uploaded the notebook to the simplify_tutorials branch, Any hint for getting thresholding to run is appreciated.

Thanks!

Cheers,
Robert

pyimagej interefering with Tkinter GUI on Mac

I have an application using pyimagej for image processing and want to make a very simple interface for the users to provide some inputs. I am using tkinter for this gui. When I initialize pyimagej either in that script or one of its imports, it fails to produce the gui, but does not crash. It just shows the following message:
2019-05-31 16:47:01.581 python[27137:9099880] In -[NSApplication(NSQuietSafeQuit) _updateCanQuitQuietlyAndSafely], _LSSetApplicationInformationItem(NSCanQuitQuietlyAndSafely) returned error -50

Here is some dummy example code that reproduces this:

import imagej
import tkinter as tk
ij = imagej.init('sc.fiji:fiji:2.0.0-pre-10')
root = tk.Tk()
tk.Label(root, text='Test1').grid(row=0, column=0)
tk.Checkbutton(root, text='Test2').grid(row=1, column=0)
root.mainloop()

Without the imagej initialization, it runs fine. It happens both with a maven initialization and when wrapping the local Fiji installation. This problem does not reproduce on Windows for me (there, the gui comes up as expected) and I don't know whether it reproduces on Linux.
I do get this issue on my Mac running macOS 10.14.5.

Support installation in Jupyter notebooks

For accessibility and reproducibility of Jupyter notebooks that use pyimagej, especially for examples, we want to support installation and execution via a conda-forge package. For example:

import sys
!conda install --yes --prefix {sys.prefix} -c conda-forge pyimagej

import imagej
ij = imagej.init()

To do this, two improvements appear to be required (see discussion in InsightSoftwareConsortium/itkwidgets#116):

  1. Support picking up Java and pyjnius jars when environmental variables are not defined in standard system locations, e.g. where conda-forge packages install them.
  2. Make import's and system initialization robust to avoid the error ValueError: VM is already running, can't set options

The following minimal notebook demonstrates the desired behavior and current error:

PyimagejJupyterInstallation.ipynb.zip

CC: @hadim @ctrueden

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.