<div dir="ltr">ITK uses a demand driven pipeline (as does VTK).<br><br>Update on a down stream filter will propagate upstream. If you need intermediate results in a pipeline then you must apply Update at the point you want the data.<br>
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 20, 2013 at 10:36 AM, Willi Huber <span dir="ltr">&lt;<a href="mailto:surfersparadise85-itk@yahoo.com" target="_blank">surfersparadise85-itk@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:tahoma,new york,times,serif"><div>Sorry,</div><div><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
I solved the problem.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">It wasn&#39;t due to the datatype. I forgot calling caster-&gt;Update().</div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">In the examples this method is never called. Why is this?</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">Cheers,</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
Willi</div><div><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;margin-top:5px;padding-left:5px">  <div style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:10pt"> <div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt">
 <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold">Von:</span></b> Willi Huber &lt;<a href="mailto:surfersparadise85-itk@yahoo.com" target="_blank">surfersparadise85-itk@yahoo.com</a>&gt;<br>
 <b><span style="font-weight:bold">An:</span></b> &quot;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&quot; &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt; <br>
 <b><span style="font-weight:bold">Gesendet:</span></b> 15:49 Samstag, 20.April 2013<br> <b><span style="font-weight:bold">Betreff:</span></b> [Insight-users] CastImageFilter: Error when casting to long long<br> </font> </div>
 <div><div><div class="h5"><br><div><div><div style="font-size:10pt;font-family:tahoma,&#39;new york&#39;,times,serif"><div style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:10pt">Hello,</div><div style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:10pt">
<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">I want to do some casting without success.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
For the purpose of generating an integral image and the bounded range in e.g. char I want to cast the image prior to caculating the
 integrals.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">Whenever I cast to long which
 is sufficient for 2D images it works all fine and also for small 3D test images when casting to long I get all the values I want to.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">Bu when I try casting to datatype long long using the CastImageFilter the output of the cast is an empty image, i.e. and image with index={0,0,0}, spacing={0,0,0}, size={0,0,0} and so on. So only standard values.</div>
<div style="background-color:transparent"><font face="tahoma, new york, times, serif">I had a look into the CastImageFilter-code and there is also a concept check </font><span style="background-color:transparent"><font face="tahoma, new york, times, serif">Concept::Convertible&lt; typename TInputImage::PixelType,</font></span><span style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:13px;background-color:transparent">  typename TOutputImage::PixelType &gt;</span></div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><span style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:13px;background-color:transparent">So why does this happen?</span></div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><span style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:13px;background-color:transparent"><br>
</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><span style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:13px;background-color:transparent">Short snippet of my code:</span></div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><span style="font-family:tahoma,&#39;new york&#39;,times,serif;font-size:13px;background-color:transparent">                                typedef itk::Image&lt;long long, 3&gt; ImageType;</span></div>
<div style="background-color:transparent"><span style="background-color:transparent"><font face="tahoma, new york, times, serif"><div style="background-color:transparent"><span style="white-space:pre-wrap">                                </span>typedef itk::Image&lt;unsigned short, Dimensions&gt; InputImageType;</div>
<div style="background-color:transparent"><span style="white-space:pre-wrap">                                </span>typedef itk::CastImageFilter&lt;InputImageType, ImageType&gt; CastType;</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
<br></div><div style="background-color:transparent"><span style="white-space:pre-wrap">                                </span>typename CastType::Pointer caster = CastType::New();</div><div style="background-color:transparent"><br></div><div style="background-color:transparent">
<span style="white-space:pre-wrap">                                </span>typename InputImageType::Pointer image = imageW-&gt;get&lt;InputImageType&gt;(); //imageW is a wrapper that allows handling of an image without knowing its type</div><div style="background-color:transparent">
<span style="white-space:pre-wrap">                                </span>caster-&gt;SetInput(image);</div><div style="background-color:transparent"><span style="white-space:pre-wrap">                                </span>typename ImageType::Pointer integral = caster-&gt;GetOutput();</div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
After execution of the previous code integral keeps and empty image. Not a itkSmartPointer that points to Null but a real image of my type without content as described above.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">I hope you
 can help me.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">
Thanks in advance,</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:tahoma,&#39;new york&#39;,times,serif">Willi</div></font></span></div></div></div></div><br></div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br><br></div> </div> </div> </blockquote></div>   </div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>