Skip to content

Commit

Permalink
Merge branch 'master' of ssh+git://pacific.mpi-cbg.de/srv/git/fiji
Browse files Browse the repository at this point in the history
  • Loading branch information
acardona committed Oct 13, 2011
2 parents 31ebfe1 + 22dc3c8 commit 6e625f2
Show file tree
Hide file tree
Showing 21 changed files with 2,228 additions and 322 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
url = ssh://contrib@fiji.sc/srv/git/clojure/
[submodule "bio-formats"]
path = modules/bio-formats
url = ssh://contrib@fiji.sc/srv/git/bio-formats
url = git://dev.loci.wisc.edu/bio-formats.git
[submodule "ij-plugins"]
path = modules/ij-plugins
url = ssh://contrib@fiji.sc/srv/git/ij-plugins
Expand Down
10 changes: 5 additions & 5 deletions Fakefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ ENVOVERRIDES(TOOLS_JAR)=true

SUBMODULE_TARGETS=\
jars/ij.jar \
misc/headless.jar \
plugins/loci_tools.jar \
jars/VectorString.jar \
plugins/TrakEM2_.jar \
Expand Down Expand Up @@ -258,8 +257,6 @@ jars/batik.jar[] <-

# From submodules
jars/ij.jar <- jars/javac.jar modules/ImageJA/
CLASSPATH(misc/headless.jar)=jars/ij.jar
misc/headless.jar <- jars/javac.jar modules/ImageJA/
CLASSPATH(plugins/mpicbg_.jar)=jars/ij.jar:jars/mpicbg.jar
plugins/mpicbg_.jar <- modules/mpicbg/
CLASSPATH(jars/mpicbg.jar)=jars/ij.jar:jars/Jama-1.0.2.jar
Expand Down Expand Up @@ -400,7 +397,6 @@ CLASSPATH(plugins/Series_Labeler.jar)=jars/ij.jar
CLASSPATH(plugins/Gray_Morphology.jar)=jars/ij.jar
CLASSPATH(plugins/IsoData_Classifier.jar)=jars/ij.jar
CLASSPATH(plugins/ToAST_.jar)=jars/ij.jar
CLASSPATH(misc/headless.jar)=jars/ij.jar
CLASSPATH(plugins/AnalyzeSkeleton_.jar)=jars/ij.jar
CLASSPATH(plugins/CPU_Meter.jar)=jars/jna.jar:jars/ij.jar
CLASSPATH(plugins/M_I_P.jar)=jars/ij.jar
Expand All @@ -425,7 +421,7 @@ CLASSPATH(plugins/Volume_Viewer.jar)=jars/ij.jar
CLASSPATH(plugins/Image_5D.jar)=jars/ij.jar
CLASSPATH(jars/batik.jar)=jars/jacl.jar:plugins/loci_tools.jar:jars/jython.jar
CLASSPATH(plugins/Stack_Manipulation.jar)=jars/ij.jar
CLASSPATH(jars/Fiji.jar)=jars/ij.jar
CLASSPATH(jars/Fiji.jar)=jars/ij.jar:jars/javassist.jar
CLASSPATH(plugins/TurboReg_.jar)=jars/ij.jar
CLASSPATH(plugins/RATS_.jar)=jars/ij.jar
CLASSPATH(plugins/Interactive_3D_Surface_Plot.jar)=jars/ij.jar
Expand Down Expand Up @@ -497,6 +493,10 @@ plugins/FFMPEG_IO.jar-cross[src-plugins/FFMPEG_IO/generate.bsh all] <- src-plugi
plugins/*.jar <- src-plugins/*/**/*
jars/*.jar <- src-plugins/*/**/*

# headless.jar

misc/headless.jar[bin/make-headless-jar.bsh] <- jars/Fiji.jar jars/javassist.jar jars/ij.jar

# Fiji launcher

JAVA_LIB_PATH(linux)=lib/i386/client/libjvm.so
Expand Down
2 changes: 1 addition & 1 deletion bin/fiji-other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ esac
case "$main_class" in
fiji.Main|ij.ImageJ)
ij_options="-port7 $ij_options"
CLASSPATH="$FIJI_ROOT/jars/Fiji.jar:$FIJI_ROOT/jars/ij.jar"
CLASSPATH="$FIJI_ROOT/jars/Fiji.jar:$FIJI_ROOT/jars/ij.jar:$FIJI_ROOT/jars/javassist.jar"
;;
*)
CLASSPATH=
Expand Down
4 changes: 4 additions & 0 deletions bin/write-headless-jar.bsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
/*/. 2>/dev/null; exec "$(dirname "$0")"/../fiji "$0" "$@" # exec with fiji */

fiji.Headless.main(new String[0]);
4 changes: 1 addition & 3 deletions fiji.c
Original file line number Diff line number Diff line change
Expand Up @@ -2631,12 +2631,10 @@ static void parse_command_line(void)
string_set_length(class_path, len - 1);
}
else {
if (headless)
string_append_path_list(class_path, fiji_path("misc/headless.jar"));

if (is_default_main_class(main_class)) {
string_append_path_list(class_path, fiji_path("jars/Fiji.jar"));
string_append_path_list(class_path, fiji_path("jars/ij.jar"));
string_append_path_list(class_path, fiji_path("jars/javassist.jar"));
}
else {
if (build_classpath(class_path, fiji_path("plugins"), 0))
Expand Down
56 changes: 56 additions & 0 deletions macros/ImportResultsTable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// This macro imports a saved ImageJ results table,
// or any tab or comma-separated data file.

lineseparator = "\n";
cellseparator = ",\t";

// copies the whole table to an array of lines
lines=split(File.openAsString(""), lineseparator);
if (lines.length==0) return;
path = File.directory + File.name;

// get the columns headers
labels=split(lines[0], cellseparator);
if (labels.length==1)
exit("This is not a tab or comma delimited text file.");
if (labels[0]==" ")
k=1; // it is an ImageJ Results table, skip first column
else
k=0; // it is not a Results table, load all columns

// is this a Results table?
if (k==1 || lines.length<2)
{importResults(); exit;}
items = split(lines[1]);
nonNumeric = false;
for (i=0; i<items.length; i++)
if (isNaN(parseFloat(items[i]))) nonNumeric=true;
if (nonNumeric)
importTable();
else
importResults();
exit;

function importResults() {
for (j=k; j<labels.length; j++)
setResult(labels[j],0,0);
run("Clear Results");
if (k==1)
call("ij.plugin.filter.Analyzer.setDefaultHeadings");
for (i=1; i<lines.length; i++) {
items=split(lines[i], cellseparator);
for (j=k; j<items.length; j++)
setResult(labels[j],i-1,items[j]);
}
updateResults();
}

function importTable() {
name = "["+File.name+"]";
if (!isOpen(File.name))
run("New... ", "name="+name+" type=Table");
f = name;
print(f, "\\Headings:"+lines[0]);
for (i=1; i<lines.length; i++)
print(f, lines[i]);
}
260 changes: 260 additions & 0 deletions macros/StartupMacros.fiji
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
// "StartupMacros"
// The macros and macro tools in this file ("StartupMacros.txt") are
// automatically installed in the Plugins>Macros submenu and
// in the tool bar when ImageJ starts up.

// About the drawing tools.
//
// This is a set of drawing tools similar to the pencil, paintbrush,
// eraser and flood fill (paint bucket) tools in NIH Image. The
// pencil and paintbrush draw in the current foreground color
// and the eraser draws in the current background color. The
// flood fill tool fills the selected area using the foreground color.
// Hold down the alt key to have the pencil and paintbrush draw
// using the background color or to have the flood fill tool fill
// using the background color. Set the foreground and background
// colors by double-clicking on the flood fill tool or on the eye
// dropper tool. Double-click on the pencil, paintbrush or eraser
// tool to set the drawing width for that tool.
//
// Icons contributed by Tony Collins.

// Global variables
var pencilWidth=1, eraserWidth=10, leftClick=16, alt=8;
var brushWidth = 10; //call("ij.Prefs.get", "startup.brush", "10");
var floodType = "8-connected"; //call("ij.Prefs.get", "startup.flood", "8-connected");

// The macro named "AutoRunAndHide" runs when ImageJ starts
// and the file containing it is not displayed when ImageJ opens it.

// macro "AutoRunAndHide" {}

function UseHEFT {
requires("1.38f");
state = call("ij.io.Opener.getOpenUsingPlugins");
if (state=="false") {
setOption("OpenUsingPlugins", true);
showStatus("TRUE (images opened by HandleExtraFileTypes)");
} else {
setOption("OpenUsingPlugins", false);
showStatus("FALSE (images opened by ImageJ)");
}
}

UseHEFT();

// The macro named "AutoRun" runs when ImageJ starts.

//macro "AutoRun" {}


var pmCmds = newMenu("Popup Menu",
newArray("Help...", "Rename...", "Duplicate...", "Original Scale",
"Paste Control...", "-", "Record...", "Capture Screen ", "Monitor Memory...",
"Find Commands...", "Control Panel...", "Startup Macros...", "Search..."));

macro "Popup Menu" {
cmd = getArgument();
if (cmd=="Help...")
showMessage("About Popup Menu",
"To customize this menu, edit the line that starts with\n\"var pmCmds\" in ImageJ/macros/StartupMacros.txt.");
else
run(cmd);
}

macro "Abort Macro or Plugin (or press Esc key) Action Tool - CbooP51b1f5fbbf5f1b15510T5c10X" {
setKeyDown("Esc");
}

var xx = requires138b(); // check version at install
function requires138b() {requires("1.38b"); return 0; }

var dCmds = newMenu("Developer Menu Tool",
newArray("ImageJ Website","News", "Documentation", "ImageJ Wiki", "Resources", "Macro Language", "Macros",
"Macro Functions", "Startup Macros...", "Plugins", "Source Code", "Mailing List Archives", "-", "Record...",
"Capture Screen ", "Monitor Memory...", "List Commands...", "Control Panel...", "Search...", "Debug Mode"));

macro "Developer Menu Tool - C037T0b11DT7b09eTcb09v" {
cmd = getArgument();
if (cmd=="ImageJ Website")
run("URL...", "url=http://rsbweb.nih.gov/ij/");
else if (cmd=="News")
run("URL...", "url=http://rsbweb.nih.gov/ij/notes.html");
else if (cmd=="Documentation")
run("URL...", "url=http://rsbweb.nih.gov/ij/docs/");
else if (cmd=="ImageJ Wiki")
run("URL...", "url=http://imagejdocu.tudor.lu/imagej-documentation-wiki/");
else if (cmd=="Resources")
run("URL...", "url=http://rsbweb.nih.gov/ij/developer/");
else if (cmd=="Macro Language")
run("URL...", "url=http://rsbweb.nih.gov/ij/developer/macro/macros.html");
else if (cmd=="Macros")
run("URL...", "url=http://rsbweb.nih.gov/ij/macros/");
else if (cmd=="Macro Functions")
run("URL...", "url=http://rsbweb.nih.gov/ij/developer/macro/functions.html");
else if (cmd=="Plugins")
run("URL...", "url=http://rsbweb.nih.gov/ij/plugins/");
else if (cmd=="Source Code")
run("URL...", "url=http://rsbweb.nih.gov/ij/developer/source/");
else if (cmd=="Mailing List Archives")
run("URL...", "url=https://list.nih.gov/archives/imagej.html");
else if (cmd=="Debug Mode")
setOption("DebugMode", true);
else if (cmd!="-")
run(cmd);
}

var sCmds = newMenu("Stacks Menu Tool",
newArray("Add Slice", "Delete Slice", "Next Slice [>]", "Previous Slice [<]", "Set Slice...", "-",
"Convert Images to Stack", "Convert Stack to Images", "Make Montage...", "Reslice [/]...", "Z Project...",
"3D Project...", "Plot Z-axis Profile", "-", "Start Animation", "Stop Animation", "Animation Options...",
"-", "MRI Stack (528K)"));
macro "Stacks Menu Tool - C037T0b11ST8b09tTcb09k" {
cmd = getArgument();
if (cmd!="-") run(cmd);
}

var luts = getLutMenu();
var lCmds = newMenu("LUT Menu Tool", luts);
macro "LUT Menu Tool - C037T0b11LT6b09UTcb09T" {
cmd = getArgument();
if (cmd!="-") run(cmd);
}
function getLutMenu() {
list = getLutList();
menu = newArray(16+list.length);
menu[0] = "Invert LUT"; menu[1] = "Apply LUT"; menu[2] = "-";
menu[3] = "Fire"; menu[4] = "Grays"; menu[5] = "Ice";
menu[6] = "Spectrum"; menu[7] = "3-3-2 RGB"; menu[8] = "Red";
menu[9] = "Green"; menu[10] = "Blue"; menu[11] = "Cyan";
menu[12] = "Magenta"; menu[13] = "Yellow"; menu[14] = "Red/Green";
menu[15] = "-";
for (i=0; i<list.length; i++)
menu[i+16] = list[i];
return menu;
}

function getLutList() {
lutdir = getDirectory("luts");
list = newArray("No LUTs in /ImageJ/luts");
if (!File.exists(lutdir))
return list;
rawlist = getFileList(lutdir);
if (rawlist.length==0)
return list;
count = 0;
for (i=0; i< rawlist.length; i++)
if (endsWith(rawlist[i], ".lut")) count++;
if (count==0)
return list;
list = newArray(count);
index = 0;
for (i=0; i< rawlist.length; i++) {
if (endsWith(rawlist[i], ".lut"))
list[index++] = substring(rawlist[i], 0, lengthOf(rawlist[i])-4);
}
return list;
}

macro "Pencil Tool - C037L494fL4990L90b0Lc1c3L82a4Lb58bL7c4fDb4L5a5dL6b6cD7b" {
getCursorLoc(x, y, z, flags);
if (flags&alt!=0)
setColorToBackgound();
draw(pencilWidth);
}

macro "Paintbrush Tool - C037La077Ld098L6859L4a2fL2f4fL3f99L5e9bL9b98L6888L5e8dL888c" {
getCursorLoc(x, y, z, flags);
if (flags&alt!=0)
setColorToBackgound();
draw(brushWidth);
}

macro "Flood Fill Tool -C037B21P085373b75d0L4d1aL3135L4050L6166D57D77D68La5adLb6bcD09D94" {
requires("1.34j");
setupUndo();
getCursorLoc(x, y, z, flags);
if (flags&alt!=0) setColorToBackgound();
floodFill(x, y, floodType);
}

function draw(width) {
requires("1.32g");
setupUndo();
getCursorLoc(x, y, z, flags);
setLineWidth(width);
moveTo(x,y);
x2=-1; y2=-1;
while (true) {
getCursorLoc(x, y, z, flags);
if (flags&leftClick==0) exit();
if (x!=x2 || y!=y2)
lineTo(x,y);
x2=x; y2 =y;
wait(10);
}
}

function setColorToBackgound() {
savep = getPixel(0, 0);
makeRectangle(0, 0, 1, 1);
run("Clear");
background = getPixel(0, 0);
run("Select None");
setPixel(0, 0, savep);
setColor(background);
}

// Runs when the user double-clicks on the pencil tool icon
macro 'Pencil Tool Options...' {
pencilWidth = getNumber("Pencil Width (pixels):", pencilWidth);
}

// Runs when the user double-clicks on the paint brush tool icon
macro 'Paintbrush Tool Options...' {
brushWidth = getNumber("Brush Width (pixels):", brushWidth);
call("ij.Prefs.set", "startup.brush", brushWidth);
}

// Runs when the user double-clicks on the flood fill tool icon
macro 'Flood Fill Tool Options...' {
Dialog.create("Flood Fill Tool");
Dialog.addChoice("Flood Type:", newArray("4-connected", "8-connected"), floodType);
Dialog.show();
floodType = Dialog.getChoice();
call("ij.Prefs.set", "startup.flood", floodType);
}

macro "Set Drawing Color..."{
run("Color Picker...");
}

macro "-" {} //menu divider

macro "About Startup Macros..." {
title = "About Startup Macros";
id = "[" + title + "]";
if (isOpen(title))
print(id, "\\Update");
else
run("Text Window...", "name=" + id + " width=65 height=8");
print(id, "Macros, such as this one, contained in a file named 'StartupMacros.txt',\n"
+ "located in the 'macros' folder inside the Fiji folder, are automatically\n"
+ "installed in the Plugins>Macros menu when Fiji starts.\n"
+ "\n"
+ "More information is available at:\n"
+ "<http://rsb.info.nih.gov/ij/developer/macro/macros.html>");
}

macro "Save As JPEG... [j]" {
quality = call("ij.plugin.JpegWriter.getQuality");
quality = getNumber("JPEG quality (0-100):", quality);
run("Input/Output...", "jpeg="+quality);
saveAs("Jpeg");
}

macro "Save Inverted FITS" {
run("Flip Vertically");
run("FITS...", "");
run("Flip Vertically");
}
Binary file removed precompiled/headless.jar
Binary file not shown.
Loading

0 comments on commit 6e625f2

Please sign in to comment.