importClass(Packages.plugins.tprovoost.scripteditor.uitools.filedialogs.FileDialog)
importClass(Packages.icy.sequence.SequenceUtil)
importClass(Packages.icy.imagej.ImageJUtil)
importClass(Packages.ij.IJ)
// the path to the file
file = FileDialog.open()
if (file == null) throw "No File selected"
// Get the focused sequence, test if null or not.
seq = getSequence()
if (seq == null) throw "No sequence opened"
// Convert the sequence into an understanble object for ImageJ
imPlus = ImageJUtil.convertToImageJImage(seq, null)
/*
* Run the IJ Plugin
*/
IJ.runMacroFile(file.getPath())
// Convert the result back to a sequence
seqResult = ImageJUtil.convertToIcySequence(imPlus, null)
seqResult.setName(seq.getName() + " - IJ treated")
// perform changes
gui.addSequence(seqResult)