<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:windowtext}
.MsoChpDefault
{}
@page WordSection1
{margin:70.85pt 70.85pt 70.85pt 70.85pt}
div.WordSection1
{}
-->
</style>
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I’ve written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I’m writing.</span></p>
<p class="MsoNormal"><span lang="EN-US">The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts.
</span></p>
<p class="MsoNormal"><span lang="EN-US">The .h and .txx files are below.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">When creating this filter in my CUDA filter, I get an error message from the linker :
</span></p>
<p class="MsoNormal"><span lang="EN-US">../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >::New()':</span></p>
<p class="MsoNormal"><span lang="EN-US">/home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u> >::PublicBackProjectionImageFilter()'</span></p>
<p class="MsoNormal"><span lang="EN-US">collect2: error: ld returned 1 exit status
</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">It’s probably a stupid mistake, but I can’t find it. Can someone help me ?
</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<div style="border:none; border-bottom:solid windowtext 1.0pt; padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none; padding:0cm"><span lang="EN-US">rtkPublicBackProjectionImageFilter.h</span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">#ifndef __rtkPublicBackProjectionImageFilter_h</span></p>
<p class="MsoNormal"><span lang="EN-US">#define __rtkPublicBackProjectionImageFilter_h</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">#include "rtkBackProjectionImageFilter.h"</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">namespace rtk</span></p>
<p class="MsoNormal"><span lang="EN-US">{</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">/** \class PublicBackProjectionImageFilter</span></p>
<p class="MsoNormal"><span lang="EN-US">* \brief BackProjectionImageFilter where protected methods are made public</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* This filter exposes some of the methods that are protected in BackProjectionImageFilter</span></p>
<p class="MsoNormal"><span lang="EN-US">* Required for CudaProjectionStackToFourDImageFilter</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* \author Cyril Mory</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* \ingroup Projector</span></p>
<p class="MsoNormal"><span lang="EN-US">*/</span></p>
<p class="MsoNormal"><span lang="EN-US">template <class TInputImage, class TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">class ITK_EXPORT PublicBackProjectionImageFilter :</span></p>
<p class="MsoNormal"><span lang="EN-US"> public rtk::BackProjectionImageFilter<TInputImage,TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">{</span></p>
<p class="MsoNormal"><span lang="EN-US">public:</span></p>
<p class="MsoNormal"><span lang="EN-US"> /** Standard class typedefs. */</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef PublicBackProjectionImageFilter Self;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef itk::SmartPointer<Self> Pointer;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef itk::SmartPointer<const Self> ConstPointer;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef typename TInputImage::PixelType InputPixelType;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef typename TOutputImage::RegionType OutputImageRegionType;</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef rtk::ProjectionGeometry<TOutputImage::ImageDimension> GeometryType;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef typename GeometryType::Pointer GeometryPointer;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef typename GeometryType::MatrixType ProjectionMatrixType;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef itk::Image<InputPixelType, TInputImage::ImageDimension-1> ProjectionImageType;</span></p>
<p class="MsoNormal"><span lang="EN-US"> typedef typename ProjectionImageType::Pointer ProjectionImagePointer;</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> /** Method for creation through the object factory. */</span></p>
<p class="MsoNormal"><span lang="EN-US"> itkNewMacro(Self)</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> /** Run-time type information (and related methods). */</span></p>
<p class="MsoNormal"><span lang="EN-US"> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter)</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> /** The input is a stack of projections, we need to interpolate in one projection</span></p>
<p class="MsoNormal"><span lang="EN-US"> for efficiency during interpolation. Use of itk::ExtractImageFilter is</span></p>
<p class="MsoNormal"><span lang="EN-US"> not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */</span></p>
<p class="MsoNormal"><span lang="EN-US"> ProjectionImagePointer PublicGetProjection(const unsigned int iProj);</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> /** Creates iProj index to index projection matrices with current inputs</span></p>
<p class="MsoNormal"><span lang="EN-US"> instead of the physical point to physical point projection matrix provided by Geometry */</span></p>
<p class="MsoNormal"><span lang="EN-US"> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj);</span></p>
<p class="MsoNormal"><span lang="EN-US">protected:</span></p>
<p class="MsoNormal"><span lang="EN-US"> PublicBackProjectionImageFilter();</span></p>
<p class="MsoNormal"><span lang="EN-US"> virtual ~PublicBackProjectionImageFilter() {}</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">private:</span></p>
<p class="MsoNormal"><span lang="EN-US"> PublicBackProjectionImageFilter(const Self&); //purposely not implemented</span></p>
<p class="MsoNormal"><span lang="EN-US"> void operator=(const Self&); //purposely not implemented</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">};</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">} // end namespace rtk</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">#ifndef ITK_MANUAL_INSTANTIATION</span></p>
<p class="MsoNormal">#include "rtkPublicBackProjectionImageFilter.txx"</p>
<p class="MsoNormal">#endif</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">#endif</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<div style="border:none; border-bottom:solid windowtext 1.0pt; padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none; padding:0cm"><span lang="EN-US">rtkPublicBackProjectionImageFilter.txx</span></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="EN-US">/*=========================================================================</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* Copyright RTK Consortium</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* Licensed under the Apache License, Version 2.0 (the "License");</span></p>
<p class="MsoNormal"><span lang="EN-US">* you may not use this file except in compliance with the License.</span></p>
<p class="MsoNormal"><span lang="EN-US">* You may obtain a copy of the License at</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* http://www.apache.org/licenses/LICENSE-2.0.txt</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">* Unless required by applicable law or agreed to in writing, software</span></p>
<p class="MsoNormal"><span lang="EN-US">* distributed under the License is distributed on an "AS IS" BASIS,</span></p>
<p class="MsoNormal"><span lang="EN-US">* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></p>
<p class="MsoNormal"><span lang="EN-US">* See the License for the specific language governing permissions and</span></p>
<p class="MsoNormal"><span lang="EN-US">* limitations under the License.</span></p>
<p class="MsoNormal"><span lang="EN-US">*</span></p>
<p class="MsoNormal"><span lang="EN-US">*=========================================================================*/</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">#ifndef __rtkPublicBackProjectionImageFilter_txx</span></p>
<p class="MsoNormal"><span lang="EN-US">#define __rtkPublicBackProjectionImageFilter_txx</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">#include "rtkPublicBackProjectionImageFilter.h"</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">namespace rtk</span></p>
<p class="MsoNormal"><span lang="EN-US">{</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">//template <class TInputImage, class TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">//PublicBackProjectionImageFilter<TInputImage,TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">//::PublicBackProjectionImageFilter()</span></p>
<p class="MsoNormal"><span lang="EN-US">//{</span></p>
<p class="MsoNormal"><span lang="EN-US">//}</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">template <class TInputImage, class TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">typename PublicBackProjectionImageFilter<TInputImage,TOutputImage>::ProjectionImagePointer</span></p>
<p class="MsoNormal"><span lang="EN-US">PublicBackProjectionImageFilter<TInputImage,TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">::PublicGetProjection(const unsigned int iProj)</span></p>
<p class="MsoNormal"><span lang="EN-US">{</span></p>
<p class="MsoNormal"><span lang="EN-US"> return this->GetProjection(iProj);</span></p>
<p class="MsoNormal"><span lang="EN-US">}</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">template <class TInputImage, class TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">typename PublicBackProjectionImageFilter<TInputImage,TOutputImage>::ProjectionMatrixType</span></p>
<p class="MsoNormal"><span lang="EN-US">PublicBackProjectionImageFilter<TInputImage,TOutputImage></span></p>
<p class="MsoNormal"><span lang="EN-US">::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj)</span></p>
<p class="MsoNormal"><span lang="EN-US">{</span></p>
<p class="MsoNormal"><span lang="EN-US"> return this->GetIndexToIndexProjectionMatrix(iProj);</span></p>
<p class="MsoNormal">}</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">} // end namespace rtk</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">#endif</p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified
that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br>
</font>
</body>
</html>