These are chat archives for fiji/fiji

22nd
Mar 2019
filippogambarota
@filippogambarota
Mar 22 11:48
hi, i've a strange problem... for 3 days every time that i open an image (both drag and drop and using the menu) the image isn't displayed. all operation works but i cannot see anything. How can i do?
Curtis Rueden
@ctrueden
Mar 22 13:52
@IETSilencer For the first issue: it all depends how you have installed pyimagej. Are you using conda? See installation instructions.
@IETSilencer For the second issue: please post that question on the Image.sc Forum; you are more likely to get a good response there. Since it is an ImageJ 1.x question, you could also later follow up on the ImageJ 1.x mailing list if you don’t get a satisfactory answer.
IETSilencer
@IETSilencer
Mar 22 13:54
py
Curtis Rueden
@ctrueden
Mar 22 13:54
@filippogambarota Is it possible you use multiple monitors and one of them is unplugged now, such that image windows are appearing offscreen? Are you seeing windows appear at the operating system level? E.g. on Windows, in the taskbar; on macOS, in the Dock?
@filippogambarota You can try Edit > Options > Reset… to see if that clears out any persisted problematic window locations.
IETSilencer
@IETSilencer
Mar 22 13:57
image.png
@ctrueden I am using conda, after pip install pyimagej I got a permissions denied error.
This stuff gives me a headache
IETSilencer
@IETSilencer
Mar 22 15:02
What's the difference between import ij and import imagej, are these not the same modules??
Curtis Rueden
@ctrueden
Mar 22 15:43
@IETSilencer Firstly, it is recommended to use pyimagej with openjdk 8, rather than 11. I am updating the README now.
@IETSilencer Secondly… that error is a new one on me. How did you install conda? In particular: the folder where your conda lives needs to be owned by you, not e.g. root.
Maybe this comment helps you, if you need a detailed explanation of the permissions problem here.
@IETSilencer When you write import imagej you are importing the pyimagej package.
When you write from ij import ImagePlus or something like that—which will only work in Jython scripting and not the regular C version of Python—you are importing the ij.ImagePlus Java class.
Curtis Rueden
@ctrueden
Mar 22 15:48
To install pyimagej with Java 8 instead of Java 11, use: conda install -c conda-forge pyimagej openjdk=8
IETSilencer
@IETSilencer
Mar 22 16:00
@ctrueden I installed conda from their website. I can' t find the location of conda on my computer, I forgot where I installed it.
after using this install -c conda-forge pyimagej openjdk=8 , now I can't import imagej module
My goal is to access the fiji API through the conda environment
@ctrueden When I write a new script using fiji, this works.
Curtis Rueden
@ctrueden
Mar 22 16:06

My goal is to access the fiji API through the conda environment

Let’s take a step back. What are you trying to accomplish? You want to combine ImageJ/Fiji with Python ecosystem libraries like scikit-image? Or just write scripts in the Python language using the ImageJ API because you like Python? Or something else?

To find where conda is installed:
$ echo "$CONDA_EXE"
/usr/local/miniconda3/bin/conda
IETSilencer
@IETSilencer
Mar 22 16:30
I just realized that I can write a python script in fiji. The issue was trying to access the fiji API in the conda environment by importing the ij module (similarly to how the ij module is import in a script inside of fiji), however I can't import ij, although I can import imagej.
If I could use ij module and access the API to show images using conda, that would be what I am trying to do.
which you explained perfectly above that ij uses jython
filippogambarota
@filippogambarota
Mar 22 16:32
@ctrueden thank you so much... at home i work with a dual monitor (notebook + external) but when i use imagej outside i cannot see anything!! now i've fixed it
IETSilencer
@IETSilencer
Mar 22 16:47
@ctrueden To make the problem simple, I would like to run this code in Juypter Notebook
fiji.PNG
Jan Eglinger
@imagejan
Mar 22 16:48
@IETSilencer this discussion is becoming a bit lengthy, I suggest that you post your issue on https://forum.image.sc where the solution might also help others having similar problems.
Curtis Rueden
@ctrueden
Mar 22 17:17
@filippogambarota Glad to hear you got it working! :tada:
@IETSilencer I agree with @imagejan that it would be nice to make a forum post with this, since it may go back and forth with more posts, and most importantly because the forum is a permanent archive of these discussions which is more discoverable for others with similar issues later.
Curtis Rueden
@ctrueden
Mar 22 17:51
It is a Jupyter notebook that you would run using the BeakerX Groovy kernel. http://beakerx.com/
The bulk of the code is in Jython, because you can execute Jython scripts via ImageJ’s script service.
If you need real Python kernel for some reason, that is also doable. But I don’t have time to mock that up for you at this moment. However, if you paste a forum topic link here, I will do so on the forum topic.
IETSilencer
@IETSilencer
Mar 22 18:10
Okay thank you
IETSilencer
@IETSilencer
Mar 22 18:16
After downloading the BeakerX, I get this error message "Unable to import scyjava dependency jnius." when using ij = imagej.init(path + '\Fiji.app')
Curtis Rueden
@ctrueden
Mar 22 18:56
@IETSilencer Firstly, install beakerx using conda:
conda create -n beakerx beakerx openjdk=8
conda activate beakerx
Secondly: your error message indicates that you are trying to use the pyimagej stuff, not the BeakerX approach.
You need to create a new notebook with BeakerX's Groovy kernel, not a new Python 3 kernel. And don’t invoke ij = imagej.init because that is a pyimagej thing.
But seriously: please start a forum topic, and paste the link here.
Tag it with imagej and jupyter. Explain what you ultimately want to achieve. Why are you using Python? Do you need to combine with other Python libraries? If so, which ones?
IETSilencer
@IETSilencer
Mar 22 19:02
Okay I'll start the forum
but this entire thing is really confusing me
IETSilencer
@IETSilencer
Mar 22 19:18
it's very confusing because some discussions use pyimagej methods like imagej.getstatistics() but they write it as IJ.imagej.getstatistics() , and in the fiji jython tutorials "from ij import IJ"
like in these tutorials https://imagej.net/Jython_Scripting_Examples , can you use these methods in the fiji script services?
Curtis Rueden
@ctrueden
Mar 22 19:48
@IETSilencer I sympathize. It is a lot of stuff, with multiple ways to do things. Looking forward to helping you more on the forum! :-)