These are chat archives for fiji/fiji

25th
Mar 2019
iamkomlaseyram
@iamkomlaseyram
Mar 25 13:58
Hello! please i am unable to launch my FIJI , I do not know why? it comes with 3 plugin configuration errors! i am running it on mojave , java 8
IETSilencer
@IETSilencer
Mar 25 14:52
ImageStatistics.STD_DEV reads the same value for all images and they don't match the Stdev. #IJ.run("Close")
IJ.open('p' + str(i) + '.png')
imp =IJ.getImage()
ip = imp.getProcessor()
options = IS.MEAN | IS.MEDIAN | IS.MIN_MAX | IS.STD_DEV
stats = IS.getStatistics(ip,options,imp.getCalibration())
Means.append(stats.mean)
Stdev.append(stats.STD_DEV)
IJ.run("Close")
IJ.open('p' + str(i) + '.png')
imp =IJ.getImage()
ip = imp.getProcessor()
options = IS.MEAN | IS.MEDIAN | IS.MIN_MAX | IS.STD_DEV
stats = IS.getStatistics(ip,options,imp.getCalibration())
Means.append(stats.mean)
Stdev.append(stats.STD_DEV)
IJ.run("Close")
The return results is a list of [4,4,4,4,4]
Jan Eglinger
@imagejan
Mar 25 15:07
@IETSilencer I think someone already recommended the forum, right? It's really a much more suitable place for those kind of questions.
stats.STD_DEV is a constant of value 4, you might want to use stats.stdDev instead, which is a public double field.
@iamkomlaseyram what are these configuration errors? Also, you might want to look on https://forum.image.sc if someone already had a similar problem, and ask there eventually.
Feel free to link here to any topics you create on the forum, so others can follow as well.
@imagejan Thanks that worked.
Jan Eglinger
@imagejan
Mar 25 15:17
:+1:
Clover Xu
@Melklover_twitter
Mar 25 15:55
Hello, greeting! I am confused about image size change comparing using different approach to open the image. The image I am dealing with is a DICOM x-ray image, 9.57 MB, showing in file explorer. While in imageJ, its showing as 32-bit inverting LUT, 19 MB. Signal from ImageJ range from 204.81 to 2637.19. I tried to open it with XnView, another software I have that can open this file, the info is shown as 8 bits per pixel in RGB, 9.57 MB. In MATLAB, I use dicomread to load the file, and it turn out to be uint16 format, which should be 16 bit. Signal from MATLAB range from 158 to 1022. Which one is the true representative of the image?
IETSilencer
@IETSilencer
Mar 25 16:03
Can xlsxwriter be used in the fiji script services ? When I try to import xlsxwriter it can not find the module. I just want to writer a list of means into an excel workbook
Ulrik Günther
@skalarproduktraum
Mar 25 16:45
@ctrueden could you please add my account to the ClearVolume update site? CV is pretty outdated and we want to update it to solve CLIJ's and sciviews dependency conflicts (see scenerygraphics/sciview#179)
Curtis Rueden
@ctrueden
Mar 25 18:39
@skalarproduktraum Done. Any other update sites you want power over?
@IETSilencer From the Jython scripting wiki page: "The Java implementation of Python is limited in functionality. One can use the standard library, but it's not possible to install additional Python modules.” However, I do not actually believe this statement fully. Jython can point to third-party Python modules, but cannot work with modules leveraging native code. And cannot leverage modules built for Python 3 (since Jython is still congruent with Python 2.7).
@IETSilencer No one, to my knowledge, has written a clear guide to importing pure-Python-2 dependencies into an ImageJ Jython script. I believe there are people who have done it, but I am not one of those people. Asking on the forum might get you a better answer, perhaps.
Is it really a requirement that you write out XLSX, though? If you write out CSV or TSV then Excel can import that just fine.
Ulrik Günther
@skalarproduktraum
Mar 25 18:47
@ctrueden well, as you are asking... the SciView update site would actually be very helpful as well xD
IETSilencer
@IETSilencer
Mar 25 18:54
@ctrueden I can write it into a csv. I was just curious why these modules can
can't be imported
Curtis Rueden
@ctrueden
Mar 25 18:55
@skalarproduktraum Skalarproduktraum added to SciView. 🧞
IETSilencer
@IETSilencer
Mar 25 18:55
It seems like trying to use jupyter notebook using the pyij env through anaconda can't be achieve, I've tried so many different ways
Curtis Rueden
@ctrueden
Mar 25 18:56
@IETSilencer Certainly using pyimagej in Jupyter via conda can be achieved; I do it on my (macOS) system frequently. But there are some obstacles depending on your OS etc.
IETSilencer
@IETSilencer
Mar 25 18:57
@That seems like the best way. Because i could then import openpyxl if I wanted to. It's really bizarre that this isn't working. I've been going in circles.
I'm using windows
I have the pyij environment and I activated it
Curtis Rueden
@ctrueden
Mar 25 18:58
I don’t know what you mean by “I have the pyij environment"
Try a fresh environment: conda create -n imagej pyimagej and then activate imagej. I know it works for at least one person on Windows.
IETSilencer
@IETSilencer
Mar 25 18:59
@ctrueden Okay I'll try this.
@ctrueden when i use imagej.init() it throws the error "ERROR 2019-03-25 14:51:25,199: Unable to import scyjava: PYJNIUS_JAR environment variable not defined." and I've googled this endlessly to no avail
Curtis Rueden
@ctrueden
Mar 25 19:01
Did you activate the environment?
On Windows I believe it is activate imagej (or whatever your environment is named)
If you don’t activate it, the environment variables won’t be set, so you’ll get errors like that.
IETSilencer
@IETSilencer
Mar 25 19:02
I wrote "conda activate pyij"
Curtis Rueden
@ctrueden
Mar 25 19:02
what does echo %PYJNIUS_JAR% tell you after activation?
IETSilencer
@IETSilencer
Mar 25 19:03
Just a path C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\pyij\share\pyjnius\pyjnius.jar
that's where I downloaded conda
@ctrueden
Curtis Rueden
@ctrueden
Mar 25 19:05
That looks correct.
And then from that SAME COMMAND PROMPT you launch Python?
E.g.: python -c "import imagej; imagej.init()"
(Or jupyter notebook of course)
Ulrik Günther
@skalarproduktraum
Mar 25 19:06
thanks, @ctrueden!
Curtis Rueden
@ctrueden
Mar 25 19:06
Because the environment is activated for that command prompt, not system wide.
IETSilencer
@IETSilencer
Mar 25 19:07
sorry I don't fully understand
Curtis Rueden
@ctrueden
Mar 25 19:07
You’re welcome, @skalarproduktraum.
IETSilencer
@IETSilencer
Mar 25 19:07
I go into the conda prompt and launch python from there
@ctrueden I really appreciate your help btw
Curtis Rueden
@ctrueden
Mar 25 19:09
What does it say if you run python -c "import imagej; ij = imagej.init(); print(ij.getVersion())" from that same prompt? After activation.
Mine says:
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
(You can ignore the warnings)
IETSilencer
@IETSilencer
Mar 25 19:10
TypeError: init() missing 1 required positional argument: 'ij_dir'
i need to specify where the fiji launcher is.. right?
like the path that it is in?
Curtis Rueden
@ctrueden
Mar 25 19:11
@IETSilencer You are using an old version of pyimagej.
Did you create that environment freshly as discussed above? Or are you still testing with an environment created longer ago?
IETSilencer
@IETSilencer
Mar 25 19:12
I ran this conda create -n imagej pyimagej
"conda create -n imagej pyimagej"
Curtis Rueden
@ctrueden
Mar 25 19:12
And then activate imagej?
IETSilencer
@IETSilencer
Mar 25 19:12
right
Curtis Rueden
@ctrueden
Mar 25 19:12
Did you already have an imagej environment?
If so, maybe the creation failed and the old one is still there?
conda env listlists what you have.
IETSilencer
@IETSilencer
Mar 25 19:13
actually i was using the older version
so now it reads "(imagej) C:\Users\NT3130>"
so i am in the new imagej env
Curtis Rueden
@ctrueden
Mar 25 19:14
conda list
Make sure you see pyimagej in the list at 0.4.0.
IETSilencer
@IETSilencer
Mar 25 19:15
yes it is there
Curtis Rueden
@ctrueden
Mar 25 19:16
Great. Then python -c "import imagej; ij = imagej.init(); print(ij.getVersion())" again.
IETSilencer
@IETSilencer
Mar 25 19:17
typeError: init() missing 1 required positional argument: 'ij_dir'
Added 380 JARs to the Java classpath.
after adding the directory this error was thrown
@ctrueden
Curtis Rueden
@ctrueden
Mar 25 19:20
The error about missing a positional argument strongly suggests that you have an old version of pyimagej. Because the new one does not require that argument.
It would be good to interrogate your python environment from within python.
E.g., sys.path and such.
But, I am no Python expert so it takes me a few moments to figure out how best to do that. Be patient.
For example, you could try python -c 'import sys; print(sys.path)'
IETSilencer
@IETSilencer
Mar 25 19:22
['', 'C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej\python37.zip', 'C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej\DLLs', 'C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej\lib', 'C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej', 'C:\Users\NT3130\AppData\Roaming\Python\Python37\site-packages', 'C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej\lib\site-packages']
Yes, thanks alot
Curtis Rueden
@ctrueden
Mar 25 19:25
If you open C:\Users\NT3130\AppData\Local\Continuum\anaconda3\envs\imagej\lib\site-packages\imagej\imagej.py in a text editor, does it have __version__ = '0.4.0' toward the top of the file?
If not, then your imagej environment does not have pyimagej 0.4.0.
And if so, then I am baffled why python -c 'import imagej; imagej.init()' would complain missing 1 required positional argument
Sorry to say I don’t have any more time today to sink into this. If you MAKE A FORUM POST then there are more people who can help. If no one responds, you can @ mention me on the forum, and I will return to it when I can.
IETSilencer
@IETSilencer
Mar 25 19:27
https://www.python.org/dev/peps/pep-0396/#deriving
version = '0.4.0'
author = 'Curtis Rueden,
Curtis Rueden
@ctrueden
Mar 25 19:27
That looks good. So I am baffled.
IETSilencer
@IETSilencer
Mar 25 19:28
my head is spinning
Curtis Rueden
@ctrueden
Mar 25 19:28
On the forum are MANY MORE PYTHON PEOPLE than here. Fiji is Java software and the number of Python people here is very low!
IETSilencer
@IETSilencer
Mar 25 20:36
@ctrueden Thanks Curtis
IETSilencer
@IETSilencer
Mar 25 20:44
@ctrueden Could have something to do with the conda path in my environmental variables?
Hadrien Mary
@hadim
Mar 25 22:45
@IETSilencer as @ctrueden said you should really post your issue on the forum at https://forum.image.sc
There you'll get help about your issue.
This chat is used for development and not for support.