<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: "void __thiscall itk::MultiThreader::SingleMethodExecute(void)"</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 "itkImage.h"</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("image/test.png");<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>string filename2("image/test2.png");<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< PixelType, 2 > 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< ImageType > 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->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->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->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<ImageType, ImageType> FilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>FilterType::Pointer filter = FilterType::New();</div>
<div> filter->SetInput(input_image);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageFileWriter< ImageType > 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->SetInput(filter->GetOutput());</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>writer->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->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 << "writing image " << filename2 << " caused a problem." << endl;<span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>cerr << exp << 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 <vector> </div><div><br></div><div><br></div><div>//ITK includes</div><div>#include "itkImageToImageFilter.h"</div>
<div>#include "itkImageRegionIterator.h"</div><div>#include "itkConstNeighborhoodIterator.h"</div><div>#include "itkOffset.h" </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 < typename TInputImage, typename TOutputImage ></div><div>class SheppLoganFilter : public itk::ImageToImageFilter< TInputImage, TOutputImage ></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< TInputImage, TOutputImage > Superclass; </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::SmartPointer< Self > Pointer; </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::SmartPointer< const Self > 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< ImageType > 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< OImageType> 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 "PrintSelf" method */ </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>void PrintSelf(std::ostream& 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 "outputRegionForThread". </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& 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&) {}; //purposely not implemented </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>void operator=(const Self&); //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 "SheppLoganFilter.cpp"</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 "SheppLoganFilter.h" </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 < typename TInputImage, typename TOutputImage ></span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">SheppLoganFilter< TInputImage, TOutputImage >::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 < typename TInputImage, typename TOutputImage ></span></div>
<div><span class="Apple-style-span" style="font-weight: normal;">void SheppLoganFilter< TInputImage, TOutputImage ></span></div><div><span class="Apple-style-span" style="font-weight: normal;">::ThreadedGenerateData(const RegionType& </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 <= 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(<< "Member variable VRadius not properly initialized."); </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->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->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->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->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< NeighborhoodIteratorType::OffsetType > 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 <= 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< int > 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 < 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 < typename TInputImage, typename TOutputImage></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< TInputImage, TOutputImage >::PrintSelf(std::ostream& 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 << "VRadius = " << m_VRadius << 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>