Sorting lists of lists...

J

JustSomeGuy

I have a class structure like:

class image : public list<class element> {};

class series : public list<class image>
{
public:
bool operator< (const image & img) const
{
return (image_id < img.image_id);
}
};

class study : public list<class series> {};
class patient : public list<class study> {};
class patients : public list<patient> {};

So sorting the series class is quite simple I just:

series s;
s.sort();

An unprocessed series can contain images from different studies and
different patients.

--------->>>> What I want to do is go through the series list and build
up a a sorted patient list.... (patients please!)

Within each image is a image_id, patient_id, series_id and a study_id.

What is the best way to build up the patient list?

I was thinking of modifying the series operator< and add the patient_id,
study_id series_id, and image_id so that at least that
list is completly sorted.... Then traverse the series list and populate
the patient list... (class patients)

Should I add a operator< to each class?

What do you think?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top