Skip to content

Commit 7ff1a55

Browse files
add to docs
1 parent 9a290c9 commit 7ff1a55

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

docs/src/index.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ processing.
1313

1414
The main functions provided by this package are:
1515

16-
| Function | Action |
16+
| Function | Action |
1717
|:-------------------------|:---------------|
1818
|[`imfilter`](@ref) | Filter a one, two or multidimensional array img with a kernel by computing their correlation |
1919
|[`imfilter!`](@ref) | Filter an array img with kernel kernel by computing their correlation, storing the result in imgfilt |
@@ -25,7 +25,7 @@ The main functions provided by this package are:
2525
|[`findlocalminima`](@ref) | Returns the coordinates of elements whose value is smaller than all of their immediate neighbors |
2626
|[`findlocalmaxima`](@ref) | Returns the coordinates of elements whose value is larger than all of their immediate neighbors |
2727

28-
Common kernels (filters) are organized in the `Kernel` and `KernelFactors` modules.
28+
Common kernels (filters) are organized in the `Kernel` and `KernelFactors` modules.
2929

3030
A common task in image processing and computer vision is computing
3131
image *gradients* (derivatives), for which there is the dedicated
@@ -80,6 +80,24 @@ transform (FFT). By default, this choice is made based on kernel
8080
size. You can manually specify the algorithm using [`Algorithm.FFT()`](@ref)
8181
or [`Algorithm.FIR()`](@ref).
8282

83+
#### Reusing FFT plans
84+
85+
It is possible to reuse FFT plans if the operation is going to be done on the
86+
same array type and dimensions i.e. on each image of an image stack
87+
88+
```julia
89+
using ImageFiltering, ComputationalResources
90+
imgstack = rand(Float64, 200, 100, 10)
91+
imgstack_filtered = similar(imgstack)
92+
93+
kernel = ImageFiltering.factorkernel(Kernel.LoG(1))
94+
fft_planned = CPU1(ImageFiltering.planned_fft(imgstack_filtered[:,:,1], kernel))
95+
96+
for i in axes(imgstack, 3)
97+
imfilter!(fft_planned, imgstack_filtered[:,:,i], imgstack[:,:,i], kernel)
98+
end
99+
```
100+
83101
### Feature: Multithreading
84102

85103
If you launch Julia with `JULIA_NUM_THREADS=n` (where `n > 1`), then

0 commit comments

Comments
 (0)