<div>Thanks Luke:</div>
<div> </div>
<div>We'll look forward to your patch.<br><br></div>
<div class="gmail_quote">On Sat, Nov 8, 2008 at 3:29 PM, Luke Bloy <span dir="ltr"><<a href="mailto:luke.bloy@gmail.com">luke.bloy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Karthik,<br><br>Thanks for the reply, I saw those methods this morning an I've added them to the symmeticsecondranktensor and to the diffusionTesnor3D and everything is working. pretty well.<br>
<br>I've also added some methods for computing the matrix log and the matrix exponential,I'll send a patch once I'm done.<br><br>Thanks again.<br><font color="#888888">Luke</font>
<div>
<div></div>
<div class="Wj3C7c"><br><br><br>Karthik Krishnan wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">That is because the class itk::Vector defines copy constructors and<br>assignment operators that support implicit casting ... for instance..<br>
<br> Vector< float , N > can be assigned to Vector< double, N ><br><br>----<br>See<br><a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkVector.h?annotate=1.82&root=Insight" target="_blank">http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkVector.h?annotate=1.82&root=Insight</a> <br>
<br> /** Pass-through constructor for the Array base class. */<br> template< class TVectorValueType ><br> Vector(const Vector< TVectorValueType, NVectorDimension>& r): BaseArray(r) {}<br> Vector(const ValueType r[Dimension]): BaseArray(r) {} /** Pass-through assignment operator for the Array base class. */<br>
template< class TVectorValueType ><br> Vector& operator= (const Vector< TVectorValueType, NVectorDimension> & r)<br> {<br> BaseArray::operator=(r);<br> return *this;<br> }<br>----<br><br>Thus the copy constructor and the assignment operator are templated member functions.<br>
I did not add these to the DiffusionTensor3D or the SymmetricSecondRankTensor classes.<br>If you can add it to the SymmetricSecondRankTensor and DiffusionTensor3D class as<br>well... (should be just 5 lines), and send us the patch, we'd be happy to commit it.<br>
<br><br>Thanks<br><br><br>Luke Bloy wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi all,<br><br>I'm not sure what the correct forum for this question is but hopefully i can get some input here.<br>
<br>I'm trying to work with itkNaryFunctorImageFilter, I'm starting with the itkNaryAddImageFilter since it is fairly straight forward.<br><br>The problem is that i'd like to use it over DTI images, and there isn't a itkNumericTraits definition file for itkDiffusionTensor3D. So I created one based off of NumericTraitsVectorPixel.h and NumericTraitsVectorPixel.cxx. I also fixed the file itkNumericTraitsTensorPixel. I added my cxx classes to the CmakeLists in Code/Common and everything is working... except casting.<br>
<br>It seems that the AccumulateType is often defined to be above the pixelType<br>ie the accumulateType for a itk::vector<int,2> is itk::vector<long::2>, this makes sense and I maintained that in my DiffusionTensor3D NumericTraits file.<br>
<br>How ever static_casts fail which causes problems with code like this.<br><br> typedef typename NumericTraits< TInput >::AccumulateType AccumulatorType;<br> AccumulatorType sum = NumericTraits< TOutput >::Zero;<br>
for( unsigned int i=0; i< B.size(); i++ )<br> {<br> sum += static_cast< TOutput >(B[i]);<br> } return static_cast<TOutput>( sum );<br> }<br><br>So what am I missing? Is there somewhere else the I have to explicitly define the casting. There doesn't seem to be anything in the class definitions for itkVector, so I assume that it goes someplace other then in the class definitions.<br>
<br>Thanks in advance.<br>-Luke<br>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote><br></blockquote></div></div></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>R&D Engineer,<br>Kitware Inc.<br>Ph: 518 371 3971 x119<br>Fax: 518 371 3971<br>