3D SLIC code

Stéfan van der Walt stefan at sun.ac.za
Mon Mar 11 03:36:30 EDT 2013


On Mon, Mar 11, 2013 at 8:43 AM, Juan Nunez-Iglesias <jni.soma at gmail.com> wrote:
> I want to modify SLIC to handle 3D images. However, it now become rather
> tricky to automatically detect whether the final dimension is channels or
> just z, in the case of image.ndim == 3 (ie, is this a 3D grayscale image, or
> a 2D RGB image?). I was trying to do something automatically (image.ndim ==
> 3 and image.shape[-1] == 3) but I think maybe the easiest thing is to add a
> "has_channels" argument, defaulting to...? I want to say False, but that's
> just my own biases. =)

In `random_walker`, we've opted for "multichannel=False":

    data : array_like
        Image to be segmented in phases. Gray-level `data` can be two- or
        three-dimensional; multichannel data can be three- or four-
        dimensional (multichannel=True) with the highest dimension denoting
        channels. Data spacing is assumed isotropic unless depth keyword
        argument is used.

    multichannel : bool, default False
        If True, input data is parsed as multichannel data (see 'data' above
        for proper input format in this case)

Stéfan



More information about the scikit-image mailing list