<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hello,</div><div><br></div><div>The most common mistake here would be forgetting to call Allocate on your image. Beyond that sharing your code would be helpful. </div><div><br></div><div>Brad</div><div><br>On Jul 26, 2016, at 1:43 PM, Andrew Harris <<a href="mailto:aharr8@uwo.ca">aharr8@uwo.ca</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hello,<div>I am attempting to use the CastImageFilter to convert between unsigned char and float image types, and am getting a System.AccessViolationException at runtime.  I have seen reference to this being caused by referring to a pointer that is out of scope, but in this case both the image and the cast filter are delcared in the same method, so I’m not sure how it can be going out of scope.  I can include the header and definition files if that would be helpful.<br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p>--</p><p>AH<br></p><p><br></p><p>-----------------------------------------------------------------------------------------------</p><p><i>This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></p></div></div></div></div></div></div></div></div></div>
</div></div>
</div></blockquote><blockquote type="cite"><div><span>_____________________________________</span><br><span>Powered by <a href="http://www.kitware.com">www.kitware.com</a></span><br><span></span><br><span>Visit other Kitware open-source projects at</span><br><span><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></span><br><span></span><br><span>Kitware offers ITK Training Courses, for more information visit:</span><br><span><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a></span><br><span></span><br><span>Please keep messages on-topic and check the ITK FAQ at:</span><br><span><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="http://public.kitware.com/mailman/listinfo/insight-users">http://public.kitware.com/mailman/listinfo/insight-users</a></span><br></div></blockquote></body></html>