Skip to content

Median difference #61

@ns-rse

Description

@ns-rse

As noted in #52 which revises the filtering process which differs somewhat from processing DNA images we need to first
apply a Median difference which...

shifts the lines so that the median of height differences (between vertical neighbour pixels) becomes zero. Therefore
it better preserves large features while it is more sensitive to completely bogus lines.

Options

Scikit-image has
skimage.filters.median()
function which "Return[s] the local median of an image." and it has two "behaviour"/methods, rank which uses the
native skimge.filters.rank.median() and ndimage which calls SciPy
scipy.ndimage.median_filter()
which "Calculate[s] a multidimensional median filter.". This functions has the option axes which...

If None, input is filtered along all axes. Otherwise, input is filtered along the specified axes. When axes is
specified, any tuples used for size, origin, and/or mode must match the length of axes. The ith entry in any of these
tuples corresponds to the ith entry in axes.

The function also notes...

For 2-dimensional images with uint8, float32 or float64 dtypes the specialised function
scipy.signal.medfilt2d
may be faster. It is however limited to constant mode with cval=0.

cval is a value to fill past edges if the mode is constant which adds a fixed value beyond the boundaries, it
defaults to 0.0.

Checking scipy.signal.medfilt2d it
takes a 2-d array as input and then requires the kernel-size which is "the size of the median filter window in eeach
dimension. Elements of kernel_size should be odd
". Whether this permits 0 as a parameter so that the kernel only
extends in the vertical plane will require investigating.

Regardless I think we might be able to use these functions to perform the required median difference filter to the
image but I will have to construct some simple examples (i.e. tests!) to check that they are doing what we require. If
not we'll have to develop the function from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    filterIssues pertaining to the filtering stage of processing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions