<div dir="ltr"><div>Nevermind,<br><br>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(255,139,255)">std</span><span style="color:rgb(207,191,173)">::</span><span style="color:rgb(255,139,255)">vector</span><span style="color:rgb(207,191,173)"><</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(128,139,237)">typename</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(255,139,255)">GradientImageType</span><span style="color:rgb(207,191,173)">::</span><span style="color:rgb(255,139,255)">Pointer</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)">></span><span style="color:rgb(100,100,130)"> </span>gradients<b><span style="color:rgb(207,191,173)">(</span>dims<span style="color:rgb(207,191,173)">);</span></b></pre>
<pre style="margin:0px;text-indent:0px">f<span style="color:rgb(128,139,237)">or</span><span style="color:rgb(207,191,173)">(</span><span style="color:rgb(128,139,237)">unsigned</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(128,139,237)">int</span><span style="color:rgb(100,100,130)"> </span>dim<span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)">=</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(240,173,109)">0</span><span style="color:rgb(207,191,173)">;</span><span style="color:rgb(100,100,130)"> </span>dim<span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)"><</span><span style="color:rgb(100,100,130)"> </span>dims<span style="color:rgb(207,191,173)">;</span><span style="color:rgb(100,100,130)"> </span>dim<span style="color:rgb(207,191,173)">++)</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)">{</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(128,139,237)">typename</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(255,139,255)">GradientImageType</span><span style="color:rgb(207,191,173)">::</span><span style="color:rgb(255,139,255)">Pointer</span><span style="color:rgb(100,100,130)"> </span>gradient<span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)">=</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(255,139,255)">GradientImageType</span><span style="color:rgb(207,191,173)">::</span>New<span style="color:rgb(207,191,173)">();</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(100,100,130)"> </span>gradient<span style="color:rgb(207,191,173)">-></span><span style="font-style:italic">SetRegions</span><span style="color:rgb(207,191,173)">(</span>roi<span style="color:rgb(207,191,173)">);</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(100,100,130)"> </span>gradient<span style="color:rgb(207,191,173)">-></span><span style="font-style:italic">Allocate</span><span style="color:rgb(207,191,173)">();</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(100,100,130)"> </span>gradients<span style="color:rgb(207,191,173)">[</span>dim<span style="color:rgb(207,191,173)">]</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(207,191,173)">=</span><span style="color:rgb(100,100,130)"> </span>gradient<span style="color:rgb(207,191,173)">;</span></pre>
<pre style="margin:0px;text-indent:0px">}<br></pre><br></div>It will use the default constructor, thought.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-17 12:52 GMT+02:00 Pol Monsó Purtà <span dir="ltr"><<a href="mailto:lluna.nova@gmail.com" target="_blank">lluna.nova@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello all,<br><br></div>How can I create n images inside a for loop? The smart pointer would go out of scope. How could I use a container?<br><br></div><div>Cheers,<br><br></div><div>Pol<br></div></div>
</blockquote></div><br></div>