Filtering Arrays and Circulant Tensors
TransferFunctions.kern_paddingis useful for determining the padding necessary to perform the full domain filtering of an array.TransferFunctions.ind2subis used in theFilteringMatrixto determine the "kernel" and "parent" indices from the index to theFilteringMatrix.
TransferFunctions.ind2sub — Functionind2sub(inds::DimsInteger, ind::Integer)Convert a linear index ind to a subscript index for the array size inds.
Border Arrays
- The error
TransferFunctions.InvalidBorderExtentis used when the border type does not support the extent requested in theBorderArrayconstructor. If you implement your border type, you must implementTransferFunctions.validextension
TransferFunctions.validextension — Functionvalidextension(b::AbstractBorder, A::AbstractArray)Returns the maximum padding extension that is valid for the border b and the parent array A.
julia> TF.validextension(TF.Circular(), ones(40,40))
((40, 40), (40, 40))
julia> TF.validextension(TF.Symmetric(), ones(40,40))
((39, 39), (39, 39))
julia> TF.validextension(TF.Fill(0), ones(40,40))
((9223372036854775807, 9223372036854775807), (9223372036854775807, 9223372036854775807))- If the border type that you want to implement is determined by an index map on the parent array, you should implement a subtype of
TransferFunctions.IndexMapBorderorTransferFunctions.IndependentIndexMapBorder
TransferFunctions.IndependentIndexMapBorder — TypeIndependentIndexMapBorder{T} <: IndexMapBorder{T}A border that maps the indices of the border independently for each dimension
TransferFunctions.IndexMapBorder — TypeIndexMapBorder{T} <: AbstractBorder{T}A border that maps its values the values of the parent array with a certain index mapping
To implement the IndexBorderMap, you need to implement the method
Base.getindex — Methodmapindex(b::IndexMapBorder{T}, A::AbstractArray{T,N}, I::Vararg{Int,N}) where {T,N}Map the BorderArray index to a parent array index with the given scheme.