From amarnaths161 at gmail.com Fri Jan 11 06:45:28 2019 From: amarnaths161 at gmail.com (Amarnath S) Date: Fri, 11 Jan 2019 17:15:28 +0530 Subject: [Rtk-users] Running the WaterPreCorrection Example Message-ID: Hi, Requesting you to please help me in running the WaterPreCorrection example found here: http://wiki.openrtk.org/index.php/WaterPreCorrection I have built RTK using the WRAP_PYTHON flag set as On in CMake, However, I am not getting the file setup.py as output within the folder \SimpleRTK-build\Wrapping\Python\Packaging. It is creating a file called setupegg.py, which in turn calls setup.py. I followed the instructions mentioned on top of this page - http://wiki.openrtk.org/index.php/SimpleRTK. But the file setup.py is not generated. Consequently, I am not able to run this example on my machine. Requesting you to please help me with this. Thanks and Regards - Amarnath -------------- next part -------------- An HTML attachment was scrubbed... URL: From amarnaths161 at gmail.com Mon Jan 14 06:22:41 2019 From: amarnaths161 at gmail.com (Amarnath S) Date: Mon, 14 Jan 2019 16:52:41 +0530 Subject: [Rtk-users] WaterPreCorrectionImageFilter - C++ Sample available? Message-ID: Hi, Is there a C++ example file illustrating the use of rtk::WaterPreCorrectionImageFilter? If so, can it please be shared across. Thanks a lot. Thanks and regards - Amarnath -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon Jan 14 09:05:59 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 14 Jan 2019 15:05:59 +0100 Subject: [Rtk-users] Running the WaterPreCorrection Example In-Reply-To: References: Message-ID: Hi, Have you checked that it's not in a subfolder? I remember that it got in a subfolder for some versions. To be honest, we are not using SimpleRTK anymore, we are gradually switching to a python package for RTK as an external module of ITK. I will update the examples when we release it. Best regards, Simon On Fri, Jan 11, 2019 at 12:45 PM Amarnath S wrote: > Hi, > > Requesting you to please help me in running the WaterPreCorrection > example found here: http://wiki.openrtk.org/index.php/WaterPreCorrection > > I have built RTK using the WRAP_PYTHON flag set as On in CMake, > However, I am not getting the file setup.py as output within the > folder \SimpleRTK-build\Wrapping\Python\Packaging. It is creating a file > called setupegg.py, which in turn calls setup.py. I followed the > instructions mentioned on top of this page - > http://wiki.openrtk.org/index.php/SimpleRTK. But the file setup.py is not > generated. > > Consequently, I am not able to run this example on my machine. > Requesting you to please help me with this. > > Thanks and Regards > - Amarnath > _______________________________________________ > 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 Mon Jan 14 09:08:52 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 14 Jan 2019 15:08:52 +0100 Subject: [Rtk-users] WaterPreCorrectionImageFilter - C++ Sample available? In-Reply-To: References: Message-ID: Hi, No, we don't have any C++ code to do the polynomial fit, we found it more straightforward to do it in Python. When you have the polynomial, you can apply it using the --wpc option from the reconstruction command line tools, e.g., rtkfdk. Best regards, Simon On Mon, Jan 14, 2019 at 12:23 PM Amarnath S wrote: > Hi, > > Is there a C++ example file illustrating the use of > rtk::WaterPreCorrectionImageFilter? If so, can it please be shared across. > Thanks a lot. > > Thanks and regards > - Amarnath > _______________________________________________ > 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 colddiesun at gmail.com Wed Jan 16 16:59:40 2019 From: colddiesun at gmail.com (tao sun) Date: Wed, 16 Jan 2019 16:59:40 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage Message-ID: Hi, I have read in some image using itk::ImportImageFilter. ImportFilterType::Pointer projectionReader = ImportFilterType::New(); ... projectionReader->Update(); The type of the image is itk:::Image. I wonder if there is any way I can cast it to itk::CudaImage? In rtkforwardprojections.cxx the imageReaderType is defined as CudaImageType so there is no such problem. Thanks, Tao -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Wed Jan 16 17:06:30 2019 From: andreasga22 at gmail.com (Andreas Andersen) Date: Wed, 16 Jan 2019 23:06:30 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Hi Tao, I think you want the CastImageFilter from ITK. Something like this: using castToImageType = itk::CastImageFilter, itk::CudaImage>; typename castToImageType::Pointer castfilter = castToImageType::New(); castfilter->SetInput(projectionReader->GetOutput()); castfilter->Update(); auto cuda_image = castfilter->GetOutput(); Best regards Andreas __________________________________ Andreas Gravgaard Andersen Department of Oncology, Aarhus University Hospital N?rrebrogade 44, 8000, Aarhus C Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Wed, 16 Jan 2019 at 22:59, tao sun wrote: > Hi, > > I have read in some image using itk::ImportImageFilter. > ImportFilterType::Pointer projectionReader = ImportFilterType::New(); > ... > projectionReader->Update(); > > The type of the image is itk:::Image. I wonder if there is any > way I can cast it to itk::CudaImage? > In rtkforwardprojections.cxx the imageReaderType is defined as > CudaImageType so there is no such problem. > > Thanks, > Tao > _______________________________________________ > 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 Thu Jan 17 00:26:38 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 17 Jan 2019 06:26:38 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Hi, That's one solution. Two other: - graft the output to a Cuda image itk::CudaImage::Pointer cuImg = itk::CudaImage::New(); cuImg->Graft(projectionReader->GetOutput()) - use the rtk::ImportImageFilter which is templated over image type to allow precisely this (I used it in Gate here ). Best regards, Simon On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen wrote: > Hi Tao, > > I think you want the CastImageFilter > from ITK. > > Something like this: > using castToImageType = itk::CastImageFilter, > itk::CudaImage>; > typename castToImageType::Pointer castfilter = castToImageType::New(); > castfilter->SetInput(projectionReader->GetOutput()); > castfilter->Update(); > auto cuda_image = castfilter->GetOutput(); > > Best regards Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Department of Oncology, > > Aarhus University Hospital > > N?rrebrogade 44, > > 8000, Aarhus C > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Wed, 16 Jan 2019 at 22:59, tao sun wrote: > >> Hi, >> >> I have read in some image using itk::ImportImageFilter. >> ImportFilterType::Pointer projectionReader = ImportFilterType::New(); >> ... >> projectionReader->Update(); >> >> The type of the image is itk:::Image. I wonder if there is any >> way I can cast it to itk::CudaImage? >> In rtkforwardprojections.cxx the imageReaderType is defined as >> CudaImageType so there is no such problem. >> >> Thanks, >> Tao >> _______________________________________________ >> 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 amarnaths161 at gmail.com Thu Jan 17 07:57:18 2019 From: amarnaths161 at gmail.com (Amarnath S) Date: Thu, 17 Jan 2019 18:27:18 +0530 Subject: [Rtk-users] Running the WaterPreCorrection Example In-Reply-To: References: Message-ID: Hi Simon, Thanks for your reply. I am in the process of converting the Python program to C++, and have done more than half the file. Since I am new to RTK, there is some amount of trial/ experimentation in coding. I am now in the place where the Update() method of the FDKConeBeamReconstructionFilter object is first called. This line is throwing an exception, which is: itk::ERROR: FDKBackProjectionImageFilter(00000263E25240A0): Mismatch between the number of projections and the geometry entries. Geometry has 5 entries, which is less than the last index of the projections stack, i.e., 6. Now, I know for sure that there are 5 entries in the Geometry file, which I downloaded from the site mentioned. earlier. What I am not seeing is where is it getting the last index of the projections stack, which is shown as 6. Any help in this regard would be highly appreciated. Thanks and regards - Amarnath On Mon, Jan 14, 2019 at 7:36 PM Simon Rit wrote: > Hi, > Have you checked that it's not in a subfolder? I remember that it got in a > subfolder for some versions. To be honest, we are not using SimpleRTK > anymore, we are gradually switching to a python package for RTK as an > external module of ITK. I will update the examples when we release it. > Best regards, > Simon > > On Fri, Jan 11, 2019 at 12:45 PM Amarnath S > wrote: > >> Hi, >> >> Requesting you to please help me in running the WaterPreCorrection >> example found here: http://wiki.openrtk.org/index.php/WaterPreCorrection >> >> I have built RTK using the WRAP_PYTHON flag set as On in CMake, >> However, I am not getting the file setup.py as output within the >> folder \SimpleRTK-build\Wrapping\Python\Packaging. It is creating a file >> called setupegg.py, which in turn calls setup.py. I followed the >> instructions mentioned on top of this page - >> http://wiki.openrtk.org/index.php/SimpleRTK. But the file setup.py is >> not generated. >> >> Consequently, I am not able to run this example on my machine. >> Requesting you to please help me with this. >> >> Thanks and Regards >> - Amarnath >> _______________________________________________ >> 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 Thu Jan 17 08:06:37 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 17 Jan 2019 14:06:37 +0100 Subject: [Rtk-users] Running the WaterPreCorrection Example In-Reply-To: References: Message-ID: Hi, The second input of FDK is the projection stack. This stack is a 3D image and the last dimension must equal the number of projections in the geometry file. So maybe you are reading 6 projections? I hope this helps, Simon On Thu, Jan 17, 2019 at 1:57 PM Amarnath S wrote: > Hi Simon, > > Thanks for your reply. I am in the process of converting the Python > program to C++, and have done more than half the file. Since I am new to > RTK, there is some amount of trial/ experimentation in coding. I am now in > the place where the Update() method of the FDKConeBeamReconstructionFilter > object is first called. This line is throwing an exception, which is: > > itk::ERROR: FDKBackProjectionImageFilter(00000263E25240A0): Mismatch > between the number of projections and the geometry entries. Geometry has 5 > entries, which is less than the last index of the projections stack, i.e., > 6. > > Now, I know for sure that there are 5 entries in the Geometry file, which > I downloaded from the site mentioned. earlier. What I am not seeing is > where is it getting the last index of the projections stack, which is shown > as 6. > > Any help in this regard would be highly appreciated. > > Thanks and regards > - Amarnath > > On Mon, Jan 14, 2019 at 7:36 PM Simon Rit > wrote: > >> Hi, >> Have you checked that it's not in a subfolder? I remember that it got in >> a subfolder for some versions. To be honest, we are not using SimpleRTK >> anymore, we are gradually switching to a python package for RTK as an >> external module of ITK. I will update the examples when we release it. >> Best regards, >> Simon >> >> On Fri, Jan 11, 2019 at 12:45 PM Amarnath S >> wrote: >> >>> Hi, >>> >>> Requesting you to please help me in running the WaterPreCorrection >>> example found here: http://wiki.openrtk.org/index.php/WaterPreCorrection >>> >>> I have built RTK using the WRAP_PYTHON flag set as On in CMake, >>> However, I am not getting the file setup.py as output within the >>> folder \SimpleRTK-build\Wrapping\Python\Packaging. It is creating a file >>> called setupegg.py, which in turn calls setup.py. I followed the >>> instructions mentioned on top of this page - >>> http://wiki.openrtk.org/index.php/SimpleRTK. But the file setup.py is >>> not generated. >>> >>> Consequently, I am not able to run this example on my machine. >>> Requesting you to please help me with this. >>> >>> Thanks and Regards >>> - Amarnath >>> _______________________________________________ >>> 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 fredrik.hellman at gmail.com Thu Jan 17 11:20:19 2019 From: fredrik.hellman at gmail.com (Fredrik Hellman) Date: Thu, 17 Jan 2019 17:20:19 +0100 Subject: [Rtk-users] RTK going to become an ITK external module? Message-ID: Hi all, I have noticed that there is work going on in the master branch in the RTK repo towards some kind of tighter integration with ITK. External Module? I am interested in following this development and in particular how it will affect the builds in the future. Is there any discussion thread that I can subscribe to somewhere to get updates on this topic? Best regards, Fredrik Hellman -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu Jan 17 11:29:13 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 17 Jan 2019 17:29:13 +0100 Subject: [Rtk-users] RTK going to become an ITK external module? In-Reply-To: References: Message-ID: Hi Fredrik, Yes, we have been working on that in the past year. I'm correcting a few last things before releasing a new RTK version. When this is done, I'll submit the Modules/Remote /RTK.remote.cmake file to the itk repository. You can give it a try already with the enclosed file (which will download master). Impact: - you can either turn on RTK compilation from the ITK compilation or provide the ITK build path in a separate RTK build (as before except the ITK dir cannot be an installed ITK), - check the evolution of the examples/FirstReconstruction/CMakeLists compared to the last release to see how the CMakeLists.txt has changed, - we'll provide pre-compiled python packages compatible with the pre-compiled ITK python packages. There is no specific thread, just follow the mailing list and I'll post a message for (1) the RTK release and (2) when the RTK remote module file has been integrated to ITK. Best regards, Simon On Thu, Jan 17, 2019 at 5:20 PM Fredrik Hellman wrote: > Hi all, > > I have noticed that there is work going on in the master branch in the RTK > repo towards some kind of tighter integration with ITK. External Module? > > I am interested in following this development and in particular how it > will affect the builds in the future. Is there any discussion thread that I > can subscribe to somewhere to get updates on this topic? > > Best regards, > Fredrik Hellman > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: RTK.remote.cmake Type: application/octet-stream Size: 163 bytes Desc: not available URL: From colddiesun at gmail.com Sat Jan 19 20:51:05 2019 From: colddiesun at gmail.com (tao sun) Date: Sat, 19 Jan 2019 20:51:05 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Thank you all! I will give a try using your solutions. Tao Simon Rit ? 2019?1?17? ?? ??12:26??? > Hi, > That's one solution. Two other: > - graft the output to a Cuda image > itk::CudaImage::Pointer cuImg = itk::CudaImage::New(); > cuImg->Graft(projectionReader->GetOutput()) > - use the rtk::ImportImageFilter which is templated over image type to > allow precisely this (I used it in Gate here > > ). > Best regards, > Simon > > On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen > wrote: > >> Hi Tao, >> >> I think you want the CastImageFilter >> from ITK. >> >> Something like this: >> using castToImageType = itk::CastImageFilter, >> itk::CudaImage>; >> typename castToImageType::Pointer castfilter = castToImageType::New(); >> castfilter->SetInput(projectionReader->GetOutput()); >> castfilter->Update(); >> auto cuda_image = castfilter->GetOutput(); >> >> Best regards Andreas >> >> __________________________________ >> >> Andreas Gravgaard Andersen >> >> Department of Oncology, >> >> Aarhus University Hospital >> >> N?rrebrogade 44, >> >> 8000, Aarhus C >> >> Mail: agravgaard at protonmail.com >> >> Cell: +45 3165 8140 >> >> >> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >> >>> Hi, >>> >>> I have read in some image using itk::ImportImageFilter. >>> ImportFilterType::Pointer projectionReader = ImportFilterType::New(); >>> ... >>> projectionReader->Update(); >>> >>> The type of the image is itk:::Image. I wonder if there is any >>> way I can cast it to itk::CudaImage? >>> In rtkforwardprojections.cxx the imageReaderType is defined as >>> CudaImageType so there is no such problem. >>> >>> Thanks, >>> Tao >>> _______________________________________________ >>> 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 amarnaths161 at gmail.com Mon Jan 28 05:45:40 2019 From: amarnaths161 at gmail.com (Amarnath S) Date: Mon, 28 Jan 2019 16:15:40 +0530 Subject: [Rtk-users] Regarding rtk::ProjectionsReader Message-ID: Hi, I am using a rtk::ProjectionsReader as follows: typedef float OutputPixelType; const unsigned int Dimension = 3; typedef itk::Image< OutputPixelType, Dimension > OutputImageType; rtk::ProjectionsReader::Pointer projReader; projReader = rtk::ProjectionsReader::New(); projReader->SetFileNames(fileNames); // filenames is defined and set earlier Now, according to this page http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionsReader.html, this class has a GenerateData() method, which does the real work. In the GitHub rtk-master downloaded last week, this method does not seem to be present. There is only one method name beginning with Generate..., and it is GenerateOutputInformation(). What is the new method name for GenerateData(). If it cannot be called directly, how else is it to be invoked? Will calling of Update() internally call GenerateData()? Thanks and regards - Amarnath -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Mon Jan 28 06:39:23 2019 From: andreasga22 at gmail.com (Andreas Andersen) Date: Mon, 28 Jan 2019 12:39:23 +0100 Subject: [Rtk-users] Regarding rtk::ProjectionsReader In-Reply-To: References: Message-ID: Yes, as far as I remember: Update calls Generate on all filters (a reader is also a filter) in the pipeline. UpdateOutputInformation calls GenerateOutputInformation, which might be useful if you need properties of an image without reading the actual data, yet. Best regards Andreas On Mon, 28 Jan 2019, 11:45 Amarnath S Hi, > > I am using a rtk::ProjectionsReader as follows: > > typedef float OutputPixelType; > const unsigned int Dimension = 3; > typedef itk::Image< OutputPixelType, Dimension > OutputImageType; > > rtk::ProjectionsReader::Pointer projReader; > projReader = rtk::ProjectionsReader::New(); > projReader->SetFileNames(fileNames); // filenames is defined and set > earlier > > Now, according to this page > http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionsReader.html, > this class has a GenerateData() method, which does the real work. In the > GitHub rtk-master downloaded last week, this method does not seem to be > present. There is only one method name beginning with Generate..., and it > is GenerateOutputInformation(). What is the new method name for > GenerateData(). If it cannot be called directly, how else is it to be > invoked? Will calling of Update() internally call GenerateData()? > > Thanks and regards > - Amarnath > > _______________________________________________ > 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 Tue Jan 29 04:04:43 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 29 Jan 2019 10:04:43 +0100 Subject: [Rtk-users] Regarding rtk::ProjectionsReader In-Reply-To: References: Message-ID: Dear Amarnath, GenerateData exists, see http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionsReader-members.html This is ITK's internal machinery. When you call Update, it will call itk::DataObject::Update(). This will call UpdateOutputInformation, PropagateRequestedRegion and UpdateOutputData. The latter will call UpdateOutputData in ImageSource which will eventually call GenerateData. See ITK doc for more info. Cheers, Simon On Mon, Jan 28, 2019 at 12:39 PM Andreas Andersen wrote: > Yes, as far as I remember: > Update calls Generate on all filters (a reader is also a filter) in the > pipeline. > UpdateOutputInformation calls GenerateOutputInformation, which might be > useful if you need properties of an image without reading the actual data, > yet. > > Best regards > Andreas > > On Mon, 28 Jan 2019, 11:45 Amarnath S >> Hi, >> >> I am using a rtk::ProjectionsReader as follows: >> >> typedef float OutputPixelType; >> const unsigned int Dimension = 3; >> typedef itk::Image< OutputPixelType, Dimension > OutputImageType; >> >> rtk::ProjectionsReader::Pointer projReader; >> projReader = rtk::ProjectionsReader::New(); >> projReader->SetFileNames(fileNames); // filenames is defined and set >> earlier >> >> Now, according to this page >> http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionsReader.html, >> this class has a GenerateData() method, which does the real work. In the >> GitHub rtk-master downloaded last week, this method does not seem to be >> present. There is only one method name beginning with Generate..., and it >> is GenerateOutputInformation(). What is the new method name for >> GenerateData(). If it cannot be called directly, how else is it to be >> invoked? Will calling of Update() internally call GenerateData()? >> >> Thanks and regards >> - Amarnath >> >> _______________________________________________ >> 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 colddiesun at gmail.com Tue Jan 29 19:22:44 2019 From: colddiesun at gmail.com (tao sun) Date: Tue, 29 Jan 2019 19:22:44 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Hi again, Finally I got time to work on this. I was able to compile the program this time using the Graft() function. However, there's a runtime error when I run the program: /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 @ unknown : Cuda Error #3 terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: Cuda Error # 3 Aborted It happens when a new gpu backprojector is created: bp = rtk::CudaRayCastBackProjectionImageFilter::New(); Any insights for this? Thanks, Tao tao sun ? 2019?1?19? ?? ??8:51??? > Thank you all! I will give a try using your solutions. > Tao > > Simon Rit ? 2019?1?17? ?? ??12:26??? > >> Hi, >> That's one solution. Two other: >> - graft the output to a Cuda image >> itk::CudaImage::Pointer cuImg = itk::CudaImage::New(); >> cuImg->Graft(projectionReader->GetOutput()) >> - use the rtk::ImportImageFilter which is templated over image type to >> allow precisely this (I used it in Gate here >> >> ). >> Best regards, >> Simon >> >> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen >> wrote: >> >>> Hi Tao, >>> >>> I think you want the CastImageFilter >>> from >>> ITK. >>> >>> Something like this: >>> using castToImageType = itk::CastImageFilter, >>> itk::CudaImage>; >>> typename castToImageType::Pointer castfilter = castToImageType::New(); >>> castfilter->SetInput(projectionReader->GetOutput()); >>> castfilter->Update(); >>> auto cuda_image = castfilter->GetOutput(); >>> >>> Best regards Andreas >>> >>> __________________________________ >>> >>> Andreas Gravgaard Andersen >>> >>> Department of Oncology, >>> >>> Aarhus University Hospital >>> >>> N?rrebrogade 44, >>> >>> 8000, Aarhus C >>> >>> Mail: agravgaard at protonmail.com >>> >>> Cell: +45 3165 8140 >>> >>> >>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>> >>>> Hi, >>>> >>>> I have read in some image using itk::ImportImageFilter. >>>> ImportFilterType::Pointer projectionReader = ImportFilterType::New(); >>>> ... >>>> projectionReader->Update(); >>>> >>>> The type of the image is itk:::Image. I wonder if there is any >>>> way I can cast it to itk::CudaImage? >>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>> CudaImageType so there is no such problem. >>>> >>>> Thanks, >>>> Tao >>>> _______________________________________________ >>>> 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 simon.rit at creatis.insa-lyon.fr Wed Jan 30 01:25:22 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 30 Jan 2019 07:25:22 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Hi, No, not really. In my experience, this occurs mainly when you don't have a GPU properly configured for CUDA. Can you check the value of CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. Simon On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: > Hi again, > > Finally I got time to work on this. I was able to compile the program this > time using the Graft() function. However, there's a runtime error when I > run the program: > > > /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 > @ unknown : Cuda Error #3 > terminate called after throwing an instance of 'itk::ExceptionObject' > what(): > /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: > Cuda Error # 3 > Aborted > > It happens when a new gpu backprojector is created: > bp = rtk::CudaRayCastBackProjectionImageFilter::New(); > > Any insights for this? > > Thanks, > Tao > > tao sun ? 2019?1?19? ?? ??8:51??? > >> Thank you all! I will give a try using your solutions. >> Tao >> >> Simon Rit ? 2019?1?17? ?? ??12:26??? >> >>> Hi, >>> That's one solution. Two other: >>> - graft the output to a Cuda image >>> itk::CudaImage::Pointer cuImg = itk::CudaImage>> 3>::New(); >>> cuImg->Graft(projectionReader->GetOutput()) >>> - use the rtk::ImportImageFilter which is templated over image type to >>> allow precisely this (I used it in Gate here >>> >>> ). >>> Best regards, >>> Simon >>> >>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen >>> wrote: >>> >>>> Hi Tao, >>>> >>>> I think you want the CastImageFilter >>>> from >>>> ITK. >>>> >>>> Something like this: >>>> using castToImageType = itk::CastImageFilter, >>>> itk::CudaImage>; >>>> typename castToImageType::Pointer castfilter = castToImageType::New(); >>>> castfilter->SetInput(projectionReader->GetOutput()); >>>> castfilter->Update(); >>>> auto cuda_image = castfilter->GetOutput(); >>>> >>>> Best regards Andreas >>>> >>>> __________________________________ >>>> >>>> Andreas Gravgaard Andersen >>>> >>>> Department of Oncology, >>>> >>>> Aarhus University Hospital >>>> >>>> N?rrebrogade 44, >>>> >>>> 8000, Aarhus C >>>> >>>> Mail: agravgaard at protonmail.com >>>> >>>> Cell: +45 3165 8140 >>>> >>>> >>>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>>> >>>>> Hi, >>>>> >>>>> I have read in some image using itk::ImportImageFilter. >>>>> ImportFilterType::Pointer projectionReader = ImportFilterType::New(); >>>>> ... >>>>> projectionReader->Update(); >>>>> >>>>> The type of the image is itk:::Image. I wonder if there is >>>>> any way I can cast it to itk::CudaImage? >>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>> CudaImageType so there is no such problem. >>>>> >>>>> Thanks, >>>>> Tao >>>>> _______________________________________________ >>>>> 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 colddiesun at gmail.com Wed Jan 30 11:04:43 2019 From: colddiesun at gmail.com (tao sun) Date: Wed, 30 Jan 2019 11:04:43 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Hi Simon, CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like rtkfdk with gpu on without any problem though, By the way I am using CUDA 9.2.88. Tao Simon Rit ? 2019?1?30? ?? ??1:25??? > Hi, > No, not really. In my experience, this occurs mainly when you don't have a > GPU properly configured for CUDA. Can you check the value of CUDA_HAVE_GPU > in cmake ? If it's OFF, then this is indeed the problem. > Simon > > On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: > >> Hi again, >> >> Finally I got time to work on this. I was able to compile the program >> this time using the Graft() function. However, there's a runtime error when >> I run the program: >> >> >> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >> @ unknown : Cuda Error #3 >> terminate called after throwing an instance of 'itk::ExceptionObject' >> what(): >> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >> Cuda Error # 3 >> Aborted >> >> It happens when a new gpu backprojector is created: >> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >> >> Any insights for this? >> >> Thanks, >> Tao >> >> tao sun ? 2019?1?19? ?? ??8:51??? >> >>> Thank you all! I will give a try using your solutions. >>> Tao >>> >>> Simon Rit ? 2019?1?17? ?? ??12:26??? >>> >>>> Hi, >>>> That's one solution. Two other: >>>> - graft the output to a Cuda image >>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>> 3>::New(); >>>> cuImg->Graft(projectionReader->GetOutput()) >>>> - use the rtk::ImportImageFilter which is templated over image type to >>>> allow precisely this (I used it in Gate here >>>> >>>> ). >>>> Best regards, >>>> Simon >>>> >>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>> andreasga22 at gmail.com> wrote: >>>> >>>>> Hi Tao, >>>>> >>>>> I think you want the CastImageFilter >>>>> from >>>>> ITK. >>>>> >>>>> Something like this: >>>>> using castToImageType = itk::CastImageFilter, >>>>> itk::CudaImage>; >>>>> typename castToImageType::Pointer castfilter = castToImageType::New(); >>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>> castfilter->Update(); >>>>> auto cuda_image = castfilter->GetOutput(); >>>>> >>>>> Best regards Andreas >>>>> >>>>> __________________________________ >>>>> >>>>> Andreas Gravgaard Andersen >>>>> >>>>> Department of Oncology, >>>>> >>>>> Aarhus University Hospital >>>>> >>>>> N?rrebrogade 44, >>>>> >>>>> 8000, Aarhus C >>>>> >>>>> Mail: agravgaard at protonmail.com >>>>> >>>>> Cell: +45 3165 8140 >>>>> >>>>> >>>>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I have read in some image using itk::ImportImageFilter. >>>>>> ImportFilterType::Pointer projectionReader = ImportFilterType::New(); >>>>>> ... >>>>>> projectionReader->Update(); >>>>>> >>>>>> The type of the image is itk:::Image. I wonder if there is >>>>>> any way I can cast it to itk::CudaImage? >>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>> CudaImageType so there is no such problem. >>>>>> >>>>>> Thanks, >>>>>> Tao >>>>>> _______________________________________________ >>>>>> 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 simon.rit at creatis.insa-lyon.fr Wed Jan 30 11:13:33 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 30 Jan 2019 17:13:33 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Are you using the HEAD version of the git ? Because I recently corrected a bug in the Graft function (commit b2d73642ce171ba9890af2c107a1a31f923454b5). Simon On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: > Hi Simon, > > CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like rtkfdk with > gpu on without any problem though, > By the way I am using CUDA 9.2.88. > > Tao > > > > > > Simon Rit ? 2019?1?30? ?? ??1:25??? > >> Hi, >> No, not really. In my experience, this occurs mainly when you don't have >> a GPU properly configured for CUDA. Can you check the value of >> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >> Simon >> >> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >> >>> Hi again, >>> >>> Finally I got time to work on this. I was able to compile the program >>> this time using the Graft() function. However, there's a runtime error when >>> I run the program: >>> >>> >>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>> @ unknown : Cuda Error #3 >>> terminate called after throwing an instance of 'itk::ExceptionObject' >>> what(): >>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>> Cuda Error # 3 >>> Aborted >>> >>> It happens when a new gpu backprojector is created: >>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>> >>> Any insights for this? >>> >>> Thanks, >>> Tao >>> >>> tao sun ? 2019?1?19? ?? ??8:51??? >>> >>>> Thank you all! I will give a try using your solutions. >>>> Tao >>>> >>>> Simon Rit ? 2019?1?17? ?? ??12:26??? >>>> >>>>> Hi, >>>>> That's one solution. Two other: >>>>> - graft the output to a Cuda image >>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>> 3>::New(); >>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>> - use the rtk::ImportImageFilter which is templated over image type to >>>>> allow precisely this (I used it in Gate here >>>>> >>>>> ). >>>>> Best regards, >>>>> Simon >>>>> >>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>> andreasga22 at gmail.com> wrote: >>>>> >>>>>> Hi Tao, >>>>>> >>>>>> I think you want the CastImageFilter >>>>>> from >>>>>> ITK. >>>>>> >>>>>> Something like this: >>>>>> using castToImageType = itk::CastImageFilter, >>>>>> itk::CudaImage>; >>>>>> typename castToImageType::Pointer castfilter = castToImageType::New(); >>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>> castfilter->Update(); >>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>> >>>>>> Best regards Andreas >>>>>> >>>>>> __________________________________ >>>>>> >>>>>> Andreas Gravgaard Andersen >>>>>> >>>>>> Department of Oncology, >>>>>> >>>>>> Aarhus University Hospital >>>>>> >>>>>> N?rrebrogade 44, >>>>>> >>>>>> 8000, Aarhus C >>>>>> >>>>>> Mail: agravgaard at protonmail.com >>>>>> >>>>>> Cell: +45 3165 8140 >>>>>> >>>>>> >>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>> ImportFilterType::New(); >>>>>>> ... >>>>>>> projectionReader->Update(); >>>>>>> >>>>>>> The type of the image is itk:::Image. I wonder if there is >>>>>>> any way I can cast it to itk::CudaImage? >>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>> CudaImageType so there is no such problem. >>>>>>> >>>>>>> Thanks, >>>>>>> Tao >>>>>>> _______________________________________________ >>>>>>> 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 colddiesun at gmail.com Wed Jan 30 11:20:56 2019 From: colddiesun at gmail.com (tao sun) Date: Wed, 30 Jan 2019 11:20:56 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: No I am not using that. But the error was thrown before GRAFT() function was called. It happens when I initialized the backprojector: bp = rtk::CudaRayCastBackProjectionImageFilter::New(). Tao Simon Rit ? 2019?1?30? ?? ??11:13??? > Are you using the HEAD version of the git ? Because I recently corrected a > bug in the Graft function (commit b2d73642ce171ba9890af2c107a1a31f923454b5). > Simon > > On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: > >> Hi Simon, >> >> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >> rtkfdk with gpu on without any problem though, >> By the way I am using CUDA 9.2.88. >> >> Tao >> >> >> >> >> >> Simon Rit ? 2019?1?30? ?? ??1:25??? >> >>> Hi, >>> No, not really. In my experience, this occurs mainly when you don't have >>> a GPU properly configured for CUDA. Can you check the value of >>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>> Simon >>> >>> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >>> >>>> Hi again, >>>> >>>> Finally I got time to work on this. I was able to compile the program >>>> this time using the Graft() function. However, there's a runtime error when >>>> I run the program: >>>> >>>> >>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>> @ unknown : Cuda Error #3 >>>> terminate called after throwing an instance of >>>> 'itk::ExceptionObject' >>>> what(): >>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>> Cuda Error # 3 >>>> Aborted >>>> >>>> It happens when a new gpu backprojector is created: >>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>> >>>> Any insights for this? >>>> >>>> Thanks, >>>> Tao >>>> >>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>> >>>>> Thank you all! I will give a try using your solutions. >>>>> Tao >>>>> >>>>> Simon Rit ? 2019?1?17? ?? ??12:26??? >>>>> >>>>>> Hi, >>>>>> That's one solution. Two other: >>>>>> - graft the output to a Cuda image >>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>> 3>::New(); >>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>> - use the rtk::ImportImageFilter which is templated over image type >>>>>> to allow precisely this (I used it in Gate here >>>>>> >>>>>> ). >>>>>> Best regards, >>>>>> Simon >>>>>> >>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>> andreasga22 at gmail.com> wrote: >>>>>> >>>>>>> Hi Tao, >>>>>>> >>>>>>> I think you want the CastImageFilter >>>>>>> >>>>>>> from ITK. >>>>>>> >>>>>>> Something like this: >>>>>>> using castToImageType = itk::CastImageFilter, >>>>>>> itk::CudaImage>; >>>>>>> typename castToImageType::Pointer castfilter = >>>>>>> castToImageType::New(); >>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>> castfilter->Update(); >>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>> >>>>>>> Best regards Andreas >>>>>>> >>>>>>> __________________________________ >>>>>>> >>>>>>> Andreas Gravgaard Andersen >>>>>>> >>>>>>> Department of Oncology, >>>>>>> >>>>>>> Aarhus University Hospital >>>>>>> >>>>>>> N?rrebrogade 44, >>>>>>> >>>>>>> 8000, Aarhus C >>>>>>> >>>>>>> Mail: agravgaard at protonmail.com >>>>>>> >>>>>>> Cell: +45 3165 8140 >>>>>>> >>>>>>> >>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>> ImportFilterType::New(); >>>>>>>> ... >>>>>>>> projectionReader->Update(); >>>>>>>> >>>>>>>> The type of the image is itk:::Image. I wonder if there is >>>>>>>> any way I can cast it to itk::CudaImage? >>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>> CudaImageType so there is no such problem. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Tao >>>>>>>> _______________________________________________ >>>>>>>> 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 simon.rit at creatis.insa-lyon.fr Wed Jan 30 11:29:08 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 30 Jan 2019 17:29:08 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Can you send the code if you want us to help? On Wed, Jan 30, 2019 at 5:21 PM tao sun wrote: > No I am not using that. But the error was thrown before GRAFT() function > was called. It happens when I initialized the backprojector: > bp = rtk::CudaRayCastBackProjectionImageFilter::New(). > > Tao > > Simon Rit ? 2019?1?30? ?? ??11:13??? > >> Are you using the HEAD version of the git ? Because I recently corrected >> a bug in the Graft function (commit >> b2d73642ce171ba9890af2c107a1a31f923454b5). >> Simon >> >> On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: >> >>> Hi Simon, >>> >>> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >>> rtkfdk with gpu on without any problem though, >>> By the way I am using CUDA 9.2.88. >>> >>> Tao >>> >>> >>> >>> >>> >>> Simon Rit ? 2019?1?30? ?? ??1:25??? >>> >>>> Hi, >>>> No, not really. In my experience, this occurs mainly when you don't >>>> have a GPU properly configured for CUDA. Can you check the value of >>>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>>> Simon >>>> >>>> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >>>> >>>>> Hi again, >>>>> >>>>> Finally I got time to work on this. I was able to compile the program >>>>> this time using the Graft() function. However, there's a runtime error when >>>>> I run the program: >>>>> >>>>> >>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>>> @ unknown : Cuda Error #3 >>>>> terminate called after throwing an instance of >>>>> 'itk::ExceptionObject' >>>>> what(): >>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>>> Cuda Error # 3 >>>>> Aborted >>>>> >>>>> It happens when a new gpu backprojector is created: >>>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>>> >>>>> Any insights for this? >>>>> >>>>> Thanks, >>>>> Tao >>>>> >>>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>>> >>>>>> Thank you all! I will give a try using your solutions. >>>>>> Tao >>>>>> >>>>>> Simon Rit ? 2019?1?17? ?? ??12:26??? >>>>>> >>>>>>> Hi, >>>>>>> That's one solution. Two other: >>>>>>> - graft the output to a Cuda image >>>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>>> 3>::New(); >>>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>>> - use the rtk::ImportImageFilter which is templated over image type >>>>>>> to allow precisely this (I used it in Gate here >>>>>>> >>>>>>> ). >>>>>>> Best regards, >>>>>>> Simon >>>>>>> >>>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>>> andreasga22 at gmail.com> wrote: >>>>>>> >>>>>>>> Hi Tao, >>>>>>>> >>>>>>>> I think you want the CastImageFilter >>>>>>>> >>>>>>>> from ITK. >>>>>>>> >>>>>>>> Something like this: >>>>>>>> using castToImageType = itk::CastImageFilter, >>>>>>>> itk::CudaImage>; >>>>>>>> typename castToImageType::Pointer castfilter = >>>>>>>> castToImageType::New(); >>>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>>> castfilter->Update(); >>>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>>> >>>>>>>> Best regards Andreas >>>>>>>> >>>>>>>> __________________________________ >>>>>>>> >>>>>>>> Andreas Gravgaard Andersen >>>>>>>> >>>>>>>> Department of Oncology, >>>>>>>> >>>>>>>> Aarhus University Hospital >>>>>>>> >>>>>>>> N?rrebrogade 44, >>>>>>>> >>>>>>>> 8000, Aarhus C >>>>>>>> >>>>>>>> Mail: agravgaard at protonmail.com >>>>>>>> >>>>>>>> Cell: +45 3165 8140 >>>>>>>> >>>>>>>> >>>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>>> ImportFilterType::New(); >>>>>>>>> ... >>>>>>>>> projectionReader->Update(); >>>>>>>>> >>>>>>>>> The type of the image is itk:::Image. I wonder if there >>>>>>>>> is any way I can cast it to itk::CudaImage? >>>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>>> CudaImageType so there is no such problem. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Tao >>>>>>>>> _______________________________________________ >>>>>>>>> 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 andreasga22 at gmail.com Wed Jan 30 11:33:49 2019 From: andreasga22 at gmail.com (Andreas Andersen) Date: Wed, 30 Jan 2019 17:33:49 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: I've encountered the "Cuda Error # 3" issue two times. As far as I remember, both were caused by the GPU being unreachable at runtime: * A missing or outdated (relative to CUDA version) nVidia driver * The code running within a non-native environment. The second point can also be triggered if the binary is located on remote storage. However, both of these cases were on Windows, and by the path "/home/tsun/bin/" I would guess you're on some Linux distro. /Andreas __________________________________ Andreas Gravgaard Andersen Department of Oncology, Aarhus University Hospital N?rrebrogade 44, 8000, Aarhus C Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Wed, 30 Jan 2019 at 17:29, Simon Rit wrote: > Can you send the code if you want us to help? > > On Wed, Jan 30, 2019 at 5:21 PM tao sun wrote: > >> No I am not using that. But the error was thrown before GRAFT() function >> was called. It happens when I initialized the backprojector: >> bp = rtk::CudaRayCastBackProjectionImageFilter::New(). >> >> Tao >> >> Simon Rit ? 2019?1?30? ?? ??11:13??? >> >>> Are you using the HEAD version of the git ? Because I recently corrected >>> a bug in the Graft function (commit >>> b2d73642ce171ba9890af2c107a1a31f923454b5). >>> Simon >>> >>> On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: >>> >>>> Hi Simon, >>>> >>>> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >>>> rtkfdk with gpu on without any problem though, >>>> By the way I am using CUDA 9.2.88. >>>> >>>> Tao >>>> >>>> >>>> >>>> >>>> >>>> Simon Rit ? 2019?1?30? ?? ??1:25??? >>>> >>>>> Hi, >>>>> No, not really. In my experience, this occurs mainly when you don't >>>>> have a GPU properly configured for CUDA. Can you check the value of >>>>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>>>> Simon >>>>> >>>>> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >>>>> >>>>>> Hi again, >>>>>> >>>>>> Finally I got time to work on this. I was able to compile the program >>>>>> this time using the Graft() function. However, there's a runtime error when >>>>>> I run the program: >>>>>> >>>>>> >>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>>>> @ unknown : Cuda Error #3 >>>>>> terminate called after throwing an instance of >>>>>> 'itk::ExceptionObject' >>>>>> what(): >>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>>>> Cuda Error # 3 >>>>>> Aborted >>>>>> >>>>>> It happens when a new gpu backprojector is created: >>>>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>>>> >>>>>> Any insights for this? >>>>>> >>>>>> Thanks, >>>>>> Tao >>>>>> >>>>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>>>> >>>>>>> Thank you all! I will give a try using your solutions. >>>>>>> Tao >>>>>>> >>>>>>> Simon Rit ? 2019?1?17? ?? >>>>>>> ??12:26??? >>>>>>> >>>>>>>> Hi, >>>>>>>> That's one solution. Two other: >>>>>>>> - graft the output to a Cuda image >>>>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>>>> 3>::New(); >>>>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>>>> - use the rtk::ImportImageFilter which is templated over image type >>>>>>>> to allow precisely this (I used it in Gate here >>>>>>>> >>>>>>>> ). >>>>>>>> Best regards, >>>>>>>> Simon >>>>>>>> >>>>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>>>> andreasga22 at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hi Tao, >>>>>>>>> >>>>>>>>> I think you want the CastImageFilter >>>>>>>>> >>>>>>>>> from ITK. >>>>>>>>> >>>>>>>>> Something like this: >>>>>>>>> using castToImageType = itk::CastImageFilter >>>>>>>>> , itk::CudaImage>; >>>>>>>>> typename castToImageType::Pointer castfilter = >>>>>>>>> castToImageType::New(); >>>>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>>>> castfilter->Update(); >>>>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>>>> >>>>>>>>> Best regards Andreas >>>>>>>>> >>>>>>>>> __________________________________ >>>>>>>>> >>>>>>>>> Andreas Gravgaard Andersen >>>>>>>>> >>>>>>>>> Department of Oncology, >>>>>>>>> >>>>>>>>> Aarhus University Hospital >>>>>>>>> >>>>>>>>> N?rrebrogade 44, >>>>>>>>> >>>>>>>>> 8000, Aarhus C >>>>>>>>> >>>>>>>>> Mail: agravgaard at protonmail.com >>>>>>>>> >>>>>>>>> Cell: +45 3165 8140 >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>>>> ImportFilterType::New(); >>>>>>>>>> ... >>>>>>>>>> projectionReader->Update(); >>>>>>>>>> >>>>>>>>>> The type of the image is itk:::Image. I wonder if there >>>>>>>>>> is any way I can cast it to itk::CudaImage? >>>>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>>>> CudaImageType so there is no such problem. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Tao >>>>>>>>>> _______________________________________________ >>>>>>>>>> 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 >>>>>> >>>>> _______________________________________________ > 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 colddiesun at gmail.com Wed Jan 30 11:45:58 2019 From: colddiesun at gmail.com (tao sun) Date: Wed, 30 Jan 2019 11:45:58 -0500 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: Here it is the piece of codes: typedef float PixelType; const unsigned int Dimension = 3; typedef itk::CudaImage< PixelType, Dimension > CudaImageType; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::ImportImageFilter ImportFilterType; extern "C" int idlrtkbackprojection_gpu(int argc, float * argv[]) { volume = (float *) argv[0]; projection = (float *) argv[1]; debug = *(unsigned int*) argv[2]; gpu = *(unsigned int*) argv[3]; bp_arg = *(unsigned int*) argv[4]; //string((*(idls *) argv[4]).s); geometry = std::string((*(idls *) argv[5]).s); sizexv = *(unsigned int*) argv[6]; sizeyv = *(unsigned int*) argv[7]; sizezv = *(unsigned int*) argv[8]; spacingxv = *(float *) argv[9]; spacingyv = *(float *) argv[10]; spacingzv = *(float *) argv[11]; offsetxv = *(float *) argv[12]; offsetyv = *(float *) argv[13]; offsetzv = *(float *) argv[14]; sizexp = *(unsigned int*) argv[15]; sizeyp = *(unsigned int*) argv[16]; sizezp = *(unsigned int*) argv[17]; spacingxp = *(float *) argv[18]; spacingyp = *(float *) argv[19]; spacingzp = *(float *) argv[20]; offsetxp = *(float *) argv[21]; offsetyp = *(float *) argv[22]; offsetzp = *(float *) argv[23]; // Geometry rtk::ThreeDCircularProjectionGeometryXMLFileReader::Pointer geometryReader; geometryReader = rtk::ThreeDCircularProjectionGeometryXMLFileReader::New(); geometryReader->SetFilename(geometry); TRY_AND_EXIT_ON_ITK_EXCEPTION( geometryReader->GenerateOutputInformation() ) // Volume reader ImportFilterType::Pointer volumeReader = ImportFilterType::New(); ImageType::SizeType sizev;// = {{sizexv,sizeyv,sizezv}}; sizev[0] = sizexv; //406; //int(dim[0]); sizev[1] = sizeyv; //408; //int(dim[1]); sizev[2] = sizezv; ImageType::IndexType start;// = {{0,0,0}}; start[0] = 0; start[1] = 0; start[2] = 0; ImageType::RegionType regionv; regionv.SetSize(sizev); regionv.SetIndex(start); volumeReader->SetRegion(regionv); double spacingv[3]; spacingv[0] = spacingxv; spacingv[1] = spacingyv; spacingv[2] = spacingzv; volumeReader->SetSpacing(spacingv); double originv[3]; originv[0] = offsetxv; originv[1] = offsetyv; originv[2] = offsetzv; volumeReader->SetOrigin(originv); // Projections reader ImportFilterType::Pointer projectionReader = ImportFilterType::New(); ImageType::SizeType sizep; sizep[0] = sizexp; //406; //int(dim[0]); sizep[1] = sizeyp; //408; //int(dim[1]); sizep[2] = sizezp; ImageType::RegionType regionp; regionp.SetSize(sizep); regionp.SetIndex(start); projectionReader->SetRegion(regionp); double spacingp[3]; spacingp[0] = spacingxp; spacingp[1] = spacingyp; spacingp[2] = spacingzp; projectionReader->SetSpacing(spacingp); double originp[3]; originp[0] = offsetxp; originp[1] = offsetyp; originp[2] = offsetzp; projectionReader->SetOrigin(originp); // Create backprojection image filter rtk::CudaFDKBackProjectionImageFilter::Pointer bp; bp = rtk::CudaFDKBackProjectionImageFilter::New(); // where error was thrown out CudaImageType::Pointer cuImg1 = CudaImageType::New(); cuImg1->Graft(projectionReader->GetOutput()); CudaImageType::Pointer cuImg2 = CudaImageType::New(); cuImg2->Graft(volumeReader->GetOutput()); bp->SetInput( cuImg2 ); bp->SetInput( 1, cuImg1 ); bp->SetGeometry( geometryReader->GetOutputObject() ); TRY_AND_EXIT_ON_ITK_EXCEPTION( bp->Update() ) Thanks, Tao Simon Rit ? 2019?1?30? ?? ??11:29??? > Can you send the code if you want us to help? > > On Wed, Jan 30, 2019 at 5:21 PM tao sun wrote: > >> No I am not using that. But the error was thrown before GRAFT() function >> was called. It happens when I initialized the backprojector: >> bp = rtk::CudaRayCastBackProjectionImageFilter::New(). >> >> Tao >> >> Simon Rit ? 2019?1?30? ?? ??11:13??? >> >>> Are you using the HEAD version of the git ? Because I recently corrected >>> a bug in the Graft function (commit >>> b2d73642ce171ba9890af2c107a1a31f923454b5). >>> Simon >>> >>> On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: >>> >>>> Hi Simon, >>>> >>>> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >>>> rtkfdk with gpu on without any problem though, >>>> By the way I am using CUDA 9.2.88. >>>> >>>> Tao >>>> >>>> >>>> >>>> >>>> >>>> Simon Rit ? 2019?1?30? ?? ??1:25??? >>>> >>>>> Hi, >>>>> No, not really. In my experience, this occurs mainly when you don't >>>>> have a GPU properly configured for CUDA. Can you check the value of >>>>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>>>> Simon >>>>> >>>>> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >>>>> >>>>>> Hi again, >>>>>> >>>>>> Finally I got time to work on this. I was able to compile the program >>>>>> this time using the Graft() function. However, there's a runtime error when >>>>>> I run the program: >>>>>> >>>>>> >>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>>>> @ unknown : Cuda Error #3 >>>>>> terminate called after throwing an instance of >>>>>> 'itk::ExceptionObject' >>>>>> what(): >>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>>>> Cuda Error # 3 >>>>>> Aborted >>>>>> >>>>>> It happens when a new gpu backprojector is created: >>>>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>>>> >>>>>> Any insights for this? >>>>>> >>>>>> Thanks, >>>>>> Tao >>>>>> >>>>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>>>> >>>>>>> Thank you all! I will give a try using your solutions. >>>>>>> Tao >>>>>>> >>>>>>> Simon Rit ? 2019?1?17? ?? >>>>>>> ??12:26??? >>>>>>> >>>>>>>> Hi, >>>>>>>> That's one solution. Two other: >>>>>>>> - graft the output to a Cuda image >>>>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>>>> 3>::New(); >>>>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>>>> - use the rtk::ImportImageFilter which is templated over image type >>>>>>>> to allow precisely this (I used it in Gate here >>>>>>>> >>>>>>>> ). >>>>>>>> Best regards, >>>>>>>> Simon >>>>>>>> >>>>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>>>> andreasga22 at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hi Tao, >>>>>>>>> >>>>>>>>> I think you want the CastImageFilter >>>>>>>>> >>>>>>>>> from ITK. >>>>>>>>> >>>>>>>>> Something like this: >>>>>>>>> using castToImageType = itk::CastImageFilter >>>>>>>>> , itk::CudaImage>; >>>>>>>>> typename castToImageType::Pointer castfilter = >>>>>>>>> castToImageType::New(); >>>>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>>>> castfilter->Update(); >>>>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>>>> >>>>>>>>> Best regards Andreas >>>>>>>>> >>>>>>>>> __________________________________ >>>>>>>>> >>>>>>>>> Andreas Gravgaard Andersen >>>>>>>>> >>>>>>>>> Department of Oncology, >>>>>>>>> >>>>>>>>> Aarhus University Hospital >>>>>>>>> >>>>>>>>> N?rrebrogade 44, >>>>>>>>> >>>>>>>>> 8000, Aarhus C >>>>>>>>> >>>>>>>>> Mail: agravgaard at protonmail.com >>>>>>>>> >>>>>>>>> Cell: +45 3165 8140 >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>>>> ImportFilterType::New(); >>>>>>>>>> ... >>>>>>>>>> projectionReader->Update(); >>>>>>>>>> >>>>>>>>>> The type of the image is itk:::Image. I wonder if there >>>>>>>>>> is any way I can cast it to itk::CudaImage? >>>>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>>>> CudaImageType so there is no such problem. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Tao >>>>>>>>>> _______________________________________________ >>>>>>>>>> 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 wuchao04 at gmail.com Wed Jan 30 12:17:04 2019 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 30 Jan 2019 18:17:04 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: L.S., I encouter recently the "Cuda Error # 3" with a Quadro P4000 when running rtkfdk, but I am not sure if the cause is the same as Tao's problem. CUDA_CHECK() marks Driver API error with a "#" whereas Runtime API error with a ":", so it is CUresult 3 (CUDA_ERROR_NOT_INITIALIZED). Indeed when I add CUDA_CHECK to cuInit(0) in itkCudaContextManager.cxx I already got an CUresult 100 (CUDA_ERROR_NO_DEVICE) here. In the same itkCudaContextManager.cxx file, itk::CudaGetAvailableDevices (which calls Runtime API) works well, so only Driver API doesn't work properly. The same build works fine with a Tesla P40. I don't have time to investigate further but I found on my computer a previous build based on commit 5717b6d02675ee10f03200038566f06dfcc2ad19 in May 2018 doesn't have this issue with the Quadro card. So I guess it shouldn't be the problem of the card or the driver, but a problem induced by a later commit. Best regards, Chao Andreas Andersen ?2019?1?30??? ??5:33??? > I've encountered the "Cuda Error # 3" issue two times. > As far as I remember, both were caused by the GPU being unreachable at > runtime: > * A missing or outdated (relative to CUDA version) nVidia driver > * The code running within a non-native environment. > The second point can also be triggered if the binary is located on remote > storage. > > However, both of these cases were on Windows, and by the path > "/home/tsun/bin/" I would guess you're on some Linux distro. > > /Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Department of Oncology, > > Aarhus University Hospital > > N?rrebrogade 44, > > 8000, Aarhus C > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Wed, 30 Jan 2019 at 17:29, Simon Rit > wrote: > >> Can you send the code if you want us to help? >> >> On Wed, Jan 30, 2019 at 5:21 PM tao sun wrote: >> >>> No I am not using that. But the error was thrown before GRAFT() function >>> was called. It happens when I initialized the backprojector: >>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(). >>> >>> Tao >>> >>> Simon Rit ? 2019?1?30? ?? ??11:13??? >>> >>>> Are you using the HEAD version of the git ? Because I recently >>>> corrected a bug in the Graft function (commit >>>> b2d73642ce171ba9890af2c107a1a31f923454b5). >>>> Simon >>>> >>>> On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: >>>> >>>>> Hi Simon, >>>>> >>>>> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >>>>> rtkfdk with gpu on without any problem though, >>>>> By the way I am using CUDA 9.2.88. >>>>> >>>>> Tao >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Simon Rit ? 2019?1?30? ?? ??1:25??? >>>>> >>>>>> Hi, >>>>>> No, not really. In my experience, this occurs mainly when you don't >>>>>> have a GPU properly configured for CUDA. Can you check the value of >>>>>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>>>>> Simon >>>>>> >>>>>> On Wed, Jan 30, 2019 at 1:23 AM tao sun wrote: >>>>>> >>>>>>> Hi again, >>>>>>> >>>>>>> Finally I got time to work on this. I was able to compile the >>>>>>> program this time using the Graft() function. However, there's a runtime >>>>>>> error when I run the program: >>>>>>> >>>>>>> >>>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>>>>> @ unknown : Cuda Error #3 >>>>>>> terminate called after throwing an instance of >>>>>>> 'itk::ExceptionObject' >>>>>>> what(): >>>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>>>>> Cuda Error # 3 >>>>>>> Aborted >>>>>>> >>>>>>> It happens when a new gpu backprojector is created: >>>>>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>>>>> >>>>>>> Any insights for this? >>>>>>> >>>>>>> Thanks, >>>>>>> Tao >>>>>>> >>>>>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>>>>> >>>>>>>> Thank you all! I will give a try using your solutions. >>>>>>>> Tao >>>>>>>> >>>>>>>> Simon Rit ? 2019?1?17? ?? >>>>>>>> ??12:26??? >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> That's one solution. Two other: >>>>>>>>> - graft the output to a Cuda image >>>>>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>>>>> 3>::New(); >>>>>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>>>>> - use the rtk::ImportImageFilter which is templated over image >>>>>>>>> type to allow precisely this (I used it in Gate here >>>>>>>>> >>>>>>>>> ). >>>>>>>>> Best regards, >>>>>>>>> Simon >>>>>>>>> >>>>>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>>>>> andreasga22 at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hi Tao, >>>>>>>>>> >>>>>>>>>> I think you want the CastImageFilter >>>>>>>>>> >>>>>>>>>> from ITK. >>>>>>>>>> >>>>>>>>>> Something like this: >>>>>>>>>> using castToImageType = itk::CastImageFilter >>>>>>>>>> , itk::CudaImage>; >>>>>>>>>> typename castToImageType::Pointer castfilter = >>>>>>>>>> castToImageType::New(); >>>>>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>>>>> castfilter->Update(); >>>>>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>>>>> >>>>>>>>>> Best regards Andreas >>>>>>>>>> >>>>>>>>>> __________________________________ >>>>>>>>>> >>>>>>>>>> Andreas Gravgaard Andersen >>>>>>>>>> >>>>>>>>>> Department of Oncology, >>>>>>>>>> >>>>>>>>>> Aarhus University Hospital >>>>>>>>>> >>>>>>>>>> N?rrebrogade 44, >>>>>>>>>> >>>>>>>>>> 8000, Aarhus C >>>>>>>>>> >>>>>>>>>> Mail: agravgaard at protonmail.com >>>>>>>>>> >>>>>>>>>> Cell: +45 3165 8140 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>>>>> ImportFilterType::New(); >>>>>>>>>>> ... >>>>>>>>>>> projectionReader->Update(); >>>>>>>>>>> >>>>>>>>>>> The type of the image is itk:::Image. I wonder if there >>>>>>>>>>> is any way I can cast it to itk::CudaImage? >>>>>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>>>>> CudaImageType so there is no such problem. >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Tao >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> 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 >>>>>>> >>>>>> _______________________________________________ >> 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 simon.rit at creatis.insa-lyon.fr Wed Jan 30 16:22:25 2019 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 30 Jan 2019 22:22:25 +0100 Subject: [Rtk-users] cast itk:::Image to itk::CudaImage In-Reply-To: References: Message-ID: I don't see what has changed since this commit... For Tao, I would suggest to try a minimal example in one separate main just to be sure that this is indeed this line that causes the problem and not some bad memory management before. I really don't see what is the issue here since you are using CUDA code from the same RTK version. On Wed, Jan 30, 2019 at 6:17 PM Chao Wu wrote: > L.S., > > I encouter recently the "Cuda Error # 3" with a Quadro P4000 when running > rtkfdk, but I am not sure if the cause is the same as Tao's problem. > CUDA_CHECK() marks Driver API error with a "#" whereas Runtime API error > with a ":", so it is CUresult 3 (CUDA_ERROR_NOT_INITIALIZED). > Indeed when I add CUDA_CHECK to cuInit(0) in itkCudaContextManager.cxx I > already got an CUresult 100 (CUDA_ERROR_NO_DEVICE) here. > In the same itkCudaContextManager.cxx file, itk::CudaGetAvailableDevices > (which calls Runtime API) works well, so only Driver API doesn't work > properly. > The same build works fine with a Tesla P40. > > I don't have time to investigate further but I found on my computer a > previous build based on commit 5717b6d02675ee10f03200038566f06dfcc2ad19 in > May 2018 doesn't have this issue with the Quadro card. > So I guess it shouldn't be the problem of the card or the driver, but a > problem induced by a later commit. > > Best regards, > Chao > > Andreas Andersen ?2019?1?30??? ??5:33??? > >> I've encountered the "Cuda Error # 3" issue two times. >> As far as I remember, both were caused by the GPU being unreachable at >> runtime: >> * A missing or outdated (relative to CUDA version) nVidia driver >> * The code running within a non-native environment. >> The second point can also be triggered if the binary is located on remote >> storage. >> >> However, both of these cases were on Windows, and by the path >> "/home/tsun/bin/" I would guess you're on some Linux distro. >> >> /Andreas >> >> __________________________________ >> >> Andreas Gravgaard Andersen >> >> Department of Oncology, >> >> Aarhus University Hospital >> >> N?rrebrogade 44, >> >> 8000, Aarhus C >> >> Mail: agravgaard at protonmail.com >> >> Cell: +45 3165 8140 >> >> >> On Wed, 30 Jan 2019 at 17:29, Simon Rit >> wrote: >> >>> Can you send the code if you want us to help? >>> >>> On Wed, Jan 30, 2019 at 5:21 PM tao sun wrote: >>> >>>> No I am not using that. But the error was thrown before GRAFT() >>>> function was called. It happens when I initialized the backprojector: >>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(). >>>> >>>> Tao >>>> >>>> Simon Rit ? 2019?1?30? ?? ??11:13??? >>>> >>>>> Are you using the HEAD version of the git ? Because I recently >>>>> corrected a bug in the Graft function (commit >>>>> b2d73642ce171ba9890af2c107a1a31f923454b5). >>>>> Simon >>>>> >>>>> On Wed, Jan 30, 2019 at 5:05 PM tao sun wrote: >>>>> >>>>>> Hi Simon, >>>>>> >>>>>> CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like >>>>>> rtkfdk with gpu on without any problem though, >>>>>> By the way I am using CUDA 9.2.88. >>>>>> >>>>>> Tao >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Simon Rit ? 2019?1?30? ?? ??1:25??? >>>>>> >>>>>>> Hi, >>>>>>> No, not really. In my experience, this occurs mainly when you don't >>>>>>> have a GPU properly configured for CUDA. Can you check the value of >>>>>>> CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem. >>>>>>> Simon >>>>>>> >>>>>>> On Wed, Jan 30, 2019 at 1:23 AM tao sun >>>>>>> wrote: >>>>>>> >>>>>>>> Hi again, >>>>>>>> >>>>>>>> Finally I got time to work on this. I was able to compile the >>>>>>>> program this time using the Graft() function. However, there's a runtime >>>>>>>> error when I run the program: >>>>>>>> >>>>>>>> >>>>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 >>>>>>>> @ unknown : Cuda Error #3 >>>>>>>> terminate called after throwing an instance of >>>>>>>> 'itk::ExceptionObject' >>>>>>>> what(): >>>>>>>> /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38: >>>>>>>> Cuda Error # 3 >>>>>>>> Aborted >>>>>>>> >>>>>>>> It happens when a new gpu backprojector is created: >>>>>>>> bp = rtk::CudaRayCastBackProjectionImageFilter::New(); >>>>>>>> >>>>>>>> Any insights for this? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Tao >>>>>>>> >>>>>>>> tao sun ? 2019?1?19? ?? ??8:51??? >>>>>>>> >>>>>>>>> Thank you all! I will give a try using your solutions. >>>>>>>>> Tao >>>>>>>>> >>>>>>>>> Simon Rit ? 2019?1?17? ?? >>>>>>>>> ??12:26??? >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> That's one solution. Two other: >>>>>>>>>> - graft the output to a Cuda image >>>>>>>>>> itk::CudaImage::Pointer cuImg = itk::CudaImage>>>>>>>>> 3>::New(); >>>>>>>>>> cuImg->Graft(projectionReader->GetOutput()) >>>>>>>>>> - use the rtk::ImportImageFilter which is templated over image >>>>>>>>>> type to allow precisely this (I used it in Gate here >>>>>>>>>> >>>>>>>>>> ). >>>>>>>>>> Best regards, >>>>>>>>>> Simon >>>>>>>>>> >>>>>>>>>> On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen < >>>>>>>>>> andreasga22 at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Tao, >>>>>>>>>>> >>>>>>>>>>> I think you want the CastImageFilter >>>>>>>>>>> >>>>>>>>>>> from ITK. >>>>>>>>>>> >>>>>>>>>>> Something like this: >>>>>>>>>>> using castToImageType = itk::CastImageFilter< >>>>>>>>>>> itk:::Image, itk::CudaImage>; >>>>>>>>>>> typename castToImageType::Pointer castfilter = >>>>>>>>>>> castToImageType::New(); >>>>>>>>>>> castfilter->SetInput(projectionReader->GetOutput()); >>>>>>>>>>> castfilter->Update(); >>>>>>>>>>> auto cuda_image = castfilter->GetOutput(); >>>>>>>>>>> >>>>>>>>>>> Best regards Andreas >>>>>>>>>>> >>>>>>>>>>> __________________________________ >>>>>>>>>>> >>>>>>>>>>> Andreas Gravgaard Andersen >>>>>>>>>>> >>>>>>>>>>> Department of Oncology, >>>>>>>>>>> >>>>>>>>>>> Aarhus University Hospital >>>>>>>>>>> >>>>>>>>>>> N?rrebrogade 44, >>>>>>>>>>> >>>>>>>>>>> 8000, Aarhus C >>>>>>>>>>> >>>>>>>>>>> Mail: agravgaard at protonmail.com >>>>>>>>>>> >>>>>>>>>>> Cell: +45 3165 8140 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Wed, 16 Jan 2019 at 22:59, tao sun >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> I have read in some image using itk::ImportImageFilter. >>>>>>>>>>>> ImportFilterType::Pointer projectionReader = >>>>>>>>>>>> ImportFilterType::New(); >>>>>>>>>>>> ... >>>>>>>>>>>> projectionReader->Update(); >>>>>>>>>>>> >>>>>>>>>>>> The type of the image is itk:::Image. I wonder if >>>>>>>>>>>> there is any way I can cast it to itk::CudaImage? >>>>>>>>>>>> In rtkforwardprojections.cxx the imageReaderType is defined as >>>>>>>>>>>> CudaImageType so there is no such problem. >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> Tao >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> 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 >>>>>>>> >>>>>>> _______________________________________________ >>> 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: