From: Jordi G. H. <jo...@oc...> - 2012-09-04 02:14:06
|
I've done a few fixes to bwlabeln in svn so that 1) it doesn't segfault (or at least I couldn't devise a test that made it segfault) 2) It has a help text 3) it errors out gracefully 4) it actually does what it's supposed to Sadly, it's slow. :-( But fast enough fo rmy purposes. I would appreciate if anyone who cares about 3d images could test it. I am therefore considering this done, and I will be doing a release of the image package soon. For my purposes, I need to remove a few unnecessary trivial checks for two-dimensionality in regionprops. Comments? - Jordi G. H. |
From: Carnë D. <car...@gm...> - 2012-09-04 02:54:31
|
On 4 September 2012 03:14, Jordi Gutiérrez Hermoso <jo...@oc...> wrote: > I've done a few fixes to bwlabeln in svn so that > > 1) it doesn't segfault (or at least I couldn't devise a test that > made it segfault) > 2) It has a help text > 3) it errors out gracefully > 4) it actually does what it's supposed to > > Sadly, it's slow. :-( But fast enough fo rmy purposes. I would > appreciate if anyone who cares about 3d images could test it. > > I am therefore considering this done, and I will be doing a release of > the image package soon. For my purposes, I need to remove a few > unnecessary trivial checks for two-dimensionality in regionprops. > > Comments? > > - Jordi G. H. I have some 3D images and will be able to test that later this week (I'm moving to Germany at the moment). About making a new release of the image, do you really need it? If so, maybe make just one release with that new function (as if there was a default and stable branch). There's a lot of changes and new functions and I'm not sure if it's in good state to be released just yet. Mmany functions don't have tests and since the API for some has changed to be matlab compatible a new release made now is likely to be quite buggy. I'm trying to go at it one function at a time and make a major release but that will take a while. Carnë |
From: Kris T. <kri...@gm...> - 2012-09-04 07:12:30
|
Thanks Jordi I can give this a go at a few 3D images. Do I need to check out regionprops as well? Kris > -----Original Message----- > From: Jordi Gutiérrez Hermoso [mailto:jo...@oc...] > Sent: 04 September 2012 03:14 > To: Octave Forge List > Subject: [OctDev] bwlabeln "finished" > > I've done a few fixes to bwlabeln in svn so that > > 1) it doesn't segfault (or at least I couldn't devise a test that > made it segfault) > 2) It has a help text > 3) it errors out gracefully > 4) it actually does what it's supposed to > > Sadly, it's slow. :-( But fast enough fo rmy purposes. I would > appreciate if anyone who cares about 3d images could test it. > > I am therefore considering this done, and I will be doing a release of > the image package soon. For my purposes, I need to remove a few > unnecessary trivial checks for two-dimensionality in regionprops. > > Comments? > > - Jordi G. H. > > ---------------------------------------------------------------------------- -- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Octave-dev mailing list > Oct...@li... > https://lists.sourceforge.net/lists/listinfo/octave-dev |
From: Jordi G. H. <jo...@oc...> - 2012-09-04 14:19:41
|
On 4 September 2012 03:12, Kris Thielemans <kri...@gm...> wrote: > I can give this a go at a few 3D images. Thanks. > Do I need to check out regionprops as well? Only if you need its functions (like number of voxels in a region, etc). - Jordi G. H. |
From: Jordi G. H. <jo...@oc...> - 2012-09-05 20:14:52
|
Just a heads up to everyone, I've improved the bwlabeln code a bit to make it faster. Please let me know how it works for you. TIA, - Jordi G. H. |
From: Kris T. <kri...@gm...> - 2012-09-07 11:06:15
|
Hi Jordi My initial impression if your newest bwlabeln implementation seems good! It's not so easy to test this exhaustively of course. But for instance this works tmp=ones(2,2,3); % add another "blob" somewhere further away tmp(3:4, 4:6, 2:3)=ones(2,3,2); res=bwlabeln(tmp~=0); % we should have found 2 blobs expectedres=ones(2,2,3); expectedres(3:4, 4:6, 2:3)=ones(2,3,2)*2; assert(res, expectedres) The test above is somewhat problematic, as bwlabeln could just as well have found the blobs in different order. I haven't bothered to come up with a better test code. I have only 1 problem. In my matlab code, I normally pass a (double) array with 0,1 to bwlabeln. This doesn't work for your implementation: bwlabeln(ones([2,2,3])) error: bwlabeln: first input argument must be a 'logical' ND-array I can fix this by converting to bools of course bwlabeln(ones([2,2,3]~=0)) but for matlab compatibility, ideally bwlabeln would do that itself. The same holds for bwlabel by the way. Thanks for this! Kris > -----Original Message----- > From: jo...@gm... [mailto:jo...@gm...] On Behalf Of Jordi > Gutiérrez Hermoso > Sent: 05 September 2012 21:15 > To: Kris Thielemans > Cc: Octave Forge List > Subject: Re: [OctDev] bwlabeln "finished" > > Just a heads up to everyone, I've improved the bwlabeln code a bit to > make it faster. Please let me know how it works for you. > > TIA, > - Jordi G. H. |
From: Jordi G. H. <jo...@oc...> - 2012-09-07 15:19:16
|
On 7 September 2012 07:06, Kris Thielemans <kri...@gm...> wrote: > My initial impression if your newest bwlabeln implementation seems > good! Great, thanks for testing. > I have only 1 problem. In my matlab code, I normally pass a (double) > array with 0,1 to bwlabeln. This doesn't work for your > implementation: > > bwlabeln(ones([2,2,3])) > error: bwlabeln: first input argument must be a 'logical' ND-array Okay, thanks, I've fixed this: http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/image/src/bwlabeln.cc?r1=10978&r2=10977&pathrev=10978 - Jordi G. H. |
From: Carnë D. <car...@gm...> - 2012-09-07 11:55:54
|
On 7 September 2012 13:06, Kris Thielemans <kri...@gm...> wrote: > I have only 1 problem. In my matlab code, I normally pass a (double) array with 0,1 to bwlabeln. This doesn't work for your implementation: > > bwlabeln(ones([2,2,3])) > error: bwlabeln: first input argument must be a 'logical' ND-array > > I can fix this by converting to bools of course > > bwlabeln(ones([2,2,3]~=0)) > > but for matlab compatibility, ideally bwlabeln would do that itself. The same holds for bwlabel by the way. What does matlab do if the double matrix has values different from 0 and 1? Carnë |
From: Kris T. <kri...@gm...> - 2012-09-07 12:21:40
|
On 07 September 2012 12:55 Carnë Draug wrote > On 7 September 2012 13:06, Kris Thielemans wrote: > > I have only 1 problem. In my matlab code, I normally pass a (double) array > with 0,1 to bwlabeln. This doesn't work for your implementation: > > > > bwlabeln(ones([2,2,3])) > > error: bwlabeln: first input argument must be a 'logical' ND-array > > > > I can fix this by converting to bools of course > > > > bwlabeln(ones([2,2,3]~=0)) > > > > but for matlab compatibility, ideally bwlabeln would do that itself. The > same holds for bwlabel by the way. > > What does matlab do if the double matrix has values different from 0 and 1? > It seems to compare with 0 as I do above. For example, the following 2 tests work in matlab 2011b tmp=ones([2,3,4]);tmp(2,2,2)=.3;isequal(bwlabeln(tmp),ones(size(tmp))) tmp=randn([2,3,4]);isequal(bwlabeln(tmp),tmp~=0) Kris |