<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi thanks for the response,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
what I needed however was to define the image as:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div> typedef BSplineFilterType::RealImageType RealImageType;</div>
<div> </div><div> RealImageType::Pointer confidenceImage = RealImageType::New();</div><div><br></div><div>However I still have my previous problem where no interpolation seems to be performed on the output, any suggestions appreciated</div>
<div><br></div><div>also bspline->GetDisplacementField() is a type ‘const itk::Image<itk::Vector<double, 3u>, 3u>*</div><div><br></div><div>How can I convert this to a ‘itk::Image<itk::Vector<double, 3u>, 3u>*’</div>
<div><br></div><div> such that outfield-=bspline->GetDisplacementField() is of type displacementfieldtype</div><div><br></div><div><div> typedef itk::Vector< double, Dimension > VectorPixelType; </div>
<div><span style="white-space:pre-wrap">        </span> typedef itk::Image<VectorPixelType, Dimension> DisplacementFieldType;</div></div><div><br></div><div>I currently write the output which seems to work but cant create an instance of it as outfield,</div>
<div><br></div><div>Help appreciated</div><div><br></div><div>Thanks</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 2:44 PM, Karthik Krishnan <span dir="ltr"><<a href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@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">RealValueType would mean an image with a datatype of 'double' and not 'float' as you have instantiated.<div>
<br></div><div>HTH</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">
On Thu, Apr 18, 2013 at 6:05 PM, Emma Saunders <span dir="ltr"><<a href="mailto:emmasaunders123@gmail.com" target="_blank">emmasaunders123@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">Hi Nick / all,<div><br></div><div>Thanks for your recent input w.r.t using a Confidence Image with the itk::DisplacementFieldToBSplineImageFilter. I am attempting to use it by creating my own confidence image via:</div>
<div><br></div><div><div> typedef float PixelType;</div><div><span style="white-space:pre-wrap">        </span> typedef itk::Image< PixelType, 3 > ImageType;</div><div><span style="white-space:pre-wrap">        </span> ImageType::Pointer ConfidenceImage = ImageType::New();</div>
</div><div><br></div><div><br></div><div>And applying appropriate size, index values etc.</div><div><br></div><div>and applying via Bspline->SetConfidenceImage(ConfidenceImage) </div><div>
<br></div><div>However an error I receive is "no matching function to: :SetConfidenceImage(itk::SmartPointer<itk::Image<float, 3u> >&)’"</div><div><br></div><div><br></div><div>
Output mentions using ::SetConfidenceImage(const itk::Image<typename TOutputImage::PixelType::RealValueType, itk::DisplacementFieldToBSplineImageFilter<TInputImage, TOutputImage>::ImageDimension>*)</div><div>
<br></div><div>Does this require I use a const image, if so I'm having trouble with defining such could someone point me in the right direction of how to create a const image as I can only find documentation w.r.t smartpointer images, or is there something that I have done wrong w.r.t the filter??</div>
<div><br></div><div>Advice appreciated</div><span><font color="#888888"><div><br></div><div>Emma</div><div><br></div><div><br></div><div><br></div></font></span></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Wed, Apr 17, 2013 at 4:37 PM, Nick Tustison <span dir="ltr"><<a href="mailto:ntustison@gmail.com" target="_blank">ntustison@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 style="word-wrap:break-word">Hi Emma,<div><br></div><div>Please keep the conversation on the email list as others</div><div>might have similar questions. </div><div><br></div><div>You're getting expected behavior based on what you're</div>
<div>telling me. I assume your sparse displacement field is </div><div>actually a "dense" displacement field with sparse non-zero </div><div>entries (at least that's the way the filter sees it). Fortunately,</div>
<div>there's an easy work-around. I put an option in the filter to</div><div>specify a confidence image which can be used to spatially </div><div>vary the weighting of individual displacement vectors. </div><div><br>
</div><div>filter->SetConfidenceImage( confidenceImage );</div><div><br></div><div>So, in your case, you would define the confidence image as an</div><div>image with a non-zero constant value (let's say '1' since only </div>
<div>the relative weighting matters) at the voxels that have non-zero </div><div>displacements. THat should give you what you need.</div><div><br></div><div>Nick</div><div><br></div><div><br></div><div><br></div><div><br>
</div><div>The filter is treating your zer</div><div><div><div><br></div><div><div><div>On Apr 17, 2013, at 11:16 AM, Emma Saunders <<a href="mailto:emmasaunders123@gmail.com" target="_blank">emmasaunders123@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">Hi Nick,<div><br></div><div>Thanks for pointing me in the correct direction of the test.</div><div><br></div><div>I am new to ITK, would you kindly offer some advice w.r.t itkDisplacementFieldToBSplineImageFilter.h</div>
<div><br></div><div>I have as input to this filter a sparse vector field, 5, 2D slices, each slice is spaced 20 voxels apart, I would like a dense approximation of this field and was under the impression this filter could do that, i.e interpolate between the slices</div>
<div><br></div><div>When I run the filter however and use bspliner->GetDisplacementField() what returns is something similar to the original, i.e the gaps inbetween are not filled in or interpolated. I have left the spline order at 3, fitting levels at 5 and control points at 4,</div>
<div><br></div><div>Would you be-able to clarify that my expectation of this filter are correct or offer any other alternatives for vector field interpolation?</div><div><br></div><div>Kind regards</div>
<div><br></div><div>Emma</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 8:31 PM, Nick Tustison <span dir="ltr"><<a href="mailto:ntustison@gmail.com" target="_blank">ntustison@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you look at the test?<br>
<br>
ITK/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx<br>
<div><div><br>
<br>
<br>
On Apr 16, 2013, at 2:47 PM, Emma Saunders <<a href="mailto:emmasaunders123@gmail.com" target="_blank">emmasaunders123@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> could anyone point me towards a working example which utilizes:<br>
><br>
> DisplacementFieldToBSplineImageFilter<br>
><br>
> Kind regards<br>
><br>
> Emma<br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>karthik
</font></span></div>
</blockquote></div><br></div>