Closed bryantChhun closed 4 years ago
The Studio depends on PycroManagerJava.jar, which includes both remote
and internal.zmq
packages. The only explicit call to either package is here to instantiate a ZMQ server. All other objects from these packages are generated by interacting with this server (or subsequent servers that it spawns).
So if you want to develop the Java side, that's correct, you need to include the source of these packages. In addition many of the features used by Pycromanager live in seperate repositories. Specifically NDViewer, the image display window, NDTiffStorage, the disk storage, and AcqEngJ, the acquisition engine. PycroManagerJava depends on all of these. So depending on what you're trying to do you might want to add the source for these as well.
Here is how I set everything up in IntelliJ. Under File-project structure I have a module for each one. Also shown are Magellan, which is not necessary and micromanager, which contains the studio source code and is also not necessary (i.e. you could just use MMJ_.jar instead).
Sources and dependencies are set up for pycromanager as shown:
mmLibraries contains all the Jars within the plugins/Micro-Manager
folder of a micro-manager install, except for the ones that you're running from source (i.e. NDViewer, AcqEngJ, NDTiffStorage, and MMJ_, which is the compiled version of studio source code though its name may change in the future). MMCoreJ is separated out here even though it's also in this folder so that it can be separately used as a dependency for the other three libraries without having to include everything else in that folder.
NDTiffStorage and AcqEngJ are set up similarly. Their only dependency is MMCoreJ. NDViewer has an extra dependency, and has a resources folder as shown:
Lastly, you need to setup a run configuration. Here the working directory is the root of your micro-manager install:
I got everything set up as above, but launching the pycromanager or micromanager configuration does not run micro-manager (but does open ImageJ). I've done the "command-drag-to-desktop" trick to get around OSX security, but MM still won't launch.
I would guess this a problem with either your working directory in the run configuration or the MMJ_.jar library or micro-manager studio source as added to the project.
Do you see Micro-Manager in the IamgeJ plugins menu?
Indeed I can see micro-manager in the ImageJ plugin menu. But when I select the Studio it gives me this error (in IntelliJ console)
I added the MMJ_.jar from my nightly build installation to the mmLibraries -- then everything worked perfectly. So clearly the problem is somewhere during my compilation of studio from source.
Ok I solved it. My micro-manager project-structure-modules did not include resources
as a content root. Including resources fixed it.
Thanks for all the help! Looking forward to contributing.
Great!
Simple question that might be useful for others:
Because pycro-manager and micro-manager are separate repositories, how does one develop and test pycro-manager on the java side?
The Java component appears to have modules (remote and internal.zmq) that are added to the Studio. So I assume that running micro-manager from IDE (IntelliJ) in debug mode needs to include files from both repos during compilation of the Studio.
I can add both sources to the project, but run into the following error: