ofgulban / segmentator

3D MRI data exploration and segmentation tool.
https://github.com/ofgulban/segmentator/wiki
BSD 3-Clause "New" or "Revised" License
74 stars 13 forks source link

Ncut overlay problem (branch: devel-marian) #30

Closed ofgulban closed 8 years ago

ofgulban commented 8 years ago

When working with low res 2D histogram (for instance with scaling factor 150) the following bug appears:

animated

recognize the shifted border between clicks. In theory this should not happen.

Note: The counts are created with --scale 149 and data is loaded again with the same parameter after ncut computation.

MSchnei commented 8 years ago

It also just creates 3 or 4 subsections, instead of 2. Could the mistake be with the ncut calculation?

animated

ofgulban commented 8 years ago

I think this problem is related to the number of superpixels and the compactness parameter of the superpixels used to create the region adjacency graph.

From scikit-image slic function(whcih we use for superpixels) docstring:

compactness : float, optional
    Balances color proximity and space proximity. Higher values give
    more weight to space proximity, making superpixel shapes more
    square/cubic. In SLICO mode, this is the initial compactness.
    This parameter depends strongly on image contrast and on the
    shapes of objects in the image. We recommend exploring possible
    values on a log scale, e.g., 0.01, 0.1, 1, 10, 100, before
    refining around a chosen value.

I have added --nrSupPix and --compactness parameters to the ncut_prepare.py which will be useful for unusual volume histograms (very low resolution or contrast etc.)

ofgulban commented 8 years ago

Ok this issue seems solved. Users can tweak compactness and number of super pixels to avoid jumping borders.