Need help or advice ? Come to the Icy club ! - Every Wenesday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur
Register

Call IJ Macro

by tprovoost / Thomas Provoost

Call a full macro from the script, and conversions between Icy and IJ.

version 1 (last version):

download to use and modify in Icy. How do I use scripts ? A Problem ? ask the community.
Changelog for this version: initial version
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)

This script has no documentation. A Problem ? ask the community.



Icy script publication Id : Q7C2F6