Run ImageJ scripts in IntelliJ - java

I am an average ImageJ user who learnt to write IJ.macro and Groovy by trial and error. I did this mainly using the plain a simple script editor within ImageJ. I recently came up with IntelliJ, an amazing IDE with auto-completion and debugger. With the help of google, I was able to include the ImageJ jars, and pluggings accessible as external libraries/modules so that I can use the mentioned functionalities [by adding the path in File>Project Structure>Libraries>"+">Java>... here I selected the folders with the Jars and plugins of ImageJ].
I am, therefore, optimistic that I could achieve the last step. Rather than writing the code in IntelliJ and run with the ImageJ script tool, I was wondering if it could be possible to run a script (say with Groovy or Jython) directly from IntelliJ. Somethin like calling ImageJ when I click run. Maybe changing the Java Run Environment, or using it as VM.
Before finishing, sorry if I am saying something really odd or non-sense. I am an average Joe learning by trying.
Kind regards,

You might want to have a look at this GitHub project:
https://github.com/haesleinhuepf/run_jython_scripts_from_ide
It explains the steps required to run a script from within the IDE by starting up and using ImageJ. The tutorial focuses on Jython, but is applicable to all supported scripting languages.
In general, questions about ImageJ usage and script development are best asked on the Image.sc forum instead of here on StackOverflow.

I've never used ImageJ, but I guess your question is independent of ImageJ :-)
I you use ImageJ from java, you will have a class with a main method. Just right-click on the class and then "run" on the menu which appeared.
After your program has finished, there is a "run"-icon in the upper left corner of the small window which appeared.
I guess that's already close to running a script.
Groovy would be a better starting point for scripting (since it is partly a scripting language). You can code Groovy with the IntelliJ community edition, but for full support you need the ultimate edition. So I guess the groovy console is only available in the ultimate edition...
All other options I am aware of will not give you the auto-completion and only a poor-man's debugger (println)
Hope that helps

I don't know if people still struggle with this, it is now 3.5 years later, but if you start a script with this:
//# ImagePlus myImp
import ij.ImagePlus
ImagePlus myImp = myImp
You can use both the autocomplete of IntelliJ and the SciJava script parameters. I keep the same script file open in both ImageJ and IntelliJ. After a change in IntelliJ, I go to the script editor to run it. It automatically detects something has changed and will ask to update.
This is a bit of a hassle, but I haven't found how to get IntelliJ to execute the script in a running instance of ImageJ.

Related

How to show the result on Tooltip while running java file - IntelliJ IDEA

In this video, Venkat Subramaniam is running simple java file and he is able to see the result on screen as the given below image. Does anybody know which tool he is using ?
Its actually a wonderful feature, but unfortunately this only work for Textmate.
Here you could find how to set it up for Textmate: https://www.ivonet.nl/2017/11/07/textmate-get-run-output-as-tooltip/
For IntelliJ IDEA there no such thing. But, a one guy has tried to do it in InteliJ Idea with a plugin which is available at https://github.com/jcraane/intellij-tooltip-runner. But, it is outdated and not working in recent releases.

Eclipse Oxygen: How to automatically upload php files on remote server

I'm coming from NetBeans and evaluating others and more flexible IDEs supporting more languages (i.e. Python) than just php and related.
I kept an eye on Eclipse that seems to be the best choice; at the time I was not able to find an easy solution to keep the original project on my machine and automatically send / syncronize the files on the remove server via sftp.
All solutions seems to be outdated or stupid (like mounting a smb partition or manually send the file via an ftp client!
I'm not going to believe that an IDE like Eclipse doesn't have a smart solution of what I consider a basic feature of an IDE, so I think I missed something... On Eclipse forums I've seen the same question asked lots of time but without any answer!
Some suggestions about is strongly apreciated otherwise I think the only solution is stick on one IDE each language I use that seem to be incredible on 2018.
I'm developing on MacOS and the most interesting solution (kDevelop) fails on building with MacPorts.
Thank you very much.
RSE is a very poor solution, as you noted it's a one-shot sync and is useless if you want to develop locally and only deploy occasionally. For many years I used the Aptana Studio suite of plugins which included excellent upload/sync tools for individual files or whole projects, let you diff everything against a remote file structure over SFTP when you wanted and exclude whatever you wanted.
Unfortunately, Aptana is no longer supported and causes some major problems in Eclipse Neon and later. Specifically, its editors are completely broken, and they override the native Eclipse editors, opening new windows that are blank with no title. However, it is still by far the best solution for casual SFTP deployment...there is literally nothing else even close. With some work it is possible to install Aptana and get use of its publishing tools while preventing it from destroying the rest of your workspace.
Install Aptana from the marketplace.
Go to Window > Preferences > Install/Update, then click "Uninstall or update".
Uninstall everything to do with Aptana except for Aptana Studio 3 Core and the Aptana SecureFTP Library inside that.
This gets rid of most, but not all of Aptana's editors, and the worst one is the HTML editor which creates a second HTML content type in Eclipse that cannot be removed and causes all kinds of chaos. But there is a workaround.
Exit Eclipse. Go into the eclipse/plugins/ directory and remove all plugins beginning with com.aptana.editor.* EXCEPT FOR THE FOLLOWING which seem to be required:
com.aptana.editor.common.override_1.0.0.1351531287.jar
com.aptana.editor.common_3.0.3.1400201987.jar
com.aptana.editor.diff_3.0.0.1365788962.jar
com.aptana.editor.dtd_3.0.0.1354746625.jar
com.aptana.editor.epl_3.0.0.1398883419.jar
com.aptana.editor.erb_3.0.3.1380237252.jar
com.aptana.editor.findbar_3.0.0.jar
com.aptana.editor.idl_3.0.0.1365788962.jar
com.aptana.editor.text_3.0.0.1339173764.jar
Go back into Eclipse. Right-clicking a project folder should now expose a 'Publish' option that lets you run Aptana's deployment wizard and sync to a remote filesystem over SFTP.
Hope this helps...took me hours of trial and error, but finally everything works. For the record I am using Neon, not Oxygen, so I can't say definitively whether it will work in later versions.

Android development with notepad-like editor and command line

I have a problem with Eclipse. It is very slow for me. My PC is an old PC and I'm not comfort with the performance. Is there any lightweight alternative to Eclipse (Available for Windows and Linux)? I want SPEED!
My ideal is to write my code in an editor like Notepad and supplement with the command line! How can I compile my code in this environment? How do I update my R.java file or build my project's configuration?
The documentation provides very nice instructions about using the command line tool. The building is performed with the aid of Ant tool. You could also use a more advanced editor than notepad (Notepad++ for example).
However, if you have a slow machine, you would suffer during development anyway. You should also forget about using the emulator for debugging. The emulator would take ages to load.
see the link managing project through command line
It provides a brief description about how to develop android app without any IDE
If you want speed, you should buy a faster computer.
It seems that you are a beginner -> I would suggest purchasing almost any java book, or visiting websites with tutorials, if you are at the stage where you don't know how to compile your code.
well, nothing holds you back to use notepad and manually compiling with javac:
http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/javac.html
Like kgiannakakis pointed out; you'll also need the Android SDK:
http://developer.android.com/sdk/index.html

Help to Install Eclipse for A Netbeans Users

I had been using Netbeans all the while to develop Swing application. So far, I am a Happy Netbeans User
Currently, I had a project (GWT, J2EE and Swing), which I need to use Eclipse (Please do not ask Why)
Here is the step I had been taken.
Download Eclipse IDE for Java EE Developers (190 MB) from http://www.eclipse.org/downloads/ I thought this should be the correct choice, as I see most features are found in that edition http://www.eclipse.org/downloads/packages/compare-packages
After struggling a while to get use to the user interface of Eclipse, I still cannot find a Visual GUI Editor!
After doing some Googling, I realize I need to install something called Plugins
However, tones of plugins which had similar features has confused me, as I found
http://www.cloudgarden.com/jigloo/index.html
http://www.eclipse.org/vep/WebContent/main.php
http://code.google.com/p/visualswing4eclipse/
This makes me even more confuse? Which plugin I should use to develop a Swing based application? Most of them seems not up-to-dated. Or, is there any complete bundle I can download, where 1 click, will install all the necessary Swing development tools for me?
I just miss my Netbeans :( I really appreciate their team, who make the installation work so easy. One click button install, all the necessary tools just come to me
Eclipse users typically program UI by hand.

How to transfer Netbeans Project into Eclipse?

I have been using Netbeans for my java desktop application since few months. Now in the middle of the project, I want to switch over to Eclipse as the Netbeans once corrupted my GUI and I had to re-create several parts of the GUI and now it is displaying a compiler error as
code too large
private void initComponents() {
1 error
"code too large" is a strange error. My code which it is saying too large is just 10,000 lines long. I came to know first time that we couldn't develop long code in Netbeans :)
So instead of going into detail, I want to switch to Eclipse. I have never used it before. So could please tell me how to import my incompleted Netbeans project into eclipse.
I dont' know if there exists a plugin for that, but if you've used default Netbeans settings it's likely the GUI layout code and form files won't be compatible.
What I suggest you do is first refactor your existing code to eliminate Netbeans-specific features, as well as making it smaller, and working.
For GUI-stuff, you should create several classes and beans so that your main GUI file is much-much smaller. 10000 lines of GUI code is pretty much unmanageable.
I suppose your main concern is migrate the GUI builder stuff, not only your code. The latter would be no problem but I guess that the first one is difficult if not impossible. And furthermore, as far as I know there is no standard GUI builder application in eclipse.
This should be resolved by spitting things up like others have said.
I just got a similar error and NetBeans was struggling with the code so I just tried to compile it on the command line with javac and it yelled at me with this same error. So this is not an IDE issue but a Java compiler issue.
If you get this error you probably auto-generated most of your code.
the easiest thing to do would be to create a new project in eclipse and import the codebase from filesystem into the project. Eclipse has an option to import from filesystem.

Categories

Resources