Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Doubly Linked Lists of objects
Replies: 2   Last Post: Nov 10, 2009 6:10 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
rebecca donnelly

Posts: 2
Registered: 11/7/09
Doubly Linked Lists of objects
Posted: Nov 7, 2009 1:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I am a first year PhD student and am implementing the image processing algorithm "Seeded Region Growing" as an exercise to help me get to grips with Matlab and to gain a deeper understanding of the algorithm.

The paper asks for a datastructure they call a "Sequentially Sorted List", it needs to hold an object which contains the x and y coordinates of a pixel and another value called Sigma which the list is sorted by.

I attempted to do this using the following code:

% Calculate sigma and create a new pxladrs object
sigma_value = abs(seg_img(x+1, y) - mean_gl);
p = pxladrs(sigma_value);
% Add x and y coords to pxladrs object
p.Xvalue = x+1;
p.Yvalue = y;
% Add object to SSL
if counter==0
ssl_start = dlnode(p);
else
cur = ssl_start;
% Insert ordered by sigma value
while cur ~= 0
if p.Sigma < cur.Data.Sigma
ssl_insert = dlnode(p);
ssl_insert.insertBefore(cur);
break
end
end
cur = cur.Next;

However this didn't work as I couldn't store the pxladrs object in the doubly linked list.

Error:
??? Undefined function or method 'dlnode' for input arguments of
type 'pxladrs'.
Error in ==> SeededRegionGrowing at 58
ssl_start = dlnode(p);

So my question is; How do I modify the doubly linked list so it can handle objects? Or am I going about this totally the wrong way?

Any comments appriciated,
Rebecca



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2009. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Goodwin College of Professional Studies.