-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command line utility #38
Comments
The docker interface is for https://isg.nist.gov/deepzoomweb/software/wipp https://github.com/usnistgov/MIST/blob/master/docker_example.sh should give you an idea of how to launch the MIST container with a set of arguments outside of FIJI. |
Hi @mmajurski, The fact that the application can be run within docker(I'm guessing without ImageJ running) and a brief look at I think basic instructions to use this powerful piece of software in an automated workflow would be beneficial not only to me, but also to future users and I would greatly appreciate if you could add some instructions on how to build this app for that purpose. I already figured out, that I need to install maven and currently I'm getting some errors I am stuck on, I assume related to incorrect maven CLI arguments. |
The application can be run without the GUI, so long as you compile the whole project with all of the required dependencies, which is the hard part. The docker file should work out of the box. We use that docker image in a downstream system fairly regularly, so I want to make sure its kept operational. What errors did you get working with the docker file? |
I have some progress with getting things running from command-line directly using java -jar directly. It isn't pretty though. I need to chat with Mike first on how we want to deploy this version... But I think we can make it happen... |
Compilation and Execution instructions have been created: https://github.com/USNISTGOV/MIST/wiki/Install-Guide#compilation-from-source Note that if using IntelliJ, we used the following version of the Java JDK: corretto-1.8.0_372\bin\java.exe This is the version that gets packaged with IntelliJ. IntelliJ is not required, but currently is the way we have gotten it setup. If you go through the steps to get the java and maven environments setup outside of IntelliJ, please provide your steps and I can add them into the instructions. |
Thanks a lot for the update. I was in fact running the wrong Maven command and After having spent all afternoon playing with combinations of running the app from ImageJ and calling it again for the same files from the command line, I can say that initially there seems to be something about running it from the CLI with the provided parameters(from the example) that caused the program to crash, where an equivalent call from the GUI, constructed manually in the ImageJ plugin, succeeded. The resulting jar seems to run into some issues surrounding filesystem access. Both if I open the gui through the
I have further noticed, that the script running outside of imageJ fails to recognize my machine's available memory, while the information is present when run from ImageJ. I am not sure whether this is only relevant for the statistics output or meaningfully impacts the computation, but it is something I noticed.
as opposed to ImageJ:
After many hours of this not working(in hindsight possibly because I was linking to a different FFTW install), I ended up running the program from the GUI with parameters that succeeded, opened the
I now have a working version and will attempt to incorporate it into my program, as I am only interested in the metadata(refined tile locations) I am happy to report that this script runs in approx 12s for 2-300MP stitches. I am very happy with this. Thank you for developing this excellent tool. On an unrelated note: I have come to realize, that the automatic parameters fail for some of my problem instances which I find odd, because my "tiles" are tack-sharp, low-distortion, flat-field corrected and have fairly consistent(albeit inperfect) spacing. The gui-popup informs me that you are interested in problematic datasets and I would love to contribute one to aid your development efforts, could you let me know how to supply it? Unfortunately as a jpeg, the high resolutions results in 40MB of files. I apologize for the long winded answer and I will post another update as soon as I have run this for some more examples. Thank you again for the help. |
Glad that you got the command line working. Had you been about a day slower, I would likely have gotten the python version complete. Enough people have asked about a stand alone simplified python version that it was time to start building it. Right now I have the translation computation and half of the stage model done. As for problematic datasets, if you are willing to share, email me a google drive link ([email protected]) and I will see whats going on. Likely if you are getting the result you want, your stage is just looser than MIST expects. The warning shows up if the stage repeatability is >10pixels, but that was an arbitrary threshold we chose base on high quality motorized stages. The real test is whether the result image looks correct to you. Also, if you are just using the image positions, you can assemble the stitched image outside of Fiji using https://github.com/usnistgov/MIST/blob/master/assemble_stitched_image.py. |
Happy to hear you've gotten things to work, and for sharing your performance numbers! I will add another TODO item to my list where we can pass in the image-statistics file at the command-line, while customizing it by specifying other options. My thought right now for instance is to have java - jar MIST.jar --config-file /path/to/config --gridHeight 4 --gridWidth 4 ... etc. This would load all options in the config file and then customize grid height and grid width or whatever other parameters. The CLI was developed many years ago, so its very much in need of a refresh. For the illegal reflective access issue that is a bummer. We actually borrowed that snippet of code from a Java Sun engineer many years ago. The functionality in this case was to add a directory to the java library path at runtime. So we'll need to find another way to do this in the future, otherwise FFTW will either not work, or we will need to find another way to handle dynamically loading FFTW. The memory discrepancy could be related to the command-line call to java. There are several options that can be passed to the java virtual machine. Fiddling with these might allow you to increase your virtual machine's RAM: https://docs.oracle.com/cd/E19159-01/819-3681/abeik/index.html As for your dataset that may or may not be challenging. Does the resulting stitched image look good? If you are using the same stage for all of your acquisitions, then tuning your advanced parameters will help the algorithm accurately stitch. In particular horizontal/vertical overlaps and repeatability. These can be used to account for the variable spacing your seeing. |
@mmajurski The 10 pixel threshold being the issue sounds about right. I eventually ended up setting it to 20 and that seemed to solve the issue. TBH I don't quite understand the difference/function of @tblattner thank you for the advice regarding the JVM parameters. I am so out of the Java loop that I hadn't even considered that it might be a matter of changing runtime parameters. The stitched image looks just fine and I ended up setting the parameters you mention based on the grid I generated for the stages coordinates and a generous margin of error on the repeatability. If i could make one suggestions regarding my current understanding of the parameters: "Use image directory as output directory" seems to be a GUI feature that copies the input directory to the output directory which is then explicitly passed to the main program. IMHO it would make sense to make this a feature of the main app itself(toggled by a command line argument) as passing the folder twice is redundant and not passing the output directory results in things getting written to the home directory on my machine. |
@mightimatti If you are interested in playing with the new python version: The basic algorithm is there, but it lacks some of the bells and whistles of the Fiji plugin. |
Hi,
this is more of a feature/support-request than a bug-report and I apologize if it is not appropriate for this format:
I am currently in the process of developing a Python/Tkinter as a user interface for a custom scanner application that produces substantial amounts large, 4-channel whole-slide images, the fine alignment of which I would like to perform using MIST, as it has yielded excellent results on the manual tests I performed. Unfortunately, opening imageJ(even with macro) is very cumbersome. The output of my application is such, that coarse alignment (theoretical position of the tiles based on reproduction ratio and coordinates of mechanical stage) is already calculated, i.e.
TileConfiguration.txt
could be trivially output into a folder along with my filed. What I wish to do is run mist to optimize the fine alignment, as is is a perfect fit for my use case, works well and runs fast.While I understand, that implementing this whole library in python would be a lot of work and I wouldn't dream of requesting this, I feel like formulating a series of commands which allow me to spawn a new process to directly call the underlying Java application(doing away with the need to open imageJ) in a separate process from within my application, might actually be quite simple, I would very much appreciate if you could maybe add a section to the README, detailing what commands would allow an advanced usage to be automated. I saw that some docker files were addest to
master
that seem to do just this, but I couldn't find any documentation on how to use them.thank you for this excellent software in any case
The text was updated successfully, but these errors were encountered: