-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathscaleFree.ijm
More file actions
48 lines (34 loc) · 982 Bytes
/
scaleFree.ijm
File metadata and controls
48 lines (34 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// CLIJ example macro: project3D.ijm
//
// This macro shows how to rotate an image in the GPU.
//
// Author: Robert Haase
// January 2019
// ---------------------------------------------
run("Close All");
// Get test data
run("Blobs (25K)");
//open("C:/structure/data/blobs.gif");
zoom_step = 0.03;
run("32-bit");
rename("original");
getDimensions(width, height, channels, depth, frames);
// init GPU
run("CLIJ Macro Extensions", "cl_device=");
Ext.CLIJ_clear();
// push images to GPU
Ext.CLIJ_push("original");
// reserve the right amount of memory for the result image
Ext.CLIJ_create3D("target", width, height, 1.0 / zoom_step, 32);
// cleanup imagej
run("Close All");
count = 0;
for (zoom = 1; zoom > 0; zoom -= zoom_step) {
Ext.CLIJ_scale2D("original", "zoomed", zoom, true);
// put the zoomed image in the right place in the result stack
Ext.CLIJ_copySlice("zoomed", "target", count);
count++;
}
// show result
Ext.CLIJ_pull("target");
run("Invert LUT");