From randy.heiland at gmail.com Thu Jan 4 12:15:49 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Thu, 4 Jan 2018 12:15:49 -0500 Subject: [scikit-image] shrink-wrapping filopodia Message-ID: Hello, and thanks for the great software! I thought I'd ask this community for suggestions on extracting the outline/shape of some images involving biological filopodia. I've attached a sample image where I manually captured one potential outline. And I've put my initial scripts, data, results here: https://github.com/rheiland/image_proc I tried to "close" (edge2.py) the noisy edges, thinking that would be a logical first step, but it didn't really do what I'd hoped. thanks, Randy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: img_35_ppt.jpg Type: image/jpeg Size: 33425 bytes Desc: not available URL: From stefanv at berkeley.edu Thu Jan 4 16:10:03 2018 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Thu, 04 Jan 2018 13:10:03 -0800 Subject: [scikit-image] Position at BIDS (UC Berkeley) to work on NumPy Message-ID: <1515100203.2958351.1224556536.082369E3@webmail.messagingengine.com> Hi everyone, The Berkeley Institute for Data Science (BIDS) is hiring scientific Python Developers to contribute to NumPy. You can read more about the new positions here: https://bids.berkeley.edu/news/bids-receives-sloan-foundation-grant-contribute-numpy-development If you enjoy collaborative work as well as the technical challenges posed by numerical computing, this is an excellent opportunity to play a fundamental role in the development of one of the most impactful libraries in the entire Python ecosystem. Best regards St?fan Job link: https://jobsprod.is.berkeley.edu/psc/jobsprod/EMPLOYEE/HRMS/c/HRS_HRAM.HRS_CE.GBL?Page=HRS_CE_JOB_DTL&Action=A&JobOpeningId=24142&SiteId=1&PostingSeq=1 From randy.heiland at gmail.com Sun Jan 7 17:47:56 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Sun, 7 Jan 2018 17:47:56 -0500 Subject: [scikit-image] fill closed contour Message-ID: If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. thanks, Randy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Sun Jan 7 18:57:22 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 8 Jan 2018 10:57:22 +1100 Subject: [scikit-image] fill closed contour In-Reply-To: References: Message-ID: Hi Randy, I was going to suggest binary fill holes. Do you mind posting your image and the code you?ve tried so we can troubleshoot? Thanks, Juan. On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , wrote: > If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. > > thanks, Randy > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From randy.heiland at gmail.com Sun Jan 7 20:21:01 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Sun, 7 Jan 2018 20:21:01 -0500 Subject: [scikit-image] fill closed contour In-Reply-To: References: Message-ID: Sure - thanks. from skimage.morphology import disk from skimage.feature import canny from scipy import ndimage as ndi import matplotlib.pyplot as plt image = disk(100) for ix in range(200): for iy in range(200): xdel=ix-100 ydel=iy-100 if (xdel*xdel/50 + ydel*ydel/10) < 110: image[iy,ix]=0 elif (xdel*xdel/10 + ydel*ydel/50) < 110: image[iy,ix]=0 edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! fill = ndi.binary_fill_holes(edges) # I don't understand the params; can I seed a region to fill? fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) ax = axes.ravel() ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') #ax[0].imshow(invert_img, cmap=plt.cm.gray) #ax[0].set_title('Inverted image') ax[0].set_title('Original image') ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') ax[1].set_title('Canny edges') ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') ax[2].set_title('Fill') plt.show() On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias wrote: > Hi Randy, I was going to suggest binary fill holes. Do you mind posting > your image and the code you?ve tried so we can troubleshoot? > > Thanks, > > Juan. > > On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , > wrote: > > If I have a binary image with, say, just a contour boundary (simple > example: a white background with a black circle, i.e. an "o"), how can I > fill the inside of the contour? I've played with both the watershed > segmentation and the scipy.ndimage.binary_fill_holes, without success. > > thanks, Randy > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ring_fill.png Type: image/png Size: 20093 bytes Desc: not available URL: From jni.soma at gmail.com Sun Jan 7 23:36:52 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 8 Jan 2018 15:36:52 +1100 Subject: [scikit-image] fill closed contour In-Reply-To: References: Message-ID: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> Oh, I see what's happening. So, in your case, both void spaces are actually holes from the perspective of the binary_fill_holes algorithm, so they both get filled. I suggest you a) label both contours using ndi.label b) use binary_fill_holes on each label separately c) subtract the filled inner hole from the filled outer hole (you can optionally add back in the inner contour if you care about that single-pixel precision) This requires being able to robustly identify the inner and outer contours, but I don't think that should be too hard? If you only have two, you can certainly find them by finding the "larger" of the two bounding boxes. You can use skimage.measure.regionprops for this. I hope that helps! Juan. On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , wrote: > Sure - thanks. > > from skimage.morphology import disk > from skimage.feature import canny > from scipy import ndimage as ndi > import matplotlib.pyplot as plt > > image = disk(100) > for ix in range(200): > ? for iy in range(200): > ? ? xdel=ix-100 > ? ? ydel=iy-100 > ? ? if (xdel*xdel/50 + ydel*ydel/10) < 110: > ? ? ? image[iy,ix]=0 > ? ? elif (xdel*xdel/10 + ydel*ydel/50) < 110: > ? ? ? image[iy,ix]=0 > > edges = canny(image*255.)? # canny expect grayscale, i.e. 0-255 ??! > > fill = ndi.binary_fill_holes(edges)? ?# I don't understand the params; can I seed a region to fill? > > fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) > ax = axes.ravel() > > ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') > #ax[0].imshow(invert_img, cmap=plt.cm.gray) > #ax[0].set_title('Inverted image') > ax[0].set_title('Original image') > > ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > ax[1].set_title('Canny edges') > > ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') > ax[2].set_title('Fill') > > plt.show() > > > > > On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias wrote: > > > Hi Randy, I was going to suggest binary fill holes. Do you mind posting your image and the code you?ve tried so we can troubleshoot? > > > > > > Thanks, > > > > > > Juan. > > > > > > On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , wrote: > > > > If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. > > > > > > > > thanks, Randy > > > > _______________________________________________ > > > > scikit-image mailing list > > > > scikit-image at python.org > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > _______________________________________________ > > > scikit-image mailing list > > > scikit-image at python.org > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmedtabia2 at gmail.com Mon Jan 8 08:07:43 2018 From: ahmedtabia2 at gmail.com (ahmed tabia) Date: Mon, 8 Jan 2018 14:07:43 +0100 Subject: [scikit-image] import name haar_like_feature_coord Message-ID: hello how i can add the haar feature to anaconda because when i installed scikit-image , and when i run application with haar feature this message was affiched "cannot import name haar_like_feature_coord" thanx Ahmed -------------- next part -------------- An HTML attachment was scrubbed... URL: From vukovicnikola at gmail.com Mon Jan 8 12:18:28 2018 From: vukovicnikola at gmail.com (Nikola Vukovic) Date: Mon, 8 Jan 2018 18:18:28 +0100 Subject: [scikit-image] Convexity defects in scikit-image Message-ID: Hi! Happy New Year! Does anyone know if it?s possible to calculate convexity defects (relative to convex hull) in scikit-image? An online tutorial or code sample would be much appreciated? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Mon Jan 8 18:58:21 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 9 Jan 2018 10:58:21 +1100 Subject: [scikit-image] import name haar_like_feature_coord In-Reply-To: References: Message-ID: <16c557b3-f7bf-4363-a33d-9e6b31f9b86d@Spark> Hi Ahmed, Haar features are in an as-yet unreleased version of scikit-image. If you have properly set up Cython and C compilers, you should be able to do: python -m pip install git+https://github.com/scikit-image/scikit-image to get the latest source version, including Haar-like features. Or you can wait until mid-february until we release the next version. Juan. On 9 Jan 2018, 12:08 AM +1100, ahmed tabia , wrote: > hello how i can add the haar feature to anaconda because when? i installed scikit-image , and when i run application with haar feature this message was affiched > > ?"cannot import name haar_like_feature_coord" > > thanx Ahmed > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From randy.heiland at gmail.com Mon Jan 8 20:55:53 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Mon, 8 Jan 2018 20:55:53 -0500 Subject: [scikit-image] fill closed contour In-Reply-To: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> References: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> Message-ID: Thanks Juan. I understand better what the ndi.measurements.label can do for me now. I've tweaked my previous script and attached the resulting output. Does it make sense that I need to "thicken" the contours in order to get the desired features/regions, or is there something I'm still missing? ------------ from skimage.morphology import disk from skimage.feature import canny from skimage.filters import rank from scipy import ndimage as ndi import matplotlib.pyplot as plt import numpy as np image = disk(100) for ix in range(200): for iy in range(200): xdel=ix-100 ydel=iy-100 if (xdel*xdel/50 + ydel*ydel/10) < 110: image[iy,ix]=0 elif (xdel*xdel/10 + ydel*ydel/50) < 110: image[iy,ix]=0 edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! thicken = rank.gradient(edges, disk(1)) < 5 bdy = thicken.astype(np.uint8)*255 labeled_array, num_features = ndi.measurements.label(edges*1) print("num_features (edges*1)=",num_features) labeled_array2, num_features2 = ndi.measurements.label(bdy) print("num_features (thick)=",num_features2) fill = ndi.binary_fill_holes(edges) fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) ax = axes.ravel() ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') ax[0].set_title('Canny edges') ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') ax[1].set_title('labeled_array') ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') ax[2].set_title('bdy') ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, interpolation='nearest') ax[3].set_title('labeled_array2') plt.axis('off') plt.show() --> num_features (edges*1)= 216 num_features (thick)= 6 -Randy On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias wrote: > Oh, I see what's happening. So, in your case, both void spaces are > actually holes from the perspective of the binary_fill_holes algorithm, so > they both get filled. I suggest you > > a) label both contours using ndi.label > b) use binary_fill_holes on each label separately > c) subtract the filled inner hole from the filled outer hole (you can > optionally add back in the inner contour if you care about that > single-pixel precision) > > This requires being able to robustly identify the inner and outer > contours, but I don't think that should be too hard? If you only have two, > you can certainly find them by finding the "larger" of the two bounding > boxes. You can use skimage.measure.regionprops for this. > > I hope that helps! > > Juan. > > On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , > wrote: > > Sure - thanks. > > from skimage.morphology import disk > from skimage.feature import canny > from scipy import ndimage as ndi > import matplotlib.pyplot as plt > > image = disk(100) > for ix in range(200): > for iy in range(200): > xdel=ix-100 > ydel=iy-100 > if (xdel*xdel/50 + ydel*ydel/10) < 110: > image[iy,ix]=0 > elif (xdel*xdel/10 + ydel*ydel/50) < 110: > image[iy,ix]=0 > > edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! > > fill = ndi.binary_fill_holes(edges) # I don't understand the params; can > I seed a region to fill? > > fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) > ax = axes.ravel() > > ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') > #ax[0].imshow(invert_img, cmap=plt.cm.gray) > #ax[0].set_title('Inverted image') > ax[0].set_title('Original image') > > ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > ax[1].set_title('Canny edges') > > ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') > ax[2].set_title('Fill') > > plt.show() > > > > On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias > wrote: > >> Hi Randy, I was going to suggest binary fill holes. Do you mind posting >> your image and the code you?ve tried so we can troubleshoot? >> >> Thanks, >> >> Juan. >> >> On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , >> wrote: >> >> If I have a binary image with, say, just a contour boundary (simple >> example: a white background with a black circle, i.e. an "o"), how can I >> fill the inside of the contour? I've played with both the watershed >> segmentation and the scipy.ndimage.binary_fill_holes, without success. >> >> thanks, Randy >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: synth_2x2.jpg Type: image/jpeg Size: 55253 bytes Desc: not available URL: From randy.heiland at gmail.com Mon Jan 8 21:03:11 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Mon, 8 Jan 2018 21:03:11 -0500 Subject: [scikit-image] fill closed contour In-Reply-To: References: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> Message-ID: Argh. Nevermind... need to flip black/white on canny edges: 1-(edges*1) On Mon, Jan 8, 2018 at 8:55 PM, Randy Heiland wrote: > Thanks Juan. I understand better what the ndi.measurements.label can do > for me now. I've tweaked my previous script and attached the resulting > output. Does it make sense that I need to "thicken" the contours in order > to get the desired features/regions, or is there something I'm still > missing? > > ------------ > from skimage.morphology import disk > from skimage.feature import canny > from skimage.filters import rank > from scipy import ndimage as ndi > import matplotlib.pyplot as plt > import numpy as np > > image = disk(100) > for ix in range(200): > for iy in range(200): > xdel=ix-100 > ydel=iy-100 > if (xdel*xdel/50 + ydel*ydel/10) < 110: > image[iy,ix]=0 > elif (xdel*xdel/10 + ydel*ydel/50) < 110: > image[iy,ix]=0 > > edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! > > thicken = rank.gradient(edges, disk(1)) < 5 > bdy = thicken.astype(np.uint8)*255 > > labeled_array, num_features = ndi.measurements.label(edges*1) > print("num_features (edges*1)=",num_features) > labeled_array2, num_features2 = ndi.measurements.label(bdy) > print("num_features (thick)=",num_features2) > > fill = ndi.binary_fill_holes(edges) > > fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) > ax = axes.ravel() > > ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > ax[0].set_title('Canny edges') > ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') > ax[1].set_title('labeled_array') > > ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') > ax[2].set_title('bdy') > ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, interpolation='nearest') > ax[3].set_title('labeled_array2') > > plt.axis('off') > plt.show() > > --> > num_features (edges*1)= 216 > num_features (thick)= 6 > > -Randy > > > On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias > wrote: > >> Oh, I see what's happening. So, in your case, both void spaces are >> actually holes from the perspective of the binary_fill_holes algorithm, so >> they both get filled. I suggest you >> >> a) label both contours using ndi.label >> b) use binary_fill_holes on each label separately >> c) subtract the filled inner hole from the filled outer hole (you can >> optionally add back in the inner contour if you care about that >> single-pixel precision) >> >> This requires being able to robustly identify the inner and outer >> contours, but I don't think that should be too hard? If you only have two, >> you can certainly find them by finding the "larger" of the two bounding >> boxes. You can use skimage.measure.regionprops for this. >> >> I hope that helps! >> >> Juan. >> >> On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , >> wrote: >> >> Sure - thanks. >> >> from skimage.morphology import disk >> from skimage.feature import canny >> from scipy import ndimage as ndi >> import matplotlib.pyplot as plt >> >> image = disk(100) >> for ix in range(200): >> for iy in range(200): >> xdel=ix-100 >> ydel=iy-100 >> if (xdel*xdel/50 + ydel*ydel/10) < 110: >> image[iy,ix]=0 >> elif (xdel*xdel/10 + ydel*ydel/50) < 110: >> image[iy,ix]=0 >> >> edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! >> >> fill = ndi.binary_fill_holes(edges) # I don't understand the params; >> can I seed a region to fill? >> >> fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) >> ax = axes.ravel() >> >> ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') >> #ax[0].imshow(invert_img, cmap=plt.cm.gray) >> #ax[0].set_title('Inverted image') >> ax[0].set_title('Original image') >> >> ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') >> ax[1].set_title('Canny edges') >> >> ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') >> ax[2].set_title('Fill') >> >> plt.show() >> >> >> >> On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias >> wrote: >> >>> Hi Randy, I was going to suggest binary fill holes. Do you mind posting >>> your image and the code you?ve tried so we can troubleshoot? >>> >>> Thanks, >>> >>> Juan. >>> >>> On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , >>> wrote: >>> >>> If I have a binary image with, say, just a contour boundary (simple >>> example: a white background with a black circle, i.e. an "o"), how can I >>> fill the inside of the contour? I've played with both the watershed >>> segmentation and the scipy.ndimage.binary_fill_holes, without success. >>> >>> thanks, Randy >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: synth_2x2b.png Type: image/png Size: 79839 bytes Desc: not available URL: From jni.soma at gmail.com Mon Jan 8 21:20:09 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 9 Jan 2018 13:20:09 +1100 Subject: [scikit-image] fill closed contour In-Reply-To: References: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> Message-ID: <0ca28e2f-948d-4a7f-a123-b10535692f6a@Spark> Ah, your issue with the thickening was that label by default does not consider diagonally-adjancent pixels as adjacent. You need to pass connectivity=2 for this to be the case. But actually labelling the holes rather than the edges is a rather better option. =) The final image looks very pretty and could make a nice company logo. =P On 9 Jan 2018, 1:03 PM +1100, Randy Heiland , wrote: > Argh. Nevermind... need to flip black/white on canny edges:? 1-(edges*1) > > > > > On Mon, Jan 8, 2018 at 8:55 PM, Randy Heiland wrote: > > > Thanks Juan. I understand better what the? ndi.measurements.label can do for me now. I've tweaked my previous script and attached the resulting output. Does it make sense that I need to "thicken" the contours in order to get the desired features/regions, or is there something I'm still missing? > > > > > > ------------ > > > from skimage.morphology import disk > > > from skimage.feature import canny > > > from skimage.filters import rank > > > from scipy import ndimage as ndi > > > import matplotlib.pyplot as plt > > > import numpy as np > > > > > > image = disk(100) > > > for ix in range(200): > > > ? for iy in range(200): > > > ? ? xdel=ix-100 > > > ? ? ydel=iy-100 > > > ? ? if (xdel*xdel/50 + ydel*ydel/10) < 110: > > > ? ? ? image[iy,ix]=0 > > > ? ? elif (xdel*xdel/10 + ydel*ydel/50) < 110: > > > ? ? ? image[iy,ix]=0 > > > > > > edges = canny(image*255.)? # canny expect grayscale, i.e. 0-255 ??! > > > > > > thicken = rank.gradient(edges, disk(1)) < 5 > > > bdy = thicken.astype(np.uint8)*255 > > > > > > labeled_array, num_features = ndi.measurements.label(edges*1) > > > print("num_features (edges*1)=",num_features) > > > labeled_array2, num_features2 = ndi.measurements.label(bdy) > > > print("num_features (thick)=",num_features2) > > > > > > fill = ndi.binary_fill_holes(edges) > > > > > > fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) > > > ax = axes.ravel() > > > > > > ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > > > ax[0].set_title('Canny edges') > > > ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') > > > ax[1].set_title('labeled_array') > > > > > > ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') > > > ax[2].set_title('bdy') > > > ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, interpolation='nearest') > > > ax[3].set_title('labeled_array2') > > > > > > plt.axis('off') > > > plt.show() > > > > > > --> > > > num_features (edges*1)= 216 > > > num_features (thick)= 6 > > > > > > -Randy > > > > > > > > > > On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias wrote: > > > > > Oh, I see what's happening. So, in your case, both void spaces are actually holes from the perspective of the binary_fill_holes algorithm, so they both get filled. I suggest you > > > > > > > > > > a) label both contours using ndi.label > > > > > b) use binary_fill_holes on each label separately > > > > > c) subtract the filled inner hole from the filled outer hole (you can optionally add back in the inner contour if you care about that single-pixel precision) > > > > > > > > > > This requires being able to robustly identify the inner and outer contours, but I don't think that should be too hard? If you only have two, you can certainly find them by finding the "larger" of the two bounding boxes. You can use skimage.measure.regionprops for this. > > > > > > > > > > I hope that helps! > > > > > > > > > > Juan. > > > > > > > > > > On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , wrote: > > > > > > Sure - thanks. > > > > > > > > > > > > from skimage.morphology import disk > > > > > > from skimage.feature import canny > > > > > > from scipy import ndimage as ndi > > > > > > import matplotlib.pyplot as plt > > > > > > > > > > > > image = disk(100) > > > > > > for ix in range(200): > > > > > > ? for iy in range(200): > > > > > > ? ? xdel=ix-100 > > > > > > ? ? ydel=iy-100 > > > > > > ? ? if (xdel*xdel/50 + ydel*ydel/10) < 110: > > > > > > ? ? ? image[iy,ix]=0 > > > > > > ? ? elif (xdel*xdel/10 + ydel*ydel/50) < 110: > > > > > > ? ? ? image[iy,ix]=0 > > > > > > > > > > > > edges = canny(image*255.)? # canny expect grayscale, i.e. 0-255 ??! > > > > > > > > > > > > fill = ndi.binary_fill_holes(edges)? ?# I don't understand the params; can I seed a region to fill? > > > > > > > > > > > > fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) > > > > > > ax = axes.ravel() > > > > > > > > > > > > ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') > > > > > > #ax[0].imshow(invert_img, cmap=plt.cm.gray) > > > > > > #ax[0].set_title('Inverted image') > > > > > > ax[0].set_title('Original image') > > > > > > > > > > > > ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > > > > > > ax[1].set_title('Canny edges') > > > > > > > > > > > > ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') > > > > > > ax[2].set_title('Fill') > > > > > > > > > > > > plt.show() > > > > > > > > > > > > > > > > > > > > > > > > > On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias wrote: > > > > > > > > Hi Randy, I was going to suggest binary fill holes. Do you mind posting your image and the code you?ve tried so we can troubleshoot? > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > Juan. > > > > > > > > > > > > > > > > On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , wrote: > > > > > > > > > If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. > > > > > > > > > > > > > > > > > > thanks, Randy > > > > > > > > > _______________________________________________ > > > > > > > > > scikit-image mailing list > > > > > > > > > scikit-image at python.org > > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > scikit-image mailing list > > > > > > > > scikit-image at python.org > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > scikit-image mailing list > > > > > > scikit-image at python.org > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > _______________________________________________ > > > > > scikit-image mailing list > > > > > scikit-image at python.org > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From randy.heiland at gmail.com Mon Jan 8 21:30:40 2018 From: randy.heiland at gmail.com (Randy Heiland) Date: Mon, 8 Jan 2018 21:30:40 -0500 Subject: [scikit-image] fill closed contour In-Reply-To: <0ca28e2f-948d-4a7f-a123-b10535692f6a@Spark> References: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> <0ca28e2f-948d-4a7f-a123-b10535692f6a@Spark> Message-ID: Sorry to be dense, but could you elaborate on "labeling the holes rather than edges"? What lines would I tweak in my script? On Mon, Jan 8, 2018 at 9:20 PM, Juan Nunez-Iglesias wrote: > Ah, your issue with the thickening was that label by default does not > consider diagonally-adjancent pixels as adjacent. You need to pass > connectivity=2 for this to be the case. But actually labelling the holes > rather than the edges is a rather better option. =) The final image looks > very pretty and could make a nice company logo. =P > > On 9 Jan 2018, 1:03 PM +1100, Randy Heiland , > wrote: > > Argh. Nevermind... need to flip black/white on canny edges: 1-(edges*1) > > > > On Mon, Jan 8, 2018 at 8:55 PM, Randy Heiland > wrote: > >> Thanks Juan. I understand better what the ndi.measurements.label can do >> for me now. I've tweaked my previous script and attached the resulting >> output. Does it make sense that I need to "thicken" the contours in order >> to get the desired features/regions, or is there something I'm still >> missing? >> >> ------------ >> from skimage.morphology import disk >> from skimage.feature import canny >> from skimage.filters import rank >> from scipy import ndimage as ndi >> import matplotlib.pyplot as plt >> import numpy as np >> >> image = disk(100) >> for ix in range(200): >> for iy in range(200): >> xdel=ix-100 >> ydel=iy-100 >> if (xdel*xdel/50 + ydel*ydel/10) < 110: >> image[iy,ix]=0 >> elif (xdel*xdel/10 + ydel*ydel/50) < 110: >> image[iy,ix]=0 >> >> edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! >> >> thicken = rank.gradient(edges, disk(1)) < 5 >> bdy = thicken.astype(np.uint8)*255 >> >> labeled_array, num_features = ndi.measurements.label(edges*1) >> print("num_features (edges*1)=",num_features) >> labeled_array2, num_features2 = ndi.measurements.label(bdy) >> print("num_features (thick)=",num_features2) >> >> fill = ndi.binary_fill_holes(edges) >> >> fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) >> ax = axes.ravel() >> >> ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') >> ax[0].set_title('Canny edges') >> ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') >> ax[1].set_title('labeled_array') >> >> ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') >> ax[2].set_title('bdy') >> ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, >> interpolation='nearest') >> ax[3].set_title('labeled_array2') >> >> plt.axis('off') >> plt.show() >> >> --> >> num_features (edges*1)= 216 >> num_features (thick)= 6 >> >> -Randy >> >> >> On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias >> wrote: >> >>> Oh, I see what's happening. So, in your case, both void spaces are >>> actually holes from the perspective of the binary_fill_holes algorithm, so >>> they both get filled. I suggest you >>> >>> a) label both contours using ndi.label >>> b) use binary_fill_holes on each label separately >>> c) subtract the filled inner hole from the filled outer hole (you can >>> optionally add back in the inner contour if you care about that >>> single-pixel precision) >>> >>> This requires being able to robustly identify the inner and outer >>> contours, but I don't think that should be too hard? If you only have two, >>> you can certainly find them by finding the "larger" of the two bounding >>> boxes. You can use skimage.measure.regionprops for this. >>> >>> I hope that helps! >>> >>> Juan. >>> >>> On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , >>> wrote: >>> >>> Sure - thanks. >>> >>> from skimage.morphology import disk >>> from skimage.feature import canny >>> from scipy import ndimage as ndi >>> import matplotlib.pyplot as plt >>> >>> image = disk(100) >>> for ix in range(200): >>> for iy in range(200): >>> xdel=ix-100 >>> ydel=iy-100 >>> if (xdel*xdel/50 + ydel*ydel/10) < 110: >>> image[iy,ix]=0 >>> elif (xdel*xdel/10 + ydel*ydel/50) < 110: >>> image[iy,ix]=0 >>> >>> edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! >>> >>> fill = ndi.binary_fill_holes(edges) # I don't understand the params; >>> can I seed a region to fill? >>> >>> fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) >>> ax = axes.ravel() >>> >>> ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') >>> #ax[0].imshow(invert_img, cmap=plt.cm.gray) >>> #ax[0].set_title('Inverted image') >>> ax[0].set_title('Original image') >>> >>> ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') >>> ax[1].set_title('Canny edges') >>> >>> ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') >>> ax[2].set_title('Fill') >>> >>> plt.show() >>> >>> >>> >>> On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias >>> wrote: >>> >>>> Hi Randy, I was going to suggest binary fill holes. Do you mind posting >>>> your image and the code you?ve tried so we can troubleshoot? >>>> >>>> Thanks, >>>> >>>> Juan. >>>> >>>> On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , >>>> wrote: >>>> >>>> If I have a binary image with, say, just a contour boundary (simple >>>> example: a white background with a black circle, i.e. an "o"), how can I >>>> fill the inside of the contour? I've played with both the watershed >>>> segmentation and the scipy.ndimage.binary_fill_holes, without success. >>>> >>>> thanks, Randy >>>> _______________________________________________ >>>> scikit-image mailing list >>>> scikit-image at python.org >>>> https://mail.python.org/mailman/listinfo/scikit-image >>>> >>>> >>>> _______________________________________________ >>>> scikit-image mailing list >>>> scikit-image at python.org >>>> https://mail.python.org/mailman/listinfo/scikit-image >>>> >>>> >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >> > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Mon Jan 8 21:43:42 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 9 Jan 2018 13:43:42 +1100 Subject: [scikit-image] fill closed contour In-Reply-To: References: <56c3b4ee-55fd-43ea-9037-e48f9688dafa@Spark> <0ca28e2f-948d-4a7f-a123-b10535692f6a@Spark> Message-ID: You already did it. By inverting the Canny output, you labelled the holes in the image instead of the edges. To label the edges correctly, you would need to label with connectivity=2. This would give you a non-rainbowy coloring of the canny output. (Only two colors, the inner and the outer ring.) On 9 Jan 2018, 1:31 PM +1100, Randy Heiland , wrote: > Sorry to be dense, but could you elaborate on "labeling the holes rather than edges"? What lines would I tweak in my script? > > > On Mon, Jan 8, 2018 at 9:20 PM, Juan Nunez-Iglesias wrote: > > > Ah, your issue with the thickening was that label by default does not consider diagonally-adjancent pixels as adjacent. You need to pass connectivity=2 for this to be the case. But actually labelling the holes rather than the edges is a rather better option. =) The final image looks very pretty and could make a nice company logo. =P > > > > > > On 9 Jan 2018, 1:03 PM +1100, Randy Heiland , wrote: > > > > Argh. Nevermind... need to flip black/white on canny edges:? 1-(edges*1) > > > > > > > > > > > > > > > > > On Mon, Jan 8, 2018 at 8:55 PM, Randy Heiland wrote: > > > > > > Thanks Juan. I understand better what the? ndi.measurements.label can do for me now. I've tweaked my previous script and attached the resulting output. Does it make sense that I need to "thicken" the contours in order to get the desired features/regions, or is there something I'm still missing? > > > > > > > > > > > > ------------ > > > > > > from skimage.morphology import disk > > > > > > from skimage.feature import canny > > > > > > from skimage.filters import rank > > > > > > from scipy import ndimage as ndi > > > > > > import matplotlib.pyplot as plt > > > > > > import numpy as np > > > > > > > > > > > > image = disk(100) > > > > > > for ix in range(200): > > > > > > ? for iy in range(200): > > > > > > ? ? xdel=ix-100 > > > > > > ? ? ydel=iy-100 > > > > > > ? ? if (xdel*xdel/50 + ydel*ydel/10) < 110: > > > > > > ? ? ? image[iy,ix]=0 > > > > > > ? ? elif (xdel*xdel/10 + ydel*ydel/50) < 110: > > > > > > ? ? ? image[iy,ix]=0 > > > > > > > > > > > > edges = canny(image*255.)? # canny expect grayscale, i.e. 0-255 ??! > > > > > > > > > > > > thicken = rank.gradient(edges, disk(1)) < 5 > > > > > > bdy = thicken.astype(np.uint8)*255 > > > > > > > > > > > > labeled_array, num_features = ndi.measurements.label(edges*1) > > > > > > print("num_features (edges*1)=",num_features) > > > > > > labeled_array2, num_features2 = ndi.measurements.label(bdy) > > > > > > print("num_features (thick)=",num_features2) > > > > > > > > > > > > fill = ndi.binary_fill_holes(edges) > > > > > > > > > > > > fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) > > > > > > ax = axes.ravel() > > > > > > > > > > > > ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > > > > > > ax[0].set_title('Canny edges') > > > > > > ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') > > > > > > ax[1].set_title('labeled_array') > > > > > > > > > > > > ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') > > > > > > ax[2].set_title('bdy') > > > > > > ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, interpolation='nearest') > > > > > > ax[3].set_title('labeled_array2') > > > > > > > > > > > > plt.axis('off') > > > > > > plt.show() > > > > > > > > > > > > --> > > > > > > num_features (edges*1)= 216 > > > > > > num_features (thick)= 6 > > > > > > > > > > > > -Randy > > > > > > > > > > > > > > > > > > > On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias wrote: > > > > > > > > Oh, I see what's happening. So, in your case, both void spaces are actually holes from the perspective of the binary_fill_holes algorithm, so they both get filled. I suggest you > > > > > > > > > > > > > > > > a) label both contours using ndi.label > > > > > > > > b) use binary_fill_holes on each label separately > > > > > > > > c) subtract the filled inner hole from the filled outer hole (you can optionally add back in the inner contour if you care about that single-pixel precision) > > > > > > > > > > > > > > > > This requires being able to robustly identify the inner and outer contours, but I don't think that should be too hard? If you only have two, you can certainly find them by finding the "larger" of the two bounding boxes. You can use skimage.measure.regionprops for this. > > > > > > > > > > > > > > > > I hope that helps! > > > > > > > > > > > > > > > > Juan. > > > > > > > > > > > > > > > > On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , wrote: > > > > > > > > > Sure - thanks. > > > > > > > > > > > > > > > > > > from skimage.morphology import disk > > > > > > > > > from skimage.feature import canny > > > > > > > > > from scipy import ndimage as ndi > > > > > > > > > import matplotlib.pyplot as plt > > > > > > > > > > > > > > > > > > image = disk(100) > > > > > > > > > for ix in range(200): > > > > > > > > > ? for iy in range(200): > > > > > > > > > ? ? xdel=ix-100 > > > > > > > > > ? ? ydel=iy-100 > > > > > > > > > ? ? if (xdel*xdel/50 + ydel*ydel/10) < 110: > > > > > > > > > ? ? ? image[iy,ix]=0 > > > > > > > > > ? ? elif (xdel*xdel/10 + ydel*ydel/50) < 110: > > > > > > > > > ? ? ? image[iy,ix]=0 > > > > > > > > > > > > > > > > > > edges = canny(image*255.)? # canny expect grayscale, i.e. 0-255 ??! > > > > > > > > > > > > > > > > > > fill = ndi.binary_fill_holes(edges)? ?# I don't understand the params; can I seed a region to fill? > > > > > > > > > > > > > > > > > > fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) > > > > > > > > > ax = axes.ravel() > > > > > > > > > > > > > > > > > > ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') > > > > > > > > > #ax[0].imshow(invert_img, cmap=plt.cm.gray) > > > > > > > > > #ax[0].set_title('Inverted image') > > > > > > > > > ax[0].set_title('Original image') > > > > > > > > > > > > > > > > > > ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') > > > > > > > > > ax[1].set_title('Canny edges') > > > > > > > > > > > > > > > > > > ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') > > > > > > > > > ax[2].set_title('Fill') > > > > > > > > > > > > > > > > > > plt.show() > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias wrote: > > > > > > > > > > > Hi Randy, I was going to suggest binary fill holes. Do you mind posting your image and the code you?ve tried so we can troubleshoot? > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > > Juan. > > > > > > > > > > > > > > > > > > > > > > On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , wrote: > > > > > > > > > > > > If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. > > > > > > > > > > > > > > > > > > > > > > > > thanks, Randy > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > scikit-image mailing list > > > > > > > > > > > > scikit-image at python.org > > > > > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > scikit-image mailing list > > > > > > > > > > > scikit-image at python.org > > > > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > scikit-image mailing list > > > > > > > > > scikit-image at python.org > > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > scikit-image mailing list > > > > > > > > scikit-image at python.org > > > > > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > scikit-image mailing list > > > > scikit-image at python.org > > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > > _______________________________________________ > > > scikit-image mailing list > > > scikit-image at python.org > > > https://mail.python.org/mailman/listinfo/scikit-image > > > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Tue Jan 9 00:37:21 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Tue, 09 Jan 2018 13:37:21 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6IENvbnZleGl0eSBkZWZlY3RzIGluIHNj?= =?gbk?q?ikit-image?= Message-ID: <20180109053721.69D9C40074@webmail.sinamail.sina.com.cn> happy new year!I am not sure what you need, some tips here: for binary image:you can do a convex hull, then cut the hull by the ori image, then do a region analysis.for gray image:you can use a dot(tow gaussian filter with different sigma), which can enhance the "gray convex region". tow images attached! images are processed by imagepy, It's a ui framework based on scikit-image, you can try it here: https://github.com/Image-Py/imagepy. Best. ----- ???? ----- ????Nikola Vukovic ????scikit-image at python.org ???[scikit-image] Convexity defects in scikit-image ???2018?01?09? 01?20? Hi! Happy New Year! Does anyone know if it?s possible to calculate convexity defects (relative to convex hull) in scikit-image? An online tutorial or code sample would be much appreciated? Thanks! _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gear1.png Type: image/png Size: 126608 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gear2.png Type: image/png Size: 341192 bytes Desc: not available URL: From imagepy at sina.com Tue Jan 9 00:49:04 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Tue, 09 Jan 2018 13:49:04 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6UmU6ICBmaWxsIGNsb3NlZCBjb250b3Vy?= Message-ID: <20180109054904.A4AC7C6073B@webmail.sinamail.sina.com.cn> Hi, just some advice:I think if you did not care the edge-width, you can just do a skeleton, then label it by 4-connect, if you care the edge-width, I think you should trace the line, and got a vector shape(not bitmap). you can use shapely to operate them, and use matplotlib.plot do draw. Canny is not a good operator for region. you cannot make sure the contour closed, there may be many noise, and the edge didnot have an accurate location. Best----- ???? ----- ????Randy Heiland ????"Mailing list for scikit-image (http://scikit-image.org)" ???Re: [scikit-image] fill closed contour ???2018?01?09? 10?31? Sorry to be dense, but could you elaborate on "labeling the holes rather than edges"? What lines would I tweak in my script? On Mon, Jan 8, 2018 at 9:20 PM, Juan Nunez-Iglesias wrote: Ah, your issue with the thickening was that label by default does not consider diagonally-adjancent pixels as adjacent. You need to pass connectivity=2 for this to be the case. But actually labelling the holes rather than the edges is a rather better option. =) The final image looks very pretty and could make a nice company logo. =P On 9 Jan 2018, 1:03 PM +1100, Randy Heiland , wrote: Argh. Nevermind... need to flip black/white on canny edges: 1-(edges*1) On Mon, Jan 8, 2018 at 8:55 PM, Randy Heiland wrote: Thanks Juan. I understand better what the ndi.measurements.label can do for me now. I've tweaked my previous script and attached the resulting output. Does it make sense that I need to "thicken" the contours in order to get the desired features/regions, or is there something I'm still missing? ------------ from skimage.morphology import disk from skimage.feature import canny from skimage.filters import rank from scipy import ndimage as ndi import matplotlib.pyplot as plt import numpy as np image = disk(100) for ix in range(200): for iy in range(200): xdel=ix-100 ydel=iy-100 if (xdel*xdel/50 + ydel*ydel/10) < 110: image[iy,ix]=0 elif (xdel*xdel/10 + ydel*ydel/50) < 110: image[iy,ix]=0 edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! thicken = rank.gradient(edges, disk(1)) < 5 bdy = thicken.astype(np.uint8)*255 labeled_array, num_features = ndi.measurements.label(edges*1) print("num_features (edges*1)=",num_features) labeled_array2, num_features2 = ndi.measurements.label(bdy) print("num_features (thick)=",num_features2) fill = ndi.binary_fill_holes(edges) fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(6, 7)) ax = axes.ravel() ax[0].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') ax[0].set_title('Canny edges') ax[1].imshow(labeled_array, cmap=plt.cm.spectral, interpolation='nearest') ax[1].set_title('labeled_array') ax[2].imshow(bdy, cmap=plt.cm.gray, interpolation='nearest') ax[2].set_title('bdy') ax[3].imshow(labeled_array2, cmap=plt.cm.spectral, interpolation='nearest') ax[3].set_title('labeled_array2') plt.axis('off') plt.show() --> num_features (edges*1)= 216 num_features (thick)= 6 -Randy On Sun, Jan 7, 2018 at 11:36 PM, Juan Nunez-Iglesias wrote: Oh, I see what's happening. So, in your case, both void spaces are actually holes from the perspective of the binary_fill_holes algorithm, so they both get filled. I suggest you a) label both contours using ndi.label b) use binary_fill_holes on each label separately c) subtract the filled inner hole from the filled outer hole (you can optionally add back in the inner contour if you care about that single-pixel precision) This requires being able to robustly identify the inner and outer contours, but I don't think that should be too hard? If you only have two, you can certainly find them by finding the "larger" of the two bounding boxes. You can use skimage.measure.regionprops for this. I hope that helps! Juan. On 8 Jan 2018, 12:21 PM +1100, Randy Heiland , wrote: Sure - thanks. from skimage.morphology import disk from skimage.feature import canny from scipy import ndimage as ndi import matplotlib.pyplot as plt image = disk(100) for ix in range(200): for iy in range(200): xdel=ix-100 ydel=iy-100 if (xdel*xdel/50 + ydel*ydel/10) < 110: image[iy,ix]=0 elif (xdel*xdel/10 + ydel*ydel/50) < 110: image[iy,ix]=0 edges = canny(image*255.) # canny expect grayscale, i.e. 0-255 ??! fill = ndi.binary_fill_holes(edges) # I don't understand the params; can I seed a region to fill? fig, axes = plt.subplots(ncols=3, figsize=(9, 3)) ax = axes.ravel() ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest') #ax[0].imshow(invert_img, cmap=plt.cm.gray) #ax[0].set_title('Inverted image') ax[0].set_title('Original image') ax[1].imshow(edges*1, cmap=plt.cm.gray, interpolation='nearest') ax[1].set_title('Canny edges') ax[2].imshow(fill, cmap=plt.cm.spectral, interpolation='nearest') ax[2].set_title('Fill') plt.show() On Sun, Jan 7, 2018 at 6:57 PM, Juan Nunez-Iglesias wrote: Hi Randy, I was going to suggest binary fill holes. Do you mind posting your image and the code you?ve tried so we can troubleshoot? Thanks, Juan. On 8 Jan 2018, 9:48 AM +1100, Randy Heiland , wrote: If I have a binary image with, say, just a contour boundary (simple example: a white background with a black circle, i.e. an "o"), how can I fill the inside of the contour? I've played with both the watershed segmentation and the scipy.ndimage.binary_fill_holes, without success. thanks, Randy _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Tue Jan 9 02:54:13 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Tue, 09 Jan 2018 15:54:13 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6IHNocmluay13cmFwcGluZyBmaWxvcG9k?= =?gbk?q?ia?= Message-ID: <20180109075413.6F80140074@webmail.sinamail.sina.com.cn> Hi:here is a method to connect line segment:distance transform --> use the max distance you want to connect as threshold --> do watershedBut I think Canny is not a good choice to extract region(not continue and too many noise),.your image is hard, some work you can try:1. use a snake curve to fit step by step2. use ml function (which need many images to train)3. if you need not full-automatic, you can use Opencv's GrabCut.Some images attached processed by ImagePy, you can get ImagePy here:https://github.com/Image-Py/imagepyBest ----- ???? ----- ????Randy Heiland ????scikit-image at python.org ???[scikit-image] shrink-wrapping filopodia ???2018?01?05? 01?22? Hello, and thanks for the great software! I thought I'd ask this community for suggestions on extracting the outline/shape of some images involving biological filopodia. I've attached a sample image where I manually captured one potential outline. And I've put my initial scripts, data, results here:https://github.com/rheiland/image_proc I tried to "close" (edge2.py) the noisy edges, thinking that would be a logical first step, but it didn't really do what I'd hoped. thanks, Randy _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grabcut.jpg Type: image/jpeg Size: 159975 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: heart.png Type: image/png Size: 309841 bytes Desc: not available URL: From ahmedtabia2 at gmail.com Tue Jan 9 05:57:27 2018 From: ahmedtabia2 at gmail.com (ahmed tabia) Date: Tue, 9 Jan 2018 11:57:27 +0100 Subject: [scikit-image] import name haar_like_feature_coord In-Reply-To: <16c557b3-f7bf-4363-a33d-9e6b31f9b86d@Spark> References: <16c557b3-f7bf-4363-a33d-9e6b31f9b86d@Spark> Message-ID: thanx juan ahmed 2018-01-09 0:58 GMT+01:00 Juan Nunez-Iglesias : > Hi Ahmed, > > Haar features are in an as-yet unreleased version of scikit-image. If you > have properly set up Cython and C compilers, you should be able to do: > > python -m pip install git+https://github.com/scikit-image/scikit-image > > to get the latest source version, including Haar-like features. Or you can > wait until mid-february until we release the next version. > > Juan. > > On 9 Jan 2018, 12:08 AM +1100, ahmed tabia , wrote: > > hello how i can add the haar feature to anaconda because when i installed > scikit-image , and when i run application with haar feature this message > was affiched > > "cannot import name haar_like_feature_coord" > > thanx Ahmed > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From egor.v.panfilov at gmail.com Mon Jan 15 04:29:35 2018 From: egor.v.panfilov at gmail.com (Egor Panfilov) Date: Mon, 15 Jan 2018 12:29:35 +0300 Subject: [scikit-image] Preparation of the release 0.14 Message-ID: Dear maintainers, We are now approaching the release of scikit-image 0.14.0. I'd propose to take a look at everything assigned to `Milestone 0.14` on GitHub, and participate in reviewing/recovering/rescheduling of the issues and PRs. In addition, please, consider the 2 recent pages of GitHub issues. Those issues haven't received enough attention so far, and we should check and decide if they are blocking or not for the release. I'm going to review and recover as many issues as possible during this week. On the next one I'm on a business trip and won't have a possibility to actively contribute. I'm very passionate about the new features we're going to deliver with the release (especially, a number of segmentation algorithms and tools), and really looking forward to seeing your reviews :). Regards, Egor Panfilov Related threads: https://mail.python.org/pipermail/scikit-image/2017-September/005351.html https://mail.python.org/pipermail/scikit-image/2017-November/005421.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Sun Jan 21 23:33:38 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Mon, 22 Jan 2018 12:33:38 +0800 Subject: [scikit-image] ImagePy 2018 Message-ID: <20180122043338.942BC10200EA@webmail.sinamail.sina.com.cn> Hi everyone:I wrote ImagePy in the last year. It's a plugin framework, like ImageJ, but based on Python and Numpy. I wrote a ImageJ style ui at first, but now I wrote a more powerful ui, with a toolbox, many widgets, and a developer sute: macros recorder, python console, command finder... and we can extend the tools, commands, widgets by Python plugins. I had test it on Windows, Mac, Linux, you can try it here:https://github.com/Image-Py/imagepy. and a snapshot attached! And I had wrote many documents(in Chinese), and have some users in my country. There is some plan in 2018, please give me some advice. 1. I will write more documents, and translate it in English (I need help)2. I will try to do some lecture in local college.3. I am writting a book, introduce some skill in image-processing, not aimed at program, but with many example in biology and material. And show how to do this using ImagePy.4. I want to publish some paper (many users use ImagePy, and ask me how to quote ImagePy. But I do not know well how to write and where to publish)5. Many user say that they like ImagePy, but they worry about the authority. For ImagePy is not as known as ImageJ or ImagePro Plus now. And If they use ImagePy in there paper, they also worry the paper checker did not trust in ImagePy. But Infact, ImageJ is just a plugin framework, and the plugins are wrote by many people, in good/bad quality. But ImagePy are a wrapper for scipy.ndimage, scikit-image, opencv... Scikit-image are in BSD License, So I want to know if I can say, ImagePy has a core of scikit-image, And most algorithm are supported by scikit-image?6. If possible If there is some way to get little economic support? I just wrote it in my spare time, If there is some support, I can devote more time. YXDragonBest -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Mon Jan 22 00:03:12 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Mon, 22 Jan 2018 13:03:12 +0800 Subject: [scikit-image] ImagePy 2018 (Sorry, forgeot the snapshot) Message-ID: <20180122050313.0725638054F@webmail.sinamail.sina.com.cn> Here is two snapshot, Windows, Mac ----- ???? ----- ???? ????"scikit-image" ???[scikit-image] ImagePy 2018 ???2018?01?22? 12?49? Hi everyone:I wrote ImagePy in the last year. It's a plugin framework, like ImageJ, but based on Python and Numpy. I wrote a ImageJ style ui at first, but now I wrote a more powerful ui, with a toolbox, many widgets, and a developer sute: macros recorder, python console, command finder... and we can extend the tools, commands, widgets by Python plugins. I had test it on Windows, Mac, Linux, you can try it here:https://github.com/Image-Py/imagepy. and a snapshot attached! And I had wrote many documents(in Chinese), and have some users in my country. There is some plan in 2018, please give me some advice. 1. I will write more documents, and translate it in English (I need help)2. I will try to do some lecture in local college.3. I am writting a book, introduce some skill in image-processing, not aimed at program, but with many example in biology and material. And show how to do this using ImagePy.4. I want to publish some paper (many users use ImagePy, and ask me how to quote ImagePy. But I do not know well how to write and where to publish)5. Many user say that they like ImagePy, but they worry about the authority. For ImagePy is not as known as ImageJ or ImagePro Plus now. And If they use ImagePy in there paper, they also worry the paper checker did not trust in ImagePy. But Infact, ImageJ is just a plugin framework, and the plugins are wrote by many people, in good/bad quality. But ImagePy are a wrapper for scipy.ndimage, scikit-image, opencv... Scikit-image are in BSD License, So I want to know if I can say, ImagePy has a core of scikit-image, And most algorithm are supported by scikit-image?6. If possible If there is some way to get little economic support? I just wrote it in my spare time, If there is some support, I can devote more time. YXDragonBest_______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: imagepy.jpg Type: image/jpeg Size: 408656 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snapshot.jpg Type: image/jpeg Size: 102519 bytes Desc: not available URL: From stefanv at berkeley.edu Tue Jan 23 13:52:46 2018 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Tue, 23 Jan 2018 10:52:46 -0800 Subject: [scikit-image] SciPy2018: mini-symposium on Image Processing Message-ID: <20180123185246.helm6qky7azpdjzz@fastmail.com> Hi, everyone I would like to invite you to submit a talk for the SciPy2018 mini-symposium on Image Processing. The deadline is 9 February. https://scipy2018.scipy.org/ehome/299527/648140/ Hope to see you there! St?fan From stefanv at berkeley.edu Tue Jan 23 13:54:37 2018 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Tue, 23 Jan 2018 10:54:37 -0800 Subject: [scikit-image] SciPy2018 tutorial Message-ID: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> Hi, everyone We have an opportunity to submit a scikit-image tutorial for SciPy2018. Is anyone interested in delivering it with me? Best regards St?fan From jni.soma at gmail.com Thu Jan 25 19:50:03 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Fri, 26 Jan 2018 11:50:03 +1100 Subject: [scikit-image] ImagePy 2018 In-Reply-To: <20180122043338.942BC10200EA@webmail.sinamail.sina.com.cn> References: <20180122043338.942BC10200EA@webmail.sinamail.sina.com.cn> Message-ID: Hi Yan, Good to hear from you again! Responses inline below. On 22 Jan 2018, 3:43 PM +1100, imagepy at sina.com, wrote: > Hi everyone: > I wrote ImagePy in the last year. It's a plugin framework, like ImageJ, but based on Python and Numpy. > > I wrote a ImageJ style ui at first, but now I wrote a more powerful ui, with a toolbox, many widgets, and a developer sute: macros recorder, python console, command finder... and we can extend the tools, commands, widgets by Python plugins. > > I had test it on Windows, Mac, Linux, you can try it here:https://github.com/Image-Py/imagepy. and a snapshot attached! And I had wrote many documents(in Chinese), and have some users in my country. There is some plan in 2018, please give me some advice. ImagePy is a very cool concept and execution. Actually the amount of work you?ve done so far seems incredible. Congratulations on a great project! > 1. I will write more documents, and translate it in English (I need help) Yes, English-language documentation is a necessity if you want to be ?mainstream?. > 2. I will try to do some?lecture in local college. > 3. I am writting a book, introduce some skill in image-processing, not aimed at program, but with many example in biology and material. And show how to do this using ImagePy. > 4. I want to publish some paper (many? users use ImagePy, and ask me how to quote ImagePy. But I do not know well how to write and where to publish) These three goals, to me, should be secondary. They fall in the ?promotion? category, and need to come after ImagePy has reached a certain level of stability and maturity. I?ve browsed a bit through the code-base, and I think that you should spend some time cleaning up the code and adding tests before pushing ImagePy too hard. For example, here, it looks like you return n < 2 and the rest of the code is ignored: https://github.com/Image-Py/imagepy/blob/e39bdbcfb28fc18753a9986e29aaf8347180afff/imagepy/ipyalg/graph/skel2d.py#L9 Additionally, the function should have a name that is less context-dependent. ie instead of ?check(n)?, one could do, ?pixel_in_skeleton(neighbor_sum)?. Functions should also be documented in the NumPy style: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt Code should adhere to PEP8: https://www.python.org/dev/peps/pep-0008 Your package should be pip-installable: https://packaging.python.org/tutorials/distributing-packages/ There?s nothing wrong with writing code quickly to get stuff done. As I mentioned, the amount of functionality in ImagePy already is extremely impressive. But, for me, the authority problem for ImagePy is not because it?s not well-known, but because the code looks quickly hacked together and unprofessional. As I said: nothing wrong with that at the start of a project, but before people will place confidence on it, it needs to be polished. Tests don?t guarantee correctness ? we have many bugs in skimage ? but they help very much to protect against bugs. Since most of the code in ImagePy is untested (that ?check? function for example), it?s likely that there are many bugs hiding in there. > 5. Many user say that they like ImagePy, but they worry about the authority. For ImagePy is not as known as ImageJ or ImagePro Plus now. And If they use ImagePy in there paper, they also worry the paper checker did not trust in ImagePy. But Infact, ImageJ is just a plugin framework, and the plugins are wrote by many people, in good/bad quality.- This is definitely true. But many of the plugins (the most cited) are very well tested and documented. Actually I don?t know whether it?s a requirement to have tests to be included in Fiji by default, but I think it probably is. > But ImagePy are a wrapper for scipy.ndimage, scikit-image, opencv... Scikit-image are in BSD License, So I want to know if I can say, ImagePy has a core of scikit-image, And most?algorithm are supported by scikit-image? The wording and imagery should not suggest that ImagePy is endorsed by scikit-image. However, it is perfectly fine for you to say that ImagePy is built on top of SciPy, scikit-image, opencv. This is just a true statement, and we don?t forbid making true statements. =) If you want to increase confidence in specific functions, if a menu item simply calls a scikit-image function, you could add a little greyed-out ?skimage? note next to the menu item. > 6. If possible If there is some way to get little?economic support? I just wrote it in my spare time, If there is some support, I can devote more time. Unfortunately this is a very hard unsolved problem in open-source. Currently even skimage itself has no financial support, and is purely volunteer-driven. Even NumPy just got its first ever direct funding last year. So unfortunately we don?t have a good answer for you. You should check whether there are any government granting agencies in China that might support open-source development. I think ImagePy is an excellent idea and would love to revisit it. I don?t have time right now (I?m not even contributing to the skimage 0.14 release currently!), but keep pinging us as you make progress! Best of luck, Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Thu Jan 25 23:28:07 2018 From: imagepy at sina.com (imagepy at sina.com) Date: Fri, 26 Jan 2018 12:28:07 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6UmU6ICBJbWFnZVB5IDIwMTg=?= Message-ID: <20180126042807.BBE49C80774@webmail.sinamail.sina.com.cn> Hi Juan:Thanks for your advice, It's true that ImagePy is quickly hacked together and unprofessional(The main framework is build in 2 months). And that's why I didnot push it on pypi. I will so some clean up in 2018. But some different opinions? 1. about the "promotion" category, I think sometimes it is needed. Especially, I need to got more user, and some of them should be programer, when they use, they help me to do some test. I will test the interactive framework, but I have no time to test every algrithsm and function. 2. ImagePy's concept is borrow and integrate, the key is the interactive ui framework and the plugin system, not algrithsm. I wrote some in ipyalg, that's because something I must wrote: eg: https://github.com/Image-Py/imagepy/blob/master/imagepy/ipyalg/graph/skel2d.pyI found scikit-image's medial_axis function has some bug:https://github.com/scikit-image/scikit-image/issues/2550the scikit-image's medial_axis make holes when thin. And sometimes we donot need many branch. So I wrote the check you saw. eg:https://github.com/Image-Py/imagepy/blob/master/imagepy/ipyalg/graph/skel2d.pyI need a skeleton analysis function, thanks for your skan, But I think a faster and a cleaner network is better, so I wrote it. eg: scikit-image's h_minima, h_maxima, watershed function is too slow, and when I process a large image, it would run death.so I wrote some function with numba. That's just temporary, I will replace with scikit-image's function when it's OK. thanks for your advice, I will learn the PEP8 and numpy style. Best----- ???? ----- ????Juan Nunez-Iglesias ????scikit-image , imagepy at sina.com ???Re: [scikit-image] ImagePy 2018 ???2018?01?26? 08?50? Hi Yan, Good to hear from you again! Responses inline below. On 22 Jan 2018, 3:43 PM +1100, imagepy at sina.com, wrote: Hi everyone: I wrote ImagePy in the last year. It's a plugin framework, like ImageJ, but based on Python and Numpy. I wrote a ImageJ style ui at first, but now I wrote a more powerful ui, with a toolbox, many widgets, and a developer sute: macros recorder, python console, command finder... and we can extend the tools, commands, widgets by Python plugins. I had test it on Windows, Mac, Linux, you can try it here:https://github.com/Image-Py/imagepy. and a snapshot attached! And I had wrote many documents(in Chinese), and have some users in my country. There is some plan in 2018, please give me some advice. ImagePy is a very cool concept and execution. Actually the amount of work you?ve done so far seems incredible. Congratulations on a great project! 1. I will write more documents, and translate it in English (I need help) Yes, English-language documentation is a necessity if you want to be ?mainstream?. 2. I will try to do some lecture in local college. 3. I am writting a book, introduce some skill in image-processing, not aimed at program, but with many example in biology and material. And show how to do this using ImagePy. 4. I want to publish some paper (many users use ImagePy, and ask me how to quote ImagePy. But I do not know well how to write and where to publish) These three goals, to me, should be secondary. They fall in the ?promotion? category, and need to come after ImagePy has reached a certain level of stability and maturity. I?ve browsed a bit through the code-base, and I think that you should spend some time cleaning up the code and adding tests before pushing ImagePy too hard. For example, here, it looks like you return n < 2 and the rest of the code is ignored: https://github.com/Image-Py/imagepy/blob/e39bdbcfb28fc18753a9986e29aaf8347180afff/imagepy/ipyalg/graph/skel2d.py#L9 Additionally, the function should have a name that is less context-dependent. ie instead of ?check(n)?, one could do, ?pixel_in_skeleton(neighbor_sum)?. Functions should also be documented in the NumPy style: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt Code should adhere to PEP8: https://www.python.org/dev/peps/pep-0008 Your package should be pip-installable: https://packaging.python.org/tutorials/distributing-packages/ There?s nothing wrong with writing code quickly to get stuff done. As I mentioned, the amount of functionality in ImagePy already is extremely impressive. But, for me, the authority problem for ImagePy is not because it?s not well-known, but because the code looks quickly hacked together and unprofessional. As I said: nothing wrong with that at the start of a project, but before people will place confidence on it, it needs to be polished. Tests don?t guarantee correctness ? we have many bugs in skimage ? but they help very much to protect against bugs. Since most of the code in ImagePy is untested (that ?check? function for example), it?s likely that there are many bugs hiding in there. 5. Many user say that they like ImagePy, but they worry about the authority. For ImagePy is not as known as ImageJ or ImagePro Plus now. And If they use ImagePy in there paper, they also worry the paper checker did not trust in ImagePy. But Infact, ImageJ is just a plugin framework, and the plugins are wrote by many people, in good/bad quality.- This is definitely true. But many of the plugins (the most cited) are very well tested and documented. Actually I don?t know whether it?s a requirement to have tests to be included in Fiji by default, but I think it probably is. But ImagePy are a wrapper for scipy.ndimage, scikit-image, opencv... Scikit-image are in BSD License, So I want to know if I can say, ImagePy has a core of scikit-image, And most algorithm are supported by scikit-image? The wording and imagery should not suggest that ImagePy is endorsed by scikit-image. However, it is perfectly fine for you to say that ImagePy is built on top of SciPy, scikit-image, opencv. This is just a true statement, and we don?t forbid making true statements. =) If you want to increase confidence in specific functions, if a menu item simply calls a scikit-image function, you could add a little greyed-out ?skimage? note next to the menu item. 6. If possible If there is some way to get little economic support? I just wrote it in my spare time, If there is some support, I can devote more time. Unfortunately this is a very hard unsolved problem in open-source. Currently even skimage itself has no financial support, and is purely volunteer-driven. Even NumPy just got its first ever direct funding last year. So unfortunately we don?t have a good answer for you. You should check whether there are any government granting agencies in China that might support open-source development. I think ImagePy is an excellent idea and would love to revisit it. I don?t have time right now (I?m not even contributing to the skimage 0.14 release currently!), but keep pinging us as you make progress! Best of luck, Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Tue Jan 30 01:03:31 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 30 Jan 2018 17:03:31 +1100 Subject: [scikit-image] ImagePy 2018 In-Reply-To: <20180126042807.BBE49C80774@webmail.sinamail.sina.com.cn> References: <20180126042807.BBE49C80774@webmail.sinamail.sina.com.cn> Message-ID: Hi Yan, On Fri, Jan 26, 2018 at 3:28 PM, wrote: > Thanks for your advice, It's true that ImagePy is quickly hacked together > and unprofessional(The main framework is build in 2 months). And that's why > I didnot push it on pypi. I will so some clean up in 2018. But some different > opinions? > > 1. about the "promotion" category, I think sometimes it is needed. > Especially, I need to got more user, and some of them should be programer, > when they use, they help me to do some test. I will test the interactive > framework, but I have no time to test every algrithsm and function. > I think you have this backwards. Alpha-level and even pre-alpha software is absolutely fine to put on PyPI (there is even a specific tag for it, see https://pypi.python.org/pypi?%3Aaction=list_classifiers), and imho a better way to promote your software is to make it very easy for people to install it, and then invite them to try it out. Here I think it's critically important to: a) make the installation easy, standard, and fool-proof. b) manage expectations about the state of the software. Rather than promise that this is the successor to ImageJ (this is an enormous task), say that it's a *work-in-progress*, pluggable GUI framework *aiming* to make Python-based image processing software accessible without programming expertise. If you *don't* say these things up-front, your software might get a reputation for over-promising. Then when ImagePy becomes more polished, people will dismiss it because they tried it when it was buggy and it didn't work for them. I've seen several people on the ImageJ list give up after they couldn't get it to run on their machine. I don't think they will be excited to try again to install from source. If you make it pip installable, they might. Anyway, I agree with you that there is a balance between getting more users and being cautious. But in my opinion you are leaning too far in the promotion side of things. This is just my opinion and again, please don't let this be discouraging --- as I mentioned before, I think it is very impressive already! 2. ImagePy's concept is borrow and integrate, the key is the interactive ui > framework and the plugin system, not algrithsm. I wrote some in ipyalg, > that's because something I must wrote: > > eg: https://github.com/Image-Py/imagepy/blob/master/ > imagepy/ipyalg/graph/skel2d.py > I found scikit-image's medial_axis function has some bug: > https://github.com/scikit-image/scikit-image/issues/2550 > the scikit-image's medial_axis make holes when thin. And sometimes we > donot need many branch. So I wrote the check you saw. > > eg:https://github.com/Image-Py/imagepy/blob/master/ > imagepy/ipyalg/graph/skel2d.py > I need a skeleton analysis function, thanks for your skan, But I think a > faster and a cleaner network is better, so I wrote it. > > eg: scikit-image's h_minima, h_maxima, watershed function is too slow, and > when I process a large image, it would run death. > so I wrote some function with numba. That's just temporary, I will replace > with scikit-image's function when it's OK. > Sure. We would very much welcome pull requests to scikit-image to improve speed! But, as mentioned a couple of times, they would need to be feature-complete implementations, pass all the tests, and have a clean and documented API. These things all take a lot more effort but they are worth it over time, or the project becomes impossible to maintain. thanks for your advice, I will learn the PEP8 and numpy style. > Good luck! Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Tue Jan 30 01:48:08 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 30 Jan 2018 17:48:08 +1100 Subject: [scikit-image] SciPy2018 tutorial In-Reply-To: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> References: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> Message-ID: I'm almost certainly in. [waves] =) Can you recycle last year's proposal? On Wed, Jan 24, 2018 at 5:54 AM, Stefan van der Walt wrote: > Hi, everyone > > We have an opportunity to submit a scikit-image tutorial for SciPy2018. > Is anyone interested in delivering it with me? > > Best regards > St?fan > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanv at berkeley.edu Tue Jan 30 02:31:00 2018 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Mon, 29 Jan 2018 23:31:00 -0800 Subject: [scikit-image] SciPy2018 tutorial In-Reply-To: References: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> Message-ID: <1517297460.3212297.1252850192.6B1341E2@webmail.messagingengine.com> On Mon, Jan 29, 2018, at 22:48, Juan Nunez-Iglesias wrote: > I'm almost certainly in. [waves] =) Can you recycle last year's > proposal? Actually, I don't think so. We tried something new last year, broadening the scope to image processing + machine learning. That material was very interesting, and perhaps could be perfected, but I think we bit of too much and should consider going back to classic image processing, teach principles, and make sure we have several well worked out exercises (+ solutions, yes ;) that build on top of one another to form a coherent story. St?fan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Tue Jan 30 03:00:16 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 30 Jan 2018 19:00:16 +1100 Subject: [scikit-image] SciPy2018 tutorial In-Reply-To: <1517297460.3212297.1252850192.6B1341E2@webmail.messagingengine.com> References: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> <1517297460.3212297.1252850192.6B1341E2@webmail.messagingengine.com> Message-ID: Ok, the year before that? ;) On Tue, Jan 30, 2018 at 6:31 PM, Stefan van der Walt wrote: > On Mon, Jan 29, 2018, at 22:48, Juan Nunez-Iglesias wrote: > > I'm almost certainly in. [waves] =) Can you recycle last year's proposal? > > > Actually, I don't think so. We tried something new last year, broadening > the scope to image processing + machine learning. That material was very > interesting, and perhaps could be perfected, but I think we bit of too much > and should consider going back to classic image processing, teach > principles, and make sure we have several well worked out exercises (+ > solutions, yes ;) that build on top of one another to form a coherent story. > > St?fan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Wed Jan 31 01:20:20 2018 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Tue, 30 Jan 2018 23:20:20 -0700 Subject: [scikit-image] SciPy2018 tutorial In-Reply-To: References: <20180123185437.pmsm42tdojmz3ccu@fastmail.com> <1517297460.3212297.1252850192.6B1341E2@webmail.messagingengine.com> Message-ID: Glad to report I just got clearance to attend this year. It's been too long! Count me in; I have a few new tutorial ideas/tweaks in mind. Josh On Tue, Jan 30, 2018 at 1:00 AM, Juan Nunez-Iglesias wrote: > Ok, the year before that? ;) > > On Tue, Jan 30, 2018 at 6:31 PM, Stefan van der Walt > wrote: > >> On Mon, Jan 29, 2018, at 22:48, Juan Nunez-Iglesias wrote: >> >> I'm almost certainly in. [waves] =) Can you recycle last year's proposal? >> >> >> Actually, I don't think so. We tried something new last year, broadening >> the scope to image processing + machine learning. That material was very >> interesting, and perhaps could be perfected, but I think we bit of too much >> and should consider going back to classic image processing, teach >> principles, and make sure we have several well worked out exercises (+ >> solutions, yes ;) that build on top of one another to form a coherent story. >> >> St?fan >> >> > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: