In article <0d8a3e52-4885-4443-9e10-679d56ccd2d3

@a34g2000yqn.googlegroups.com>,

(E-Mail Removed) says...

>

> On 12 May, 09:18, gwowen <(E-Mail Removed)> wrote:

> > On May 11, 6:44*pm, Seebs <(E-Mail Removed)> wrote:

> > > On 2010-05-11, Richard Heathfield <(E-Mail Removed)> wrote:

> > > > Seebs wrote:

>

> > > >>> You already have a list of foos, properly ordered for fast searching.

> > > >> No, I don't.

> > > > Then I suggest you get one.

> >

> > > It's often completely unsuitable to the problem at hand.

> >

> > If your problem is not amenable to Richard H's potted solutions, the

> > fault lies with your problem, not Richard's solution. *You should know

> > this by now.

> >

> > So if you have a disk-backed self-caching nested container storing a

> > 2million * 2million * 2million high resolution MRI scan image,

> > scrupiously reconstructed using Radon transforms. *You're searching

> > for pixels of a certain shade (that indicate a possible tumor, say),

> > then the first thing you should do is convert it into a one-

> > dimensional in-memory sorted C-array.

>

> how long does the sort take? Presumably you're doing more than one

> search.

>

> > The fact that you won't be able

> > to obtain the co-ordinates afterwards to display the appropriate slice

> > to the physician is irrelevant.

>

> well he might not agree

>

> >*Sort and binary search. *Any other

> > solution is wrong.

>

> I'm guessing you've actually done this
I hope not. It would be a travesty to perform a sort to locate somthing

easily found with a linear search.

Exactly N operations (where N is the pixel count) are needed to find

every pixel of a certain color (if K different pixels are needed then

hash the K wanted pixels to find the desired hash signatures, and have K

buckets, discarding all unwanted hash values).

Sorting will take N*log(N) operations.

8 * 10^18 is a lot of operations and will take some time.

Increasing that to C * 43 * 8 * 10^18 {where C is necessarily larger

than 1} is not a good idea, as I see it.

BTW, I guess that sorting this image will be rather problematic because

it is going to be an EXTERNAL sort for sure (at least 8 TB if the pixels

can only hold 256 values, and that is doubtful for a full resolution

medical image). That means it will probably take weeks.

I shudder at the sorting suggesting, and I love to sort things.