Short Description

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

Versions

  • Version 1 • Released on: 2013-03-08 17:28:37
    Download
    Description:

    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)

Leave a Review