<div dir="ltr"><div><div><div><div><div><div>Thanks very much, Luis,<br><br></div>I've now got a nice-looking inverse deformation field, but I am having trouble quantifying (extracting vector-field data) that matches my qualitative observations.<br>
<br></div>Once I get the deformation field from the Demons registration, I can use WarpImageFilter, with my 'moving' image data, and obtain a 'fixed' image look-a-like. Great! I would like to quantitatively report the transformation that takes the 'moving' image -> 'fixed' image, and I believe I need the inverse transform to do that (can you confirm?)<br>
<br></div>I then am opening the <b>inverted</b> deformation field in Paraview and exporting the vector values at each pixel (this data is used for a validation method I have).<br><br></div>Does all of that seem straightforward? My qualitative data (the output of the 'registered' image set looks really great!) and my quantitative visualization of the deformation field in paraview do not seem to line up as nicely as I had hoped.. could this simply be a result of the Demons reg. and inverting a def-dield?<br>
<br></div>If the 'registered' output from the Demons routine looks VERY MUCH like my 'fixed' data set, can I not safely assume that the deformable registration was a success?<br><br></div>Thanks again for your help,<br>
<div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 18, 2014 at 8:59 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Tim,<div><br></div><div>That casting seems indeed to be the problem.</div><div><br></div><div>When parsing the error message in the gist:</div>
<div><br></div><div><div> 18 Reason: </div><div> 19 </div><div> 20 cannot convert from '</div>
<div> 21 </div><div> 22 itk::Vector<T,NVectorDimension>' to '</div><div> 23 const itk::Vector<T,NVectorDimension>' 1> with </div><div> 24 </div><div> 25 1> [ 1> T=double, 1> NVectorDimension=3 1> ] 1> and </div>
<div> 26 1> [ 1> T=float, 1> NVectorDimension=3 1> ] 1> </div></div><div><br></div><div>Note that, there are both:</div><div><br></div><div>The "const" in the receiving variable (as Matt pointed out), and</div>
<div>The difference between float and double.</div><div><br></div><div>You may want to try this change:</div><div><br></div><div><div> 23 // typedef itk::Vector< float, Dimension > VectorPixelType;</div><div> 24 typedef itk::Vector< double, Dimension > VectorPixelType;</div>
</div><div><br></div><div>in InvertDeformationField.cxx </div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div> Luis</div><div><br></div><div><br></div></font></span></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 2:24 PM, Tim Bhatnagar <span dir="ltr"><<a href="mailto:tim.bhatnagar@gmail.com" target="_blank">tim.bhatnagar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So.. in the main program, I just cast the vector-pixel quantities as 'double' instead of 'float'... perhaps this is something that other compilers can internally correct for?<br>
<br></div>
Please let me know if this slight (or at least, what I believe to be 'slight') adjustment may cause any issues, post-build.<br><br>Thanks to all that helped,<br></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Sun, Jan 12, 2014 at 8:39 AM, Tim Bhatnagar <span dir="ltr"><<a href="mailto:tim.bhatnagar@gmail.com" target="_blank">tim.bhatnagar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Luis,, thanks for looking into that!<div><br></div><div>Unfortunately, I'm still getting the same error about the const designation somewhere... In the gist, did you see the error output I included form ms visual c++? That's about as much as I can offer up in terms of understanding the error...</div>
<div><br></div><div>Let me know if I can supply you with anything else, because I'd really appreciate the help!</div><div><br></div><div>Thanks,<div><div><br><br>On Saturday, January 11, 2014, Luis Ibanez wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Tim,<div><br></div><div>Thanks for sharing the code in the gist.</div><div><br></div><div>I just downloaded it and compile it in Linux,</div><div>with no errors.</div><div><br></div><div>Had you already fixed the problem ?</div>
<div>(maybe following Matt's advice ?)</div><div><br></div><div><br></div><div>Please let us know if we can still help,</div><div><br></div><div> Thanks</div><div><br></div><div> Luis</div><div><br></div><div>
<br></div></div><div><br><br><div>On Tue, Jan 7, 2014 at 12:12 PM, Tim Bhatnagar <span dir="ltr"><<a>tim.bhatnagar@gmail.com</a>></span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I've posted the cxx, txx and h-files associated with the program in question, to a gist:<br><br>
<a href="https://gist.github.com/anonymous/8302651" target="_blank">https://gist.github.com/anonymous/8302651</a><br><br>
</div>I'm certain this is a fairly trivial error (I hope!), but any direction is much appreciated!<br><br>Thanks,<br><br>Tim<br></div><div><div><div><br><br><div>
On Mon, Jan 6, 2014 at 3:44 PM, Matt McCormick <span dir="ltr"><<a>matt.mccormick@kitware.com</a>></span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Tim,<br>
<br>
The error looks like it is related to const'ness instead of SmartPointer from<br>
<br>
'itk::Vector<T,<br>
<div>NVectorDimension>' to 'const itk::Vector<T,NVectorDimension> &'<br>
<br>
</div>Hope this helps,<br>
Matt<br>
<div><div><br>
On Mon, Jan 6, 2014 at 6:30 PM, Tim Bhatnagar <<a>tim.bhatnagar@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trying to build an Inverter for Deformation Fields that I gathered from<br>
> source code at:<br>
><br>
> <a href="http://www.insight-journal.com/browse/publication/768" target="_blank">http://www.insight-journal.com/browse/publication/768</a><br>
><br>
> The error I'm pasting below has something to do with using smartpointers, I<br>
> believe, but if anyone can point to the change I need to make, I'd be very<br>
> appreciative. Thanks!<br>
><br>
> I am getting the following error when compiling in Visual Studio Express<br>
> 2010:<br>
><br>
> C:/ITKrap/InsightToolkit-4.2.0/Modules/Core/Common/include\itkFixedPointInverseDeformationFieldImageFilter.txx(109):<br>
> error C2664: 'itk::ImageRegionIterator<TImage>::Set' : cannot convert<br>
> parameter 1 from 'itk::Vector<T,NVectorDimension>' to 'const<br>
> itk::Vector<T,NVectorDimension> &'<br>
> with<br>
> [<br>
> TImage=itk::Image<VectorPixelType,3><br>
> ]<br>
> and<br>
> [<br>
> T=double,<br>
> NVectorDimension=3<br>
> ]<br>
> and<br>
> [<br>
> T=float,<br>
> NVectorDimension=3<br>
> ]<br>
> Reason: cannot convert from 'itk::Vector<T,NVectorDimension>' to<br>
> 'const itk::Vector<T,NVectorDimension>'<br>
> with<br>
> [<br>
> T=double,<br>
> NVectorDimension=3<br>
> ]<br>
> and<br>
> [<br>
> T=float,<br>
> NVectorDimension=3<br>
> ]<br>
> No user-defined-conversion operator available that can perform<br>
> this conversion, or the operator cannot be called<br>
><br>
> C:/ITKrap/InsightToolkit-4.2.0/Modules/Core/Common/include\itkFixedPointInverseDeformationFieldImageFilter.txx(51)<br>
> : while compiling class template member function 'void<br>
> itk::FixedPointInverseDeformationFieldImageFilter<TInputImage,TOutputImage>::GenerateData(void)'<br>
> with<br>
> [<br>
> TInputImage=InputDFType,<br>
> TOutputImage=OutputDFType<br>
> ]<br>
><br>
> C:\ITKrap\DiffeomorphicDemons-2009-06-Vercauteren-IJSource\InvertDeformationField.cxx(50)<br>
> : see reference to class template instantiation<br>
> 'itk::FixedPointInverseDeformationFieldImageFilter<TInputImage,TOutputImage>'<br>
> being compiled<br>
> with<br>
> [<br>
> TInputImage=InputDFType,<br>
> TOutputImage=OutputDFType<br>
> ]<br>
><br>
> --<br>
> Tim Bhatnagar<br>
> PhD Candidate<br>
> Orthopaedic Injury Biomechanics Group<br>
> Department of Mechanical Engineering<br>
> University of British Columbia<br>
><br>
> Rm 5000 - 818 West 10th Ave.<br>
> Vancouver, BC<br>
> Canada<br>
> V5Z 1M9<br>
><br>
> Ph: <a value="+16046758845">(604) 675-8845</a><br>
> Fax: <a value="+16046758820"></a></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></div></div><div><div><br><br>-- <br>Tim Bhatnagar<br>PhD Candidate<br>
Orthopaedic Injury Biomechanics Group<br>
Department of Mechanical Engineering<br>University of British Columbia<br><br>Rm 5000 - 818 West 10th Ave.<br>Vancouver, BC<br>Canada<br>V5Z 1M9<br><br>Ph: <a href="tel:%28604%29%20675-8845" value="+16046758845" target="_blank">(604) 675-8845</a><br>
Fax: <a href="tel:%28604%29%20675-8820" value="+16046758820" target="_blank">(604) 675-8820</a><br>Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Tim Bhatnagar<br>PhD Candidate<br>Orthopaedic Injury Biomechanics Group<br>Department of Mechanical Engineering<br>University of British Columbia<br><br>Rm 5000 - 818 West 10th Ave.<br>
Vancouver, BC<br>Canada<br>V5Z 1M9<br><br>Ph: <a href="tel:%28604%29%20675-8845" value="+16046758845" target="_blank">(604) 675-8845</a><br>Fax: <a href="tel:%28604%29%20675-8820" value="+16046758820" target="_blank">(604) 675-8820</a><br>
Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Tim Bhatnagar<br>PhD Candidate<br>Orthopaedic Injury Biomechanics Group<br>Department of Mechanical Engineering<br>University of British Columbia<br><br>Rm 5000 - 818 West 10th Ave.<br>
Vancouver, BC<br>Canada<br>V5Z 1M9<br><br>Ph: (604) 675-8845<br>Fax: (604) 675-8820<br>Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br>
</div>