-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRGB FFT.ijm
32 lines (26 loc) · 936 Bytes
/
RGB FFT.ijm
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
//return current image to "image" variable
image = getImageID();
originalimage = getTitle();
//check if image is RGB. if not, exit.
if (bitDepth() != 24)
exit ("Error: RGB Color image required.");
//duplicate the image and split the RGB channels
run("Duplicate...", " ");
selectWindow(originalimage);
run("Split Channels");
//FFT each color channel individually, then close the channel image
selectWindow(originalimage + " (red)");
run("FFT");
selectWindow(originalimage + " (red)");
close();
selectWindow(originalimage + " (green)");
run("FFT");
selectWindow(originalimage + " (green)");
close();
selectWindow(originalimage + " (blue)");
run("FFT");
selectWindow(originalimage + " (blue)");
close();
//merge the single-channel FFT, rename it
run("Merge Channels...", "c1=[FFT of "+originalimage+" (red)] c2=[FFT of "+originalimage+" (green)] c3=[FFT of "+originalimage+" (blue)] keep");
rename('RGB FFT of ' + originalimage);