[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Efficiently iterating over Nd array in oct file
From: |
Søren Hauberg |
Subject: |
Re: Efficiently iterating over Nd array in oct file |
Date: |
Mon, 25 Apr 2011 16:33:28 +0200 |
man, 25 04 2011 kl. 09:24 -0500, skrev Jordi Gutiérrez Hermoso:
> I'm agonising over an implementation detail of bwlabeln. I need to
> iterate over each voxel of boolNDArray *and* consider each voxel's
> neighbours. If I use a linear index and just iterate up to
> boolNDArray::nelem(), I would have to call ind2sub for each pixel in
> order to consider its neighbours, and I'm trying to avoid that call. I
> was hoping for something like Array<idx_vector>::next() if such a
> function existed or to impement it myself. Any other suggestions?
I never found a good way of doing it :-( You can see what we did in
'convn' -- I think it is similar to your needs.
Søren