[Insight-users] Question about filter fanout and object copying?

Parag Chandra pchandra@radonc.unc.edu
Wed, 19 Mar 2003 14:57:35 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0043_01C2EE27.E0887650
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I need to read in about a dozen different images and keep them around in =
a std::vector<Image*>. To do this, I want to use just a single =
ImageFileReader and push_back() the output of the reader onto the vector =
inside of a loop. But I think this will cause a problem because each =
time the reader is updated to read a new file, every element in the =
vector will point to this most recent image, so really I will just end =
up with a bunch of 'copies' of the last image read. So my question is, =
should I just create a new ImageFileReader for each image that I want to =
read in, or is there some way that I could perform a deep copy of the =
Image and effectively break the link between the output of the reader =
and the pointer stored in my vector? Thanks in advance.

Best regards,
-Parag Chandra
------=_NextPart_000_0043_01C2EE27.E0887650
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I need to read in about a dozen =
different images=20
and keep them around in&nbsp;a std::vector&lt;Image*&gt;. To do this,=20
I&nbsp;want to use just&nbsp;a single ImageFileReader and push_back() =
the output=20
of the reader onto the vector inside of a loop. But I think this will =
cause a=20
problem because each time the reader is updated to read a new file, =
every=20
element in the vector will point to this most recent&nbsp;image, so =
really I=20
will just end up with a bunch of 'copies' of the last image read. So my =
question=20
is, should I just create a new ImageFileReader for each image that I =
want to=20
read in, or is there some way that I could perform a deep copy of the =
Image and=20
effectively break the link between the output of the reader and the =
pointer=20
stored in my vector? Thanks in advance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Best regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-Parag =
Chandra</FONT></DIV></BODY></HTML>

------=_NextPart_000_0043_01C2EE27.E0887650--