Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notes: special function/nodes skimage #463

Open
tokiAi opened this issue Dec 4, 2023 · 0 comments
Open

notes: special function/nodes skimage #463

tokiAi opened this issue Dec 4, 2023 · 0 comments
Labels

Comments

@tokiAi
Copy link
Collaborator

tokiAi commented Dec 4, 2023

Special skimage functions/nodes:

This is a documentation about functions that are special in skimage (order of documentation have no meaning):


  • Skimage channel_axis argument need to concidered [If None (default argument), the image is assumed to be a grayscale (single channel) image. Otherwise, this parameter indicates which axis of the array corresponds to channels.]:
    like in:

skimage.transform.rescale(image, scale, order=None, mode='reflect', cval=0, clip=True, preserve_range=False, anti_aliasing=None, anti_aliasing_sigma=None, *, channel_axis=None)


  • Some functions are with Key Words Only Arguments: only some examples, there are more:

skimage.feature.canny(image, sigma=1.0, low_threshold=None, high_threshold=None, mask=None, use_quantiles=False, *, mode='constant', cval=0.0)

solved it for now in the "codeGenerator" like this: added extra strings [mode=, cval=]

...${outputs[1]} = canny(${inputs[1]}['value'], ${inputs[2]}, ${inputs[3]}, ${inputs[4]}, ${inputs[5]}, ${inputs[6]}, mode=${inputs[7]}, cval=${inputs[8]}) ...


  • skimage.morphology.disk: input: dtype is the data type of the footprint.

solved for now like:

"dtype": {
          "title": "dtype",
          "dataType": "anyDataType",
          "defaultValue": "np.uint8",
          "tooltip": "The data type of the footprint."
        }

  • skimage.restoration.denoise_wavelet: PyWavelets needed to be installed for this.

  • skimage.util.img_as_uint: output: converted image as 16-bit unsigned integer format.

solved for now like:

DELETED


  • Some function can take multiple different argument types like (as
    example - there are more):

skimage.segmentation.watershed connectivity as default 1 (Type: integer) but more flexibility give a ndarray (it is also used in the documentation of the function):

connectivity: ndarray, optional
An array with the same number of dimensions as image whose non-zero elements indicate neighbors for connection. Following the scipy convention, default is a one-connected array of the dimension of the image.

solved with a list/array:

"connectivity": {
          "title": "connectivity",
          "dataType":  ["integer", "numpy.ndarray"],
          "defaultValue": 1,
          "tooltip": "An array with the same number of dimensions as image whose non-zero elements indicate neighbors for connection. Scalar value '1' means 4-connectivity, and '2' would mean 8-connectivity in a 2D spaace."
        }

  • skimage.measure.label is a function with dynamic outputs (returns) number:

Returns (from skimage doc.): labels, num

num: int, optional
Number of labels, which equals the maximum label index and is only returned if return_num is True.

solved with as: return_num is allways True


  • skimage.measure.label2rgb have the image as optional and at the second argument:

skimage.color.label2rgb(label, image=None, colors=None, alpha=0.3, bg_label=0, bg_color=(0, 0, 0), image_alpha=1, kind='overlay', *, saturation=0, channel_axis=-1)


  • Input argument can be inf (np.inf):

e.g skimage.feature.peak_local_max
solved as anyDataType type: e.g.


"num_peaks": {
          "title": "num_peaks",
          "dataType": "anyDataType",
          "defaultValue": "np.inf",
          "tooltip": "Maximum number of peaks."

or

"p_norm": {
          "title": "p_norm",
          "dataType": "anyDataType",
          "defaultValue": "np.inf",
          "tooltip": "Which Minkowski p-norm to use. Should be in the range [1, inf]. inf corresponds to the Chebyshev distance and 2 to the Euclidean distance."
        }

  • Input argument can be range(...):

e.g skimage.filters.meijering (Ridge_operators)
solved as anyDataType type: e.g.

"sigmas": {
          "title": "sigmas",
          "dataType": "anyDataType",
          "defaultValue": "range(1, 10, 2)",
          "tooltip": "optional iterable of floats indicating scales for the filter. default from doc: range(1, 10, 2) but possible also np.arange(1, 10, 2)"
        }
@tokiAi tokiAi added the notes label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant