-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add macro examples from OME 2020 NGFF workshop #69
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the support of Jython in Fiji, we rewrote all our omero training scripts in groovy
Only one script is in groovy. It might be better to only add groovy scripts
import ij.ImagePlus | ||
|
||
// configuration | ||
String file = "/path/to/inputFile.tiff" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to let the user select the file to open
file = IJ.getFilePath("Choose a Tiff File")
if (file == null) {
println "cancel"
return
}
path = file.take(file.lastIndexOf('.'))
outFile = path + ".ome.tiff"
options.setId(outFile) | ||
options.setSeriesOn(2, true) | ||
ImagePlus[] imps = BF.openImagePlus(options) | ||
imps[0].show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imps[0].show() | |
imps[0].show() | |
options.setSeriesOn(2, True); | ||
imps = BF.openImagePlus(options) | ||
for imp in imps: | ||
imp.show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imp.show() | |
imp.show() | |
import math | ||
|
||
# configuration | ||
file = "/path/to/inputFile.tiff" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file = IJ.getFilePath("Choose a Tiff File")
if file is None:
print("cancel")
sys.exit(2)
path = ('.').join(file.split('.')[:-1])
outFile = path + ".ome.tiff"
from ome.xml.model.primitives import PositiveInteger | ||
from java.lang import Math | ||
from ij import IJ | ||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import math | |
import math | |
import sys |
from ome.xml.model.primitives import PositiveInteger | ||
from ome.units import UNITS | ||
from java.lang import Math | ||
from ij import IJ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from ij import IJ | |
from ij import IJ | |
import sys |
writer.saveBytes(0, downsample) | ||
|
||
writer.close() | ||
reader.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reader.close() | |
reader.close() | |
IJ.log("Done") | |
from ome.xml.model.primitives import PositiveInteger | ||
from java.lang import Math | ||
from ij import IJ | ||
import math |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import math | |
import math | |
import sys |
import math | ||
|
||
# configuation | ||
file = "/path/to/inputFile.tiff" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file = IJ.getFilePath("Choose a Tiff File")
if file is None:
print("cancel")
sys.exit(2)
path = ('.').join(file.split('.')[:-1])
outFile = path + ".ome.tiff"
# close reader and writer | ||
writer.close() | ||
reader.close() | ||
IJ.log("Done") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IJ.log("Done") | |
IJ.log("Done") | |
Adding 3 new python macro examples and a groovy example.
This have been created for the OME 2020 workshop on next gen file formats. The goal of them is to show how to use tiled and pyramidal conversions to allow large plane (>2GB) images to be opened within the ImageJ environment.
The ImageJ Macro and plugins examples have typically lived in the
bio-formats_plugins/utils
folder. It would be good to start building a larger range of macro scripting examples in theThe one major outstanding issue with creating examples here is the ongoing testing implications for these macros.