<b>Hi,</b><div><b><br></b></div><div><b>I got a code of SheppLoganFilter and used it to filter a raw sinogram image (I am not sure if this is a correct use though). However, I got the following error:</b></div><div><br></div>
<div><div>writing image image/test2.png caused a problem.</div><div><br></div><div>itk::ExceptionObject (0122FEC4)</div><div>Location: &quot;void __thiscall itk::MultiThreader::SingleMethodExecute(void)&quot;</div><div>File: \ITK\InsightToolkit-3.8.0\Code\Common\itkMultiThreader.cxx</div>
<div>Line: 429</div><div>Description: itk::ERROR: MultiThreader(01870068): Exception occurred during Sing</div><div>leMethodExecute</div><div>c:\my rsch work\image reconstruction\code\SheppLoganFilter.cpp:27:</div><div>itk::ERROR: SheppLoganFilter(0177DD28): Member variable VRadius not properly ini</div>
<div>tialized.</div><div><br></div><div><br></div><div><b>The codes I used are attached in the following. Any comments/suggestions/help would be greatly appreciated.</b></div><div><b><br></b></div><div><b><br></b></div><div>
<b>The main function:</b></div><div><br></div><div><div>#include &quot;itkImage.h&quot;</div><div><br></div><div>using namespace std; </div><div><br></div><div>int main(int argc, char* argv[])</div><div>{<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>string filename(&quot;image/test.png&quot;);<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>string filename2(&quot;image/test2.png&quot;);<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef unsigned char uchar;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef uchar PixelType;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>const int Dimension = 2;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::Image&lt; PixelType, 2 &gt; ImageType;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//reading image from disk<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageFileReader&lt; ImageType &gt; ReaderType;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ReaderType::Pointer reader = ReaderType::New();<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;SetFileName(filename);<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;Update();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ImageType::Pointer input_image = ImageType::New(); </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>input_image = reader-&gt;GetOutput(); <span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef SheppLoganFilter&lt;ImageType, ImageType&gt;  FilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>FilterType::Pointer filter = FilterType::New();</div>
<div>        filter-&gt;SetInput(input_image);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageFileWriter&lt; ImageType &gt; WriterType;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>WriterType::Pointer writer = WriterType::New();<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>writer-&gt;SetInput(filter-&gt;GetOutput());</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>writer-&gt;SetFileName(filename2);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try<span class="Apple-tab-span" style="white-space:pre">        </span>{<span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>writer-&gt;Update();<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>catch( itk::ExceptionObject exp )<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{<span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>cerr &lt;&lt; &quot;writing image &quot; &lt;&lt; filename2 &lt;&lt; &quot; caused a problem.&quot; &lt;&lt; endl;<span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>cerr &lt;&lt; exp &lt;&lt; endl;<span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return 1;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>} <span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div>} </div><div><br></div><div><b>The SheppLoganFilter.h:</b></div><div>
<br></div><div><div><br></div><div>#ifndef __SheppLoganFilter_h</div><div>#define __SheppLoganFilter_h </div><div>#include &lt;vector&gt; </div><div><br></div><div><br></div><div>//ITK includes</div><div>#include &quot;itkImageToImageFilter.h&quot;</div>
<div>#include &quot;itkImageRegionIterator.h&quot;</div><div>#include &quot;itkConstNeighborhoodIterator.h&quot;</div><div>#include &quot;itkOffset.h&quot; </div><div><br></div><div>/*! </div><div> * \class SheppLoganFilter </div>
<div> * \brief Applies a shepp logan filter to an image and returns the filtered image. </div><div> */</div><div><br></div><div>template &lt; typename TInputImage,  typename TOutputImage &gt;</div><div>class SheppLoganFilter : public itk::ImageToImageFilter&lt; TInputImage, TOutputImage &gt;</div>
<div>{</div><div>public:    </div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! Standard class typedefs. */    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef SheppLoganFilter Self;    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageToImageFilter&lt; TInputImage, TOutputImage &gt; Superclass;    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::SmartPointer&lt; Self &gt; Pointer;    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::SmartPointer&lt; const Self &gt; ConstPointer;     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! Method for creation through object factory */    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>itkNewMacro(Self);     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! Run-time type information (and related methods) */    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>itkTypeMacro(SheppLoganFilter, ImageToImageFilter);     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Convenience typedefs    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef TInputImage ImageType;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef TOutputImage OImageType;    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef typename ImageType::RegionType RegionType;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ConstNeighborhoodIterator&lt; ImageType &gt; NeighborhoodIteratorType;<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageRegionIterator&lt; OImageType&gt; IteratorType; <span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef typename ImageType::ConstPointer ImageConstPointer;    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef typename OImageType::Pointer ImagePointer;     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! Extract dimension from input and output image. */    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>itkSetMacro(VRadius, int);    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>itkGetConstReferenceMacro(VRadius, int); </div><div><br>
</div><div>protected:    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>SheppLoganFilter();    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>virtual ~SheppLoganFilter() {}    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! Standard &quot;PrintSelf&quot; method */    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>void PrintSelf(std::ostream&amp; os, itk::Indent indent) const;     </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*!     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> * SheppLoganFilter can be implemented as a      </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> * multithreaded filter. Therefore, this implementation provides     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> * a ThreadedGenerateData() routine which is called for each      </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> * processing thread. The output image data is allocated      </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> * automatically by the superclass prior to calling      </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> * ThreadedGenerateData().  ThreadedGenerateData can only     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> * write to the portion of the output image specified by the     </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> * parameter &quot;outputRegionForThread&quot;.     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> *     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> * \sa ImageToImageFilter::ThreadedGenerateData(),     </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> *     ImageToImageFilter::GenerateData()     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> */    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>void ThreadedGenerateData(const RegionType&amp; regionForThread,                               </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span>  int threadId ); </div><div><br></div><div>private:    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>SheppLoganFilter(const Self&amp;) {}; //purposely not implemented    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>void operator=(const Self&amp;); //purposely not implemented     </div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/*! vertical radius of shepp logan filter  */    </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>int m_VRadius;</div><div>}; </div><div><br></div><div><br></div><div>#ifndef ITK_MANUAL_INSTANTIATION</div><div>#include &quot;SheppLoganFilter.cpp&quot;</div>
<div>#endif </div><div><br></div><div>#endif </div><div><br></div><div><b>And the SheppLoganFilter.cpp:</b></div><div><b><br></b></div><div><b><div><span class="Apple-style-span" style="font-weight: normal;">#ifndef _SheppLoganFilter_txx</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">#define _SheppLoganFilter_txx </span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">#include &quot;SheppLoganFilter.h&quot; </span></div>
<div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">#ifndef PI</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br>
</span></div><div><span class="Apple-style-span" style="font-weight: normal;">#define PI 3.141592653</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">#endif </span></div>
<div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">template &lt; typename TInputImage, typename TOutputImage &gt;</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">SheppLoganFilter&lt; TInputImage, TOutputImage &gt;::SheppLoganFilter()</span></div><div><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">m_VRadius = 0;</span></div><div>
<span class="Apple-style-span" style="font-weight: normal;">} </span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">template &lt; typename TInputImage, typename TOutputImage &gt;</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">void SheppLoganFilter&lt; TInputImage, TOutputImage &gt;</span></div><div><span class="Apple-style-span" style="font-weight: normal;">::ThreadedGenerateData(const RegionType&amp; </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                                        </span></span><span class="Apple-style-span" style="font-weight: normal;"> </span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                                        </span></span><span class="Apple-style-span" style="font-weight: normal;">   regionForThread, int threadId )</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">if(m_VRadius &lt;= 0)</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">itkExceptionMacro(&lt;&lt; &quot;Member variable VRadius not properly initialized.&quot;); </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">//pointers to output and input image</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">ImageConstPointer inputImage  = this-&gt;GetInput();</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">ImagePointer outputImage = this-&gt;GetOutput(); </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">RegionType inputRegion = inputImage-&gt;GetLargestPossibleRegion(); </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">RegionType outputRegion = outputImage-&gt;GetLargestPossibleRegion();</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">IteratorType out(outputImage, outputRegion); </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">NeighborhoodIteratorType::RadiusType radius;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">radius.Fill(0);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">radius[1] = m_VRadius;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">int vDim = m_VRadius*2+1;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">NeighborhoodIteratorType it(radius, inputImage, inputRegion); </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">//pointer to Shepp-Logan filter weights</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">float *sl = new float[vDim];</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">//vector with the OffsetTypes for the neighborhood iterator</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">std::vector&lt; NeighborhoodIteratorType::OffsetType &gt; offset; </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">int actIndex;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">for(int i = -m_VRadius; i &lt;= m_VRadius; ++i)</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">actIndex = i + m_VRadius;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">*(sl+actIndex) = -2.0/(PI*PI*(4*i*i-1));</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">NeighborhoodIteratorType::OffsetType tmpO = {{0,i}};</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">offset.push_back(tmpO);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">} </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">std::vector&lt; int &gt; tmpImg; </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); ++it, ++out)</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">float sum = 0;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">for(int i = 0; i &lt; m_VRadius*2+1; ++i)</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                        </span></span><span class="Apple-style-span" style="font-weight: normal;">sum += *(sl+i) * it.GetPixel(offset[i]);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">} </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">tmpImg.push_back(sum);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">} </span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">int i = 0;</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); ++it, ++out)</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">                </span></span><span class="Apple-style-span" style="font-weight: normal;">out.Set(tmpImg[i++]);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">}</span></div><div><span class="Apple-style-span" style="font-weight: normal;">} </span></div>
<div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">template &lt; typename TInputImage, typename TOutputImage&gt;</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;">void SheppLoganFilter&lt; TInputImage, TOutputImage &gt;::PrintSelf(std::ostream&amp; os, itk::Indent indent) const</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">{</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">Superclass::PrintSelf(os,indent);</span><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-weight: normal;">        </span></span><span class="Apple-style-span" style="font-weight: normal;">os &lt;&lt; &quot;VRadius = &quot; &lt;&lt; m_VRadius &lt;&lt; std::endl;</span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">} </span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br>
</span></div><div><span class="Apple-style-span" style="font-weight: normal;">#endif </span></div></b></div><div> </div></div></div><div><br></div></div>