From jalopcar at gmail.com Fri Dec 1 16:35:30 2017 From: jalopcar at gmail.com (Jaime Lopez Carvajal) Date: Fri, 1 Dec 2017 16:35:30 -0500 Subject: [scikit-image] my fast watershed has pass all the test_watershed check In-Reply-To: <20171129190342.4A1B6AC00BB@webmail.sinamail.sina.com.cn> References: <20171129190342.4A1B6AC00BB@webmail.sinamail.sina.com.cn> Message-ID: Hi, Does this script run under python 2.7 and 3.6? Jaime On Wed, Nov 29, 2017 at 2:03 PM, wrote: > Hi Everyone: > I had implemented a watershed by numba, and now it has pass all the > test_watershed check and got a exactly same result with skimage, support > watershed-line, support connectivity, (pass test 0-12, but mine did not > support compact yet) > > It support nd, now only support uint8 image with uint16 marks. (because I > think sometimes it is enough, It can process float image if it is needed) > > And it is very smart and fast. less than 100 lines, and faster than > skimage one. a 3d image which skimage run more than 10 minutes ( and I > cannot wait any longer, so kill it), but my watershed just need 28 s. > > The code are attached. > > Best > YXDragon > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -- *Jaime Lopez Carvajal* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jalopcar at gmail.com Fri Dec 1 16:47:25 2017 From: jalopcar at gmail.com (Jaime Lopez Carvajal) Date: Fri, 1 Dec 2017 16:47:25 -0500 Subject: [scikit-image] my fast watershed has pass all the test_watershed check In-Reply-To: <20171129190342.4A1B6AC00BB@webmail.sinamail.sina.com.cn> References: <20171129190342.4A1B6AC00BB@webmail.sinamail.sina.com.cn> Message-ID: Hi YXDragon, The majority of tests, except 1,3,9,11, generates this error: Connectivity dimension must be same as image Do you think, I have an older version of skimage? or could it be another thing? Jaime On Wed, Nov 29, 2017 at 2:03 PM, wrote: > Hi Everyone: > I had implemented a watershed by numba, and now it has pass all the > test_watershed check and got a exactly same result with skimage, support > watershed-line, support connectivity, (pass test 0-12, but mine did not > support compact yet) > > It support nd, now only support uint8 image with uint16 marks. (because I > think sometimes it is enough, It can process float image if it is needed) > > And it is very smart and fast. less than 100 lines, and faster than > skimage one. a 3d image which skimage run more than 10 minutes ( and I > cannot wait any longer, so kill it), but my watershed just need 28 s. > > The code are attached. > > Best > YXDragon > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -- *Jaime Lopez Carvajal* -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Fri Dec 1 20:47:26 2017 From: imagepy at sina.com (imagepy at sina.com) Date: Sat, 02 Dec 2017 09:47:26 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6UmU6ICBteSBmYXN0IHdhdGVyc2hlZCBo?= =?gbk?q?as_pass_all_the_test=5Fwatershed_check?= Message-ID: <20171202014726.D978681000EC@webmail.sinamail.sina.com.cn> Hi Jaime:All my test are in the following format: def test_watershed01(): data = np.array(..., np.uint8) markers = np.array(..., np.uint16) out1 = mywatershed(data, markers) out2 = skwatershed(data, markers) print(np.sum(out1-out2!=0)) every test gets a zero output, but the parameter has little diffrence with skimage.1. the image should be uint8 (then region can growing one level in one step)2. the markers should be uint16 (I change -1 of the orignal test into 1, we just need to make sure the marker order)3. connectivity only accept 1 or 2. means 4-connect or 8 connect.(6-connect, 28-connect for 3d) for the float image, I think we can do a histogram normalrize. this means take full use of the range.then scale into 0-255, if nessesary, scale into 0-65536, then my watershed can process it. "Connectivity dimension must be same as image" I think it is generated by scikit-image, which version do you use? BestYXDragon----- ???? ----- ????Jaime Lopez Carvajal ????imagepy at sina.com, "Mailing list for scikit-image (http://scikit-image.org)" ???Re: [scikit-image] my fast watershed has pass all the test_watershed check ???2017?12?02? 05?47? Hi YXDragon, The majority of tests, except 1,3,9,11, generates this error: Connectivity dimension must be same as image Do you think, I have an older version of skimage? or could it be another thing? Jaime On Wed, Nov 29, 2017 at 2:03 PM, wrote: Hi Everyone:I had implemented a watershed by numba, and now it has pass all the test_watershed check and got a exactly same result with skimage, support watershed-line, support connectivity, (pass test 0-12, but mine did not support compact yet) It support nd, now only support uint8 image with uint16 marks. (because I think sometimes it is enough, It can process float image if it is needed) And it is very smart and fast. less than 100 lines, and faster than skimage one. a 3d image which skimage run more than 10 minutes ( and I cannot wait any longer, so kill it), but my watershed just need 28 s. The code are attached. BestYXDragon _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -- Jaime Lopez Carvajal -------------- next part -------------- An HTML attachment was scrubbed... URL: From jalopcar at gmail.com Fri Dec 1 21:47:48 2017 From: jalopcar at gmail.com (Jaime Lopez Carvajal) Date: Fri, 1 Dec 2017 21:47:48 -0500 Subject: [scikit-image] =?utf-8?b?5Zue5aSN77yaUmU6IG15IGZhc3Qgd2F0ZXJz?= =?utf-8?q?hed_has_pass_all_the_test=5Fwatershed_check?= In-Reply-To: <20171202014726.D978681000EC@webmail.sinamail.sina.com.cn> References: <20171202014726.D978681000EC@webmail.sinamail.sina.com.cn> Message-ID: Hi YXDragon, Thanks for your test's description, I find them very clear. As I wrote to you, the problem only appear with tests that use the third parameter in *skwatershed function*, because your function works fine. >out1 = watershed(data, markers, *2*) # works fine >out2 = skwatershed(data, markers, *2*) # does not work I have installed skimage version 0.12.3 with python 2.7, maybe your code is for python 3.5? Jaime On Fri, Dec 1, 2017 at 8:47 PM, wrote: > Hi Jaime: > All my test are in the following format: > > def test_watershed01(): > data = np.array(..., np.uint8) > markers = np.array(..., np.uint16) > out1 = mywatershed(data, markers) > out2 = skwatershed(data, markers) > print(np.sum(out1-out2!=0)) > > every test gets a zero output, but the parameter has little diffrence with > skimage. > 1. the image should be uint8 (then region can growing one level in one > step) > 2. the markers should be uint16 (I change -1 of the orignal test into 1, > we just need to make sure the marker order) > 3. connectivity only accept 1 or 2. means 4-connect or 8 > connect.(6-connect, 28-connect for 3d) > > for the float image, I think we can do a histogram normalrize. this means > take full use of the range. > then scale into 0-255, if nessesary, scale into 0-65536, then my watershed > can process it. > > "Connectivity dimension must be same as image" I think it is generated by > scikit-image, which version do you use? > > Best > YXDragon > ----- ???? ----- > ????Jaime Lopez Carvajal > ????imagepy at sina.com, "Mailing list for scikit-image ( > http://scikit-image.org)" > ???Re: [scikit-image] my fast watershed has pass all the test_watershed > check > ???2017?12?02? 05?47? > > Hi YXDragon, > > The majority of tests, except 1,3,9,11, generates this error: Connectivity > dimension must be same as image > > Do you think, I have an older version of skimage? or could it be another > thing? > > Jaime > > > > > > On Wed, Nov 29, 2017 at 2:03 PM, wrote: > > Hi Everyone: > I had implemented a watershed by numba, and now it has pass all the > test_watershed check and got a exactly same result with skimage, support > watershed-line, support connectivity, (pass test 0-12, but mine did not > support compact yet) > > It support nd, now only support uint8 image with uint16 marks. (because I > think sometimes it is enough, It can process float image if it is needed) > > And it is very smart and fast. less than 100 lines, and faster than > skimage one. a 3d image which skimage run more than 10 minutes ( and I > cannot wait any longer, so kill it), but my watershed just need 28 s. > > The code are attached. > > Best > YXDragon > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > > > -- > > *Jaime Lopez Carvajal* > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -- *Jaime Lopez Carvajal* -------------- next part -------------- An HTML attachment was scrubbed... URL: From imagepy at sina.com Fri Dec 1 21:56:52 2017 From: imagepy at sina.com (imagepy at sina.com) Date: Sat, 02 Dec 2017 10:56:52 +0800 Subject: [scikit-image] =?gbk?b?u9i4tKO6UmU6ICC72Li0o7pSZTogbXkgZmFzdCB3?= =?gbk?q?atershed_has_pass_all_the_test=5Fwatershed_check?= Message-ID: <20171202025652.3202938054E@webmail.sinamail.sina.com.cn> my code works for 2.7 and 3.x. I think it's matter of skimage's version. I remember the watershed_line parameter is added in version 13.0. ----- ???? ----- ????Jaime Lopez Carvajal ????imagepy at sina.com, "Mailing list for scikit-image (http://scikit-image.org)" ???Re: [scikit-image] ???Re: my fast watershed has pass all the test_watershed check ???2017?12?02? 10?48? Hi YXDragon, Thanks for your test's description, I find them very clear.As I wrote to you, the problem only appear with tests that use the third parameter in skwatershed function, because your function works fine. >out1 = watershed(data, markers, 2) # works fine>out2 = skwatershed(data, markers, 2) # does not work I have installed skimage version 0.12.3 with python 2.7, maybe your code is for python 3.5? Jaime On Fri, Dec 1, 2017 at 8:47 PM, wrote: Hi Jaime:All my test are in the following format: def test_watershed01(): data = np.array(..., np.uint8) markers = np.array(..., np.uint16) out1 = mywatershed(data, markers) out2 = skwatershed(data, markers) print(np.sum(out1-out2!=0)) every test gets a zero output, but the parameter has little diffrence with skimage.1. the image should be uint8 (then region can growing one level in one step)2. the markers should be uint16 (I change -1 of the orignal test into 1, we just need to make sure the marker order)3. connectivity only accept 1 or 2. means 4-connect or 8 connect.(6-connect, 28-connect for 3d) for the float image, I think we can do a histogram normalrize. this means take full use of the range.then scale into 0-255, if nessesary, scale into 0-65536, then my watershed can process it. "Connectivity dimension must be same as image" I think it is generated by scikit-image, which version do you use? BestYXDragon----- ???? ----- ????Jaime Lopez Carvajal ????imagepy at sina.com, "Mailing list for scikit-image (http://scikit-image.org)" ???Re: [scikit-image] my fast watershed has pass all the test_watershed check ???2017?12?02? 05?47? Hi YXDragon, The majority of tests, except 1,3,9,11, generates this error: Connectivity dimension must be same as image Do you think, I have an older version of skimage? or could it be another thing? Jaime On Wed, Nov 29, 2017 at 2:03 PM, wrote: Hi Everyone:I had implemented a watershed by numba, and now it has pass all the test_watershed check and got a exactly same result with skimage, support watershed-line, support connectivity, (pass test 0-12, but mine did not support compact yet) It support nd, now only support uint8 image with uint16 marks. (because I think sometimes it is enough, It can process float image if it is needed) And it is very smart and fast. less than 100 lines, and faster than skimage one. a 3d image which skimage run more than 10 minutes ( and I cannot wait any longer, so kill it), but my watershed just need 28 s. The code are attached. BestYXDragon _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -- Jaime Lopez Carvajal _______________________________________________ scikit-image mailing list scikit-image at python.org https://mail.python.org/mailman/listinfo/scikit-image -- Jaime Lopez Carvajal -------------- next part -------------- An HTML attachment was scrubbed... URL: From jalopcar at gmail.com Fri Dec 1 22:27:33 2017 From: jalopcar at gmail.com (Jaime Lopez Carvajal) Date: Fri, 1 Dec 2017 22:27:33 -0500 Subject: [scikit-image] =?utf-8?b?5Zue5aSN77yaUmU6IOWbnuWkje+8mlJlOiBt?= =?utf-8?q?y_fast_watershed_has_pass_all_the_test=5Fwatershed_check?= In-Reply-To: <20171202025652.3202938054E@webmail.sinamail.sina.com.cn> References: <20171202025652.3202938054E@webmail.sinamail.sina.com.cn> Message-ID: Hi YXdragon, It works now, it was skimage version problem, I had 0.12.3. I update it already to 0.13.1 Thank you very much, Jaime On Fri, Dec 1, 2017 at 9:56 PM, wrote: > my code works for 2.7 and 3.x. I think it's matter of skimage's version. I > remember the watershed_line parameter is added in version 13.0. > > ----- ???? ----- > ????Jaime Lopez Carvajal > ????imagepy at sina.com, "Mailing list for scikit-image ( > http://scikit-image.org)" > ???Re: [scikit-image] ???Re: my fast watershed has pass all the > test_watershed check > ???2017?12?02? 10?48? > > Hi YXDragon, > > Thanks for your test's description, I find them very clear. > As I wrote to you, the problem only appear with tests that use the third > parameter in *skwatershed function*, because your function works fine. > > >out1 = watershed(data, markers, *2*) # works fine > >out2 = skwatershed(data, markers, *2*) # does not work > > I have installed skimage version 0.12.3 with python 2.7, maybe your code > is for python 3.5? > > Jaime > > > > On Fri, Dec 1, 2017 at 8:47 PM, wrote: > > Hi Jaime: > All my test are in the following format: > > def test_watershed01(): > data = np.array(..., np.uint8) > markers = np.array(..., np.uint16) > out1 = mywatershed(data, markers) > out2 = skwatershed(data, markers) > print(np.sum(out1-out2!=0)) > > every test gets a zero output, but the parameter has little diffrence with > skimage. > 1. the image should be uint8 (then region can growing one level in one > step) > 2. the markers should be uint16 (I change -1 of the orignal test into 1, > we just need to make sure the marker order) > 3. connectivity only accept 1 or 2. means 4-connect or 8 > connect.(6-connect, 28-connect for 3d) > > for the float image, I think we can do a histogram normalrize. this means > take full use of the range. > then scale into 0-255, if nessesary, scale into 0-65536, then my watershed > can process it. > > "Connectivity dimension must be same as image" I think it is generated by > scikit-image, which version do you use? > > Best > YXDragon > ----- ???? ----- > ????Jaime Lopez Carvajal > ????imagepy at sina.com, "Mailing list for scikit-image ( > http://scikit-image.org)" > ???Re: [scikit-image] my fast watershed has pass all the test_watershed > check > ???2017?12?02? 05?47? > > Hi YXDragon, > > The majority of tests, except 1,3,9,11, generates this error: Connectivity > dimension must be same as image > > Do you think, I have an older version of skimage? or could it be another > thing? > > Jaime > > > > > > On Wed, Nov 29, 2017 at 2:03 PM, wrote: > > Hi Everyone: > I had implemented a watershed by numba, and now it has pass all the > test_watershed check and got a exactly same result with skimage, support > watershed-line, support connectivity, (pass test 0-12, but mine did not > support compact yet) > > It support nd, now only support uint8 image with uint16 marks. (because I > think sometimes it is enough, It can process float image if it is needed) > > And it is very smart and fast. less than 100 lines, and faster than > skimage one. a 3d image which skimage run more than 10 minutes ( and I > cannot wait any longer, so kill it), but my watershed just need 28 s. > > The code are attached. > > Best > YXDragon > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > > > -- > > *Jaime Lopez Carvajal* > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > > > > -- > > *Jaime Lopez Carvajal* > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -- *Jaime Lopez Carvajal* -------------- next part -------------- An HTML attachment was scrubbed... URL: