<div dir="ltr"><div><div>Hi Solomon,<br></div>I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections).<br></div>So, here is my question : what happens if you replace <br><div><span style="white-space:pre-wrap"> </span>filter -> SetOutputOrigin(origin);<br></div><div>with<br></div><div><div><span style="white-space:pre-wrap"> </span>filter -> SetOutputOrigin(image->GetOutputOrigin());<br></div><div>Of course, it's not what you want to do but it might point to a wrong choice of origin...<br></div><div>Simon<br></div><br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 6, 2016 at 1:45 AM, Solomon Tang <span dir="ltr"><<a href="mailto:solomoncztang@gmail.com" target="_blank">solomoncztang@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 Simon,<div><br></div><div>I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response.</div><div><br></div><div>Thanks for looking into it!</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 12:16 AM, Simon Rit <span dir="ltr"><<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</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><div>Dear Solomon,<br></div>Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add<br>m_DataManager->UpdateCPUBuffer(); <br></div><div>before <br>m_DataManager->SetGPUBufferDirty();<br></div><div>in itkCudaImage.h line 121?<br></div><div>Thanks,<br></div>Simon<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 10:42 PM, Solomon Tang <span dir="ltr"><<a href="mailto:solomoncztang@gmail.com" target="_blank">solomoncztang@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">Thanks for the tip Simon,<div><br></div><div>I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. </div><div><br></div><div><div>template <class T, int IM_DIM></div><div>typename itk::CudaImage<T, IM_DIM>::Pointer ShiftOffset(</div><div><span style="white-space:pre-wrap"> </span>const typename itk::CudaImage<T, IM_DIM>::Pointer image,</div><div><span style="white-space:pre-wrap"> </span>const typename itk::Image<T,IM_DIM>::PointType origin)</div><div>{</div><div><span style="white-space:pre-wrap"> </span>typedef itk::ChangeInformationImageFilter< itk::CudaImage<T,IM_DIM> > FilterType;</div><div><span style="white-space:pre-wrap"> </span>FilterType::Pointer filter = FilterType::New();</div><div><span style="white-space:pre-wrap"> </span>filter -> SetInput(image);</div><div><span style="white-space:pre-wrap"> </span>filter -> SetOutputOrigin(origin);</div><div><span style="white-space:pre-wrap"> </span>filter -> ChangeOriginOn();</div><div><span style="white-space:pre-wrap"> </span>filter -> UpdateOutputInformation();</div><div><span style="white-space:pre-wrap"> </span>filter -> Update();</div><div><span style="white-space:pre-wrap"> </span>return filter->GetOutput();</div><div>}</div></div><div><br></div><div>If I pass the offset image pointer to ForwardProjection, it outputs a blank image.</div><div><br></div><div>However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this.</div><div><div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit <span dir="ltr"><<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi Solomon,<br>
Hard to say without the full code. Maybe the cudaness of your output image is lost further in the code. Try accessing the CPU buffer at the end, after the update, to be sure that the GPU image is transferred to CPU, e.g.<br>
std::cout << forwardProjection->GetOutput()->GetPointer() <<std::endl;<br>
Simon</p>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>