I was not. That fixed it. Thanks.<br><br><div class="gmail_quote">On Sun, Mar 6, 2011 at 4:37 PM, robert tamburo <span dir="ltr"><<a href="mailto:robert.tamburo@gmail.com">robert.tamburo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Do you call <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">m_EllipseToImageFilter->Update() before setting </span>tempBinaryPtr ?<br>
<br><div class="gmail_quote"><div><div></div><div class="h5">
On Sun, Mar 6, 2011 at 7:31 PM, Alexander Taghva <span dir="ltr"><<a href="mailto:alextaghva@gmail.com" target="_blank">alextaghva@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">
Hello,<br>
I'm having some trouble doing something that seems like it should be
simple to do. I am writing a composite filter, and I would like to
iterate over the output of one of the component filters. In my program,
it is a SpatialObjectToImageFilter templated over an ellipse spatial
object and binary image. I get a seg fault when I try to do it like
so. Thanks for any help. The key parts of the code are below:<br>
<br>
//////////////////////////////////////////////////////////////////////////<br>
<br>
// In the header file<br>
typedef itk::EllipseSpatialObject<3> EllipseType;<br>
typedef itk::SpatialObjectToImageFilter<EllipseType, BinaryImageType> EllipseToImageFilterType; <br>
typedef unsigned char BinaryPixelType;<br>
typedef itk::Image<BinaryPixelType, 3> BinaryImageType;<br>
typedef typename BinaryImageType::Pointer BinaryImagePointer;<br>
<br>
<br>
// in the txx file<br>
<br>
typename Superclass::InputImageConstPointer inputPtr = this->GetInput();<br>
// m_EllipseToImageFilter is my SpatialObjectToImageFilter<br>
BinaryImagePointer tempBinaryPtr = m_EllipseToImageFilter->GetOutput(); <br>
<br>
typedef itk::ImageRegionConstIterator<TInputImage> InputIterator;<br>
typedef itk::ImageRegionConstIterator<BinaryImageType> TempBinaryIterator;<br>
<br>
InputIterator inputIt( inputPtr, inputPtr->GetRequestedRegion() );<br>
TempBinaryIterator tempBinaryIt( tempBinaryPtr, tempBinaryPtr->GetRequestedRegion() );<br>
<br>
cout << "Seg fault happens here " << std::endl;<br>
for( inputIt.GoToBegin(), tempBinaryIt.GoToBegin();
!inputIt.IsAtEnd() && !tempBinaryIt.IsAtEnd() ; ++inputIt,
++tempBinaryIt ) <br>
{ <br>
if ( tempBinaryIt.Get() > 0 )<br>
// do something else;<br>
}<br>
<br>
<br>
///////////////////////////////////////////////<br>
<br>
Alex<br clear="all"><br>
<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
</blockquote></div><br><br clear="all"><br>-- <br>Alexander Taghva, MD<br>
Department of Neurological Surgery<br>
Keck School of Medicine, University of Southern California<br>
Fellow, Functional Neurosurgery at <span style="border-bottom: 2px dotted rgb(54, 99, 136);">Ohio State University</span><br>
<span style="border-bottom: 2px dotted rgb(54, 99, 136);">614-366-2420</span><br>
<a href="mailto:alextaghva@gmail.com" target="_blank">alextaghva@gmail.com</a><br>