<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Andrea,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:verdana,sans-serif">what you are missing is </span><font face="monospace, monospace">resampler->Update();</font></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 1, 2017 at 4:49 AM, AR_univr via Insight-users <span dir="ltr"><<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I'm having problems to convert Resampler Output to itk::Image .<br>
Here a snippet of what i'm doing :<br>
<br>
    const     unsigned int   ImageDimension = 3;<br>
    typedef   unsigned char  PixelType;<br>
    typedef   itk::Image< PixelType, ImageDimension > InputImageType;<br>
    typedef   itk::ResampleImageFilter< InputImageType,     InputImageType<br>
>  ResamplerType;<br>
    . . .<br>
    InputImageType::Pointer inputImage =  . . .<br>
<br>
    ResamplerType::Pointer resampler = ResamplerType::New();<br>
    InterpolatorType::Pointer interpolator = InterpolatorType::New();<br>
    resampler->SetInterpolator(int<wbr>erpolator);<br>
    InputImageType::SpacingType spacing = inputImage->GetSpacing();<br>
    InputImageType::PointType   origin = inputImage->GetOrigin();<br>
    InputImageType::DirectionType direction = inputImage->GetDirection();<br>
    InputImageType::RegionType region = inputImage->GetBufferedRegion(<wbr>);<br>
    InputImageType::SizeType   size = region.GetSize();<br>
<br>
    resampler->SetOutputSpacing(sp<wbr>acing);<br>
    resampler->SetOutputDirection(<wbr>direction);<br>
    resampler->SetOutputOrigin(ori<wbr>gin);<br>
    resampler->SetSize(size);<br>
    resampler->SetTransform(tps);<br>
<br>
    resampler->SetOutputStartIndex<wbr>(region.GetIndex());<br>
    resampler->SetInput(inputImage<wbr>);<br>
<br>
    std::cout << "[resampler] Written Origin   : " <<<br>
resampler->GetOutputOrigin()[0<wbr>] << ", " << resampler->GetOutputOrigin()[1<wbr>]<br>
<< ", " << resampler->GetOutputOrigin()[2<wbr>] << std::endl;<br>
    std::cout << "[resampler] Written Spacing  : " <<<br>
resampler->GetOutputSpacing()[<wbr>0] << ", " << resampler->GetOutputSpacing()[<wbr>1]<br>
<< ", " << resampler->GetOutputSpacing()[<wbr>2] << std::endl;        std::cout<br>
<< "[resampler] size : " << resampler->GetSize() << std::endl;<br>
    std::cout << "[resampler] transform : " << resampler->GetTransform() <<<br>
std::endl;<br>
    std::cout << "[resampler] num of outs : " <<<br>
resampler->GetNumberOfOutputs(<wbr>) << std::endl;<br>
    std::cout << "[resampler] Written Direction: \n" <<<br>
resampler->GetOutputDirection(<wbr>) << std::endl;<br>
<br>
<br>
Up to here i have the values, and it seems it's working.<br>
But when i do<br>
<br>
   InputImageType::Pointer output = resampler->GetOutput();<br>
<br>
output is empty, and i dont know why... Am i missing something?<br>
<br>
any help would be appreciated<br>
<br>
Thanks !<br>
<br>
Andrea<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://itk-insight-users.2283740.n2.nabble.com/" rel="noreferrer" target="_blank">http://itk-insight-users.22837<wbr>40.n2.nabble.com/</a><br>
The ITK community is transitioning from this mailing list to <a href="http://discourse.itk.org" rel="noreferrer" target="_blank">discourse.itk.org</a>. Please join us there!<br>
______________________________<wbr>__<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/product<wbr>s/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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>
</blockquote></div><br></div></div>