From vl at xris.eu Mon Sep 2 06:51:52 2019 From: vl at xris.eu (vincent) Date: Mon, 2 Sep 2019 12:51:52 +0200 Subject: [Rtk-users] Problem loading shared libraries with RTK-2.0.1 Message-ID: Hi RTK community ! I recently wanted to move to the latest RTK release and downloaded ITK 5.0 from their website. I followed the compilation instructions from https://github.com/SimonRit/RTK/blob/master/INSTALLATION.md and encountered no problem during the compilation.? After running sudo make install in my build directory, I tried to run one of the applications and got the following error message: rtkosem: error while loading shared libraries: libITKIOXML-5.0.so.1: cannot open shared object file: No such file or directory I checked in my /usr/local/lib folder and found the library, with the correct name. Can anyone provide with some piece of advice on how to solve this issue ? I thank you very much in advance, best regards, Vincent From vl at xris.eu Tue Sep 3 10:16:59 2019 From: vl at xris.eu (vincent) Date: Tue, 3 Sep 2019 16:16:59 +0200 Subject: [Rtk-users] Problem loading shared libraries with RTK-2.0.1 In-Reply-To: References: Message-ID: <8dbeeb06-9f7f-85bb-0a2b-c5eb10e28423@xris.eu> Hi Simon, it indeed did work, thank you very much ! Best regards, Vincent On 03.09.19 15:18, Simon Rit wrote: > |export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/| -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed Sep 4 02:45:23 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 Sep 2019 08:45:23 +0200 Subject: [Rtk-users] Problem loading shared libraries with RTK-2.0.1 In-Reply-To: <8dbeeb06-9f7f-85bb-0a2b-c5eb10e28423@xris.eu> References: <8dbeeb06-9f7f-85bb-0a2b-c5eb10e28423@xris.eu> Message-ID: Hi, I guess this is something known in ITK, see this post . >From what I understand, it seems to be the expected behavior... Simon On Tue, Sep 3, 2019 at 4:35 PM vincent wrote: > Hi Simon, > > it indeed did work, thank you very much ! > > Best regards, > > Vincent > On 03.09.19 15:18, Simon Rit wrote: > > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed Sep 11 04:02:27 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 11 Sep 2019 10:02:27 +0200 Subject: [Rtk-users] Use existing Images when copying from/to GPU In-Reply-To: References: Message-ID: Hi Clemens, Sorry for not looking at your issue for a long time. I checked what you were saying and: - if I comment these two lines , indeed I don't get the forward projection since the buffer is still on the GPU only, as expected. - if I add a line proj_img_gpu.GetBufferPointer() in place, that does not help. This is because the output of the forward projection is a new image which contains the buffer that proj_img_gpu used to handle (but does not handle anymore). - if I add a line fwd.GetOutput().GetBufferPointer() or fwd.GetOutput().GetCudaDataManager().UpdateCPUBuffer(), it works fine. Can you maybe give an example of something which does not work as expected? Thanks again, Simon On Tue, Jul 16, 2019 at 4:21 PM C S wrote: > Hey Maik, > > here is some example code for a forwardprojection on GPU from a numpy > array volume. > > https://gist.github.com/clemisch/9ec752430b2eb65d9840d69fc8c058bb > > You may write a projector class around that to save the proj_spacing, > img_spacing, ... parameters and projector objects. Maybe even re-use the > GPU images. I constructed this snipped from my framework but did not test > it by itself; there might be bugs. Let me know if that helps you. > > > Best > Clemens > > Am Di., 16. Juli 2019 um 08:18 Uhr schrieb imt >: > >> Hej Clemens, >> >> I was following your conversation with Simon. I am quite interested in >> the problem. Do you have some simple example source code of your solution? >> That would be really helpful. >> >> Thank you in advance >> Maik >> On 9 Jul 2019, 18:24 +0200, C S , wrote: >> >> Hi Simon, >> >> I think I understood the issue. >> >> *Problem:* The CPUBufferPointer of the CudaImage gets altered after >> calling .Update() on the backprojection/forwardprojection filter. Because >> of that, the existing numpy array (I created the CPU and GPU images from) >> does not get changed from the filter. >> *Solution:* Obtain the CudaDataManager of the CudaImage *before* >> applying the back-/forwardprojection filter, apply the filter and >> .Update(), set cpu pointer and update buffer via >> >> manager.SetCPUBufferPointer(cpu_img.GetBufferPointer()) >> manager.UpdateCPUBuffer() >> >> The data from the cuda_img is correctly written in-place into the numpy >> array I constructed the cpu_img from. >> >> I don't know the underlying problem and cause why the CPUBuffer gets >> mangled, but this method achieves what I need. Thank you very much for your >> advice! >> >> >> Best >> Clemens >> >> Am Mo., 8. Juli 2019 um 18:07 Uhr schrieb C S : >> >> Hi Simon, >> >> I'm not sure I understand but have you tried grafting the Image or >> CudaImage to an existing itk::Image (the Graft function)? >> >> I tried that but when I call itk.GetArrayFromImage(cuda_img) on the >> grafted image (cpu_img.Graft(cuda_img)) I get the error ```ValueError: >> PyMemoryView_FromBuffer(): info->buf must not be NULL``` from within ITK >> (or its Python bindings). >> >> >> Again, I'm not sure I understand but you should be able to graft a >> CudaImage to another CudaImage. >> >> If anything I'd like to graft an Image into a CudaImage. When I try >> something like `cuda_img.Graft(cpu_img)` I get a TypeError. If this and >> the Graft'ing above would work (including the array view), that would be >> exactly my initial wish. >> >> >> You can always ask explicit transfers by calling the functions of the >> data manager (accessible via CudaImage::GetCudaDataManager()) >> >> I assume you mean manager.UpdateCPUBuffer()? When I run that, the CPU >> image I used to create the GPU image (by this >> ) >> is not updated. >> >> My scenario is this: I give a numpy array as a volume to be forward >> projected. I get a ImageView from that array, set origin and spacing of >> that image and transfer to GPU via your method >> . >> For the output projections, I use an ImageView from a numpy.zeros array >> with according shape, spacing and origin and transfer that to GPU the same >> way. I then use the CudaForwardProjection filter. Now I'd like to have the >> projection data on CPU. Unfortunately, none of the suggested methods worked >> for me other than using an itk.ImageDuplicator on the CudaImage :( >> >> Sorry for the lenghty mail. >> >> Best >> Clemens >> >> >> >> >> >> Best >> Clemens >> >> Am Mo., 8. Juli 2019 um 16:20 Uhr schrieb Simon Rit < >> simon.rit at creatis.insa-lyon.fr>: >> >> Hi, >> Conversion from Image to CudaImage is not optimal. The way I'm doing it >> now is shown in an example in these few lines >> . >> I am aware of the problem and discussed it on the ITK forum >> >> but I don't have a better solution yet. >> I'm not sure what you mean by explicitely transferring data from/to GPU >> but I guess you can always work with itk::Image and do your own CUDA >> computations in the GenerateData of the ImageFilter if you don't like the >> CudaImage mechanism. >> I hope this helps, >> Simon >> >> On Mon, Jul 8, 2019 at 10:06 PM C S wrote: >> >> Dear RTK users, >> >> I'm looking for a way to use exisiting ITK Images (either on GPU or in >> RAM) when transfering data from/to GPU. That is, not only re-using the >> Image object, but writing into the memory where its buffer is. >> >> Why: As I'm using the Python bindings, I guess this ties in with ITK >> wrapping the CudaImage type. In >> https://github.com/SimonRit/RTK/blob/master/utilities/ITKCudaCommon/include/itkCudaImage.h#L32 I >> read that the memory management is done implicitly and the CudaImage can be >> used with CPU filters. However when using the bindings, >> only rtk.BackProjectionImageFilter can be used with CudaImages. The other >> filters complain about not being wrapped for that type. >> >> That is why I want to explicitely transfer the data from/to GPU, but >> preferably using the exisiting Images and buffers. I can't rely on RTK >> managing GPU memory implicitly. >> >> >> Thank you very much for your help! >> Clemens >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> https://public.kitware.com/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> https://public.kitware.com/mailman/listinfo/rtk-users >> >> _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lomahu at gmail.com Wed Sep 25 15:12:47 2019 From: lomahu at gmail.com (Howard) Date: Wed, 25 Sep 2019 15:12:47 -0400 Subject: [Rtk-users] error in generating projections for Shepp-Logan phantom Message-ID: Hi, I was trying to run the Shepp Logan phantom example and got an error when creating projections of the phantom file by running the command: rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension 256 --phantomfile SheppLogan.txt The error is shown like this: ExceptionObject caught with ppc->Update() in file /sc/orga/work/howard/usr/local/ITK5/ITK/Modules/Remote/RTK/applications/rtkprojectgeometricphantom/rtkprojectgeometricphantom.cxx line 111 itk::ExceptionObject (0x1f72be0) Location: "unknown" File: /sc/orga/work/howard/usr/local/ITK5/ITK/Modules/Remote/RTK/src/rtkGeometricPhantomFileReader.cxx Line: 42 Description: itk::ERROR: Error opening File As you can see, I am using ITK5 which include RTK as a module. How can I quickly fix the problem? Thanks! Howard From lomahu at gmail.com Wed Sep 25 15:24:53 2019 From: lomahu at gmail.com (Howard) Date: Wed, 25 Sep 2019 15:24:53 -0400 Subject: [Rtk-users] error in generating projections for Shepp-Logan phantom In-Reply-To: References: Message-ID: I forgot to download the SheppLogan.txt file. It worked fine. Sorry for the noise. Howard On Wed, Sep 25, 2019 at 3:12 PM Howard wrote: > Hi, > > I was trying to run the Shepp Logan phantom example and got an error > when creating projections of the phantom file by running the command: > > rtkprojectgeometricphantom -g geometry.xml -o projections.mha > --spacing 2 --dimension 256 --phantomfile SheppLogan.txt > > The error is shown like this: > > ExceptionObject caught with ppc->Update() in file > > /sc/orga/work/howard/usr/local/ITK5/ITK/Modules/Remote/RTK/applications/rtkprojectgeometricphantom/rtkprojectgeometricphantom.cxx > line 111 > > itk::ExceptionObject (0x1f72be0) > Location: "unknown" > File: > /sc/orga/work/howard/usr/local/ITK5/ITK/Modules/Remote/RTK/src/rtkGeometricPhantomFileReader.cxx > Line: 42 > Description: itk::ERROR: Error opening File > > As you can see, I am using ITK5 which include RTK as a module. How can > I quickly fix the problem? Thanks! > > Howard > -------------- next part -------------- An HTML attachment was scrubbed... URL: