MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / multiply

Method multiply

ij/src/main/java/ij/plugin/FFT.java:147–165  ·  view source on GitHub ↗

Multiplies a Fourier domain image by a filter @param imp A frequency domain image, which is modified. @param filter The filter, 32-bits (0-1) or 8-bits (0-255) @see #forward @see #inverse @see #filter

(ImagePlus imp, ImageProcessor filter)

Source from the content-addressed store, hash-verified

145 * @see #filter
146 */
147 public static void multiply(ImagePlus imp, ImageProcessor filter) {
148 Object obj = imp.getProperty("FHT");
149 FHT fht = obj!=null&&(obj instanceof FHT)?(FHT)obj:null;
150 if (fht==null)
151 return;
152 int size = fht.getWidth();
153 boolean isFloat = filter.getBitDepth()==32;
154 if (!isFloat)
155 filter = filter.convertToByte(true);
156 filter = filter.resize(size, size);
157 swapQuadrants(filter);
158 float[] fhtPixels = (float[])fht.getPixels();
159 for (int i=0; i<fhtPixels.length; i++) {
160 if (isFloat)
161 fhtPixels[i] = fhtPixels[i]*filter.getf(i);
162 else
163 fhtPixels[i] = (float)(fhtPixels[i]*(filter.get(i)/255.0));
164 }
165 }
166
167 /**
168 * Performs an inverse FHT transform.

Callers 5

filterMethod · 0.95
runMethod · 0.45
getAverageMethod · 0.45
processImageMethod · 0.45
quickOptiSolverMethod · 0.45

Calls 9

swapQuadrantsMethod · 0.95
getPropertyMethod · 0.45
getWidthMethod · 0.45
getBitDepthMethod · 0.45
convertToByteMethod · 0.45
resizeMethod · 0.45
getPixelsMethod · 0.45
getfMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected