Skip to content

Fix for ImageJ macro for scaling on newer ImageJ versions #1

@BrainofZedZed

Description

@BrainofZedZed

Changing the way the string of the path is handled lets the macro run on newer ImageJ versions after 1.5.2 (tested on 1.5.4)

Line 5 should have brackets around the path which will looks like:
run("Image Sequence...", "open=[" + path + "] sort use");

Making the updated thing:

// Takes unscaled data and scales it to a 10um space. Also converts to 8-bit.
paths = newArray("E:\\DeSousa_cleared_brains\\5B\\488\\15-29-24_5B_488_UltraII_C00_xyz-Table Z0000.ome.tif");
for (i=0; i<paths.length; i++) {
	path = paths[i];
	run("Image Sequence...", "open=[" + path + "] sort use");
	run("Scale...", "x=0.40625 y=0.40625 z=0.3 interpolation=Bilinear average process create");
	run("8-bit");
	parent = File.getParent(path);
	dir = File.getParent(parent) + File.separator + File.getName(parent) + "_scaled";
	File.makeDirectory(dir);
	name = "10um";
	saveAs("Tiff", dir+File.separator+name);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions