Created
August 17, 2020 22:30
-
-
Save shinwachi/44823769720fef142907a15087571648 to your computer and use it in GitHub Desktop.
Fiji jython script to save particle analysis summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Implementation of soultion listed here: https://forum.image.sc/t/solved-save-summary-in-headlessmode/26606/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from ij import IJ | |
| from ij import Prefs | |
| from ij.measure import ResultsTable | |
| from ij.plugin.filter import ParticleAnalyzer | |
| rt = ResultsTable() | |
| ParticleAnalyzer.setSummaryTable(rt) | |
| imp = IJ.openImage("/home/jovyan/work/Images/some.JPG"); | |
| print imp | |
| IJ.run(imp, "8-bit", ""); | |
| IJ.setRawThreshold(imp, 34, 255, None); | |
| Prefs.blackBackground = True; | |
| IJ.run(imp, "Convert to Mask", ""); | |
| IJ.run("Close"); | |
| IJ.run(imp, "Analyze Particles...", " circularity=0.20-1.00 show=Ellipses display clear summarize"); | |
| # this won't work in headless mode as there is no window ( | |
| #IJ.renameResults("Summary", "Results"); | |
| #IJ.saveAs("Results", "/home/jovyan/work/Summary.csv"); | |
| rt.save( "/home/jovyan/work/Summary.csv"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment