Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 views
in Technique[技术] by (71.8m points)

imagej - How to find, read, write Jython registry during runtime

I am using Jython as a macro language in ImageJ environment. I want to access private and protected fucntions. For this there is a Jython registry entry. I can't find the registry file. Jython runs within macro programming environment of ImageJ. I was wondering, if there is any way to get the path and entries of the current registry file within Jython code?

question from:https://stackoverflow.com/questions/66047524/how-to-find-read-write-jython-registry-during-runtime

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The documentation for the Jython Registry lists, among others, the following source for the registry file:

The user’s personal registry file, which contains similarly formated prop/value pairs. The user’s registry file is at "user.home"+"/.jython"

With a file .jython in your user home directory, containing the single line:

python.security.respectJavaAccessibility=false

... the following example script will output 1 without throwing an error:

from ij import ImagePlus

print (ImagePlus.CLOSED) # a private field

Note that ImageJ-specific questions are best asked on the dedicated forum: https://forum.image.sc/tag/imagej


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...