<div dir="ltr"><div><div><div><div>Hi,<br></div>Maybe we should explain that on the wiki, we'll prepare a page. In the meantime, a quick answer. InPlaceImageFilter modifies the first input (#0). Backprojection updates a volume from projection images, so the first input is the same as the output, the volume. Forward projection updates projection images from a volume so the first input is the same as the output, the projections. I do not see how you could modify this, could you give an example of why you would do that?<br></div>Yes, you can get the buffer pointer to the second input with filt->GetInput(1)->GetBufferPointer().<br></div>For the second part, I don't know what is the problem but if you could play with buffer pointers, I would try to avoid this if I were you because you then lose the pipeline capabilities of ITK filters.<br></div>I hope this helps,<br>Simon<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 5:33 PM, ghostcz <span dir="ltr"><<a href="mailto:ghostcz@hotmail.com" target="_blank">ghostcz@hotmail.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 dir="ltr">
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000">
<div>Hi Simon,</div>
<div> </div>
<div>Yes, it solved the problem.</div>
<div>There are some more related questions. Filters like backprojectionFilter
have more than one input. As it is an InPlaceFilter, it will overwrite the
input. But which input will be updated? From the existing filters, it seems it
is the input( 0 ). Is this defined somewhere? Can I change this? If I query the
buffer of input(1), will I get the correct address?</div>
<div>Another one: if I pass an ITK image pointer to a function instead of
defining this image as an input, will I run into the same problem? Does it have
an impact on speed and ram consumption?</div>
<div>Thank you!</div>
<div> </div>
<div>Best regards,</div>
<div>Louie</div>
<div style="FONT-SIZE:small;FONT-FAMILY:'Calibri';FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;TEXT-DECORATION:none;DISPLAY:inline">
<div style="FONT:10pt tahoma">
<div> </div>
<div style="BACKGROUND:#f5f5f5">
<div><b>From:</b> <a title="simon.rit@creatis.insa-lyon.fr" href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">Simon Rit</a> </div>
<div><b>Sent:</b> Wednesday, December 03, 2014 9:31 AM</div>
<div><b>To:</b> <a title="ghostcz@hotmail.com" href="mailto:ghostcz@hotmail.com" target="_blank">louie L</a> </div>
<div><b>Cc:</b> <a title="rtk-users@public.kitware.com" href="mailto:rtk-users@public.kitware.com" target="_blank">rtk-users@public.kitware.com</a>
</div>
<div><b>Subject:</b> Re: [Rtk-users] Input and output image
buffer</div></div></div>
<div> </div></div><div><div class="h5">
<div style="FONT-SIZE:small;FONT-FAMILY:'Calibri';FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;TEXT-DECORATION:none;DISPLAY:inline">
<div dir="ltr">
<div>
<div>Hi Louie,<br></div>What you do is correct and what you obtain is expected.
BackProjectionImageFilter inherits from InPlaceImageFilter. InPlaceImageFilter
overwrites the input by default. If you don't want this behavior, you can simply
call <a href="http://www.itk.org/Doxygen/html/classitk_1_1InPlaceImageFilter.html#a8d759f2bdeaf360a54524d87c5fc4d14" target="_blank">InPlaceOff</a>
before updating. Then , the buffers will be indeed pointing to different memory
spaces.<br></div>Hope this helps,<br>Simon<br></div>
<div class="gmail_extra">
<div> </div>
<div class="gmail_quote">On Tue, Dec 2, 2014 at 10:21 PM, louie L <span dir="ltr"><<a href="mailto:ghostcz@hotmail.com" target="_blank">ghostcz@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid">Dear
RTK users and developers,<br><br>I am writing a backprojection filter whose
superclass is ImageToImageFilter. After allocating the output, I
called<br>this->GetInput()->GetBufferPointer()
and<br>this->GetOutput()->GetBufferPointer().<br>to get the address of
the images in memory. However the two functions above return the same value.
Why? If this is not the correct way to get the address of the input image, how
can I get that address?<br>Thank you.<br><br>Best
regards,<br>Louie<br><br><br>_______________________________________________<br>Rtk-users
mailing list<br><a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a><br><a href="http://public.kitware.com/mailman/listinfo/rtk-users" target="_blank">http://public.kitware.com/mailman/listinfo/rtk-users</a><br></blockquote></div>
<div> </div></div></div></div></div></div></div></div>
</blockquote></div><br></div>