Project

General

Profile

Files ยป Next_Image_As_Hyperstack_Tool.txt

open rgb images one after the other as hyperstack - Volker Baecker, 04/24/2012 05:26 PM

 
/**
* MRI Next_Image_As_Hyperstack_Tool
*
* Open the first image in a folder with rgb images. Press the "c" button to convert the image to a hyperstack.
* With the "n" button you can now open the next image in the folder and it will automatically be opened as
* a hyperstack.
*
* written 2012 by Volker Baecker (INSERM) at Montpellier RIO Imaging (www.mri.cnrs.fr)
*/

var helpURL = "http://dev.mri.cnrs.fr/wiki/imagej-macros/Next_Image_As_Hyperstack_Tool";
var display_modes = newArray("Composite", "Color", "Grayscale");
var display_mode = "Color";

macro "Unused Tool - C037" { }

macro "Next Image As Hyperstack Tool Help Action Tool - C000T4b12?"{
run('URL...', 'url='+helpURL);
}

macro "Convert image to hyperstack Action Tool - C000T4b12c" {
run("RGB Stack");
run("Stack to Hyperstack...", "order=xyczt(default) channels=3 slices=1 frames=1 display="+display_mode);
}

macro "Convert image to hyperstack Action Tool Options" {
getOptionsFromUser();
}

macro "Next image as hyperstack Action Tool - C000T4b12n" {
Stack.setChannel(1);
run("Open Next");
run("RGB Stack");
run("Stack to Hyperstack...", "order=xyczt(default) channels=3 slices=1 frames=1 display="+display_mode);
}

macro "Next image as hyperstack Action Tool Options" {
getOptionsFromUser();
}

function getOptionsFromUser() {
Dialog.create("Next Image As Hyperstack Options");
Dialog.addChoice("display mode", display_modes, display_mode);
Dialog.show();
display_mode = Dialog.getChoice();
}
    (1-1/1)