[Rtk-users] error on build rtk in visual studio 2012 when rtk use cuda

Cyril Mory cyril.mory at creatis.insa-lyon.fr
Tue Jun 16 02:39:46 EDT 2015


Hi Safdary,

Just to be sure: have you tried reconstructing in a larger volume 
(something really huge), just to make sure you are not trying to 
reconstruct some portion of space where, indeed, there is nothing ?
You can try that easily, just replace your spacing, dimension and origin 
with
--spacing 16,16,16 --dimension 256,256,256 --origin -2040,-2040,-2040
in your rtkfdk command line.

Cyril

On 06/15/2015 05:19 PM, safdary mohsen wrote:
> Hi Yang
>
>
> I am use rtkfdk.exe but the results are same as  my code,
>
> means all pixels are zero!!!
>
> _
> _
>
> regards
>
> safdari
>
>
> On Mon, Jun 15, 2015 at 7:10 PM, Yang K Park <theday79 at gmail.com 
> <mailto:theday79 at gmail.com>> wrote:
>
>     Hi Safdary,
>
>     Again, please cc rtk-users at openrtk.org
>     <mailto:rtk-users at openrtk.org> when you send your email, since
>     other users (much better experts than me!) can give us any
>     suggestions.
>
>     Thanks.
>
>     Yang
>
>     *From:*Yang K Park [mailto:theday79 at gmail.com
>     <mailto:theday79 at gmail.com>]
>     *Sent:* Monday, June 15, 2015 10:37 AM
>     *To:* 'safdary mohsen'
>     *Cc:* rtk-users at openrtk.org <mailto:rtk-users at openrtk.org>
>     *Subject:* RE: [Rtk-users] error on build rtk in visual studio
>     2012 when rtk use cuda
>
>     Hi Safdary,
>
>     I recommend you to try rtkfdk.exe first (with cuda option) to see
>     if it works for you.
>
>     The example of the command line would be:
>
>     rtkfdk --geometry geom.xml --path proj_dir --regexp .*.his
>     --output  test_output.mha --verbos --spacing 1,1,1 --dimension
>     512,10,512 --origin -127.875,29.5,-127.875 --hardware cuda
>
>     If it works for your image, then you can mimic the original rtkfdk
>     code to make your own one.
>
>     Good luck!
>
>     Yang
>
>     *From:*safdary mohsen [mailto:ieee.safdary at gmail.com]
>     *Sent:* Saturday, June 13, 2015 11:58 PM
>     *To:* Yang K Park
>     *Subject:* Re: [Rtk-users] error on build rtk in visual studio
>     2012 when rtk use cuda
>
>     Hi Yang
>
>     I have tried to adjust the window/level to see something inside of
>     the image but all pixels set to zero.
>
>     _My code is:_
>
>     #defineUSE_CUDA
>
>     intmain(int, char**)
>
>     {
>
>     //// variable
>
>     constunsignedintDimension = 3;
>
>     typedeffloatOutputPixelType;
>
>     #ifdefUSE_CUDA
>
>     typedefitk::CudaImage< OutputPixelType, Dimension > OutputImageType;
>
>     #else
>
>     typedefitk::Image< OutputPixelType, Dimension > OutputImageType;
>
>     #endif
>
>     ////////////////////////////////////////////////////////////////////////////////////////////////////
>
>     // Generate file names of projections
>
>     itk::RegularExpressionSeriesFileNames::Pointernames =
>     itk::RegularExpressionSeriesFileNames::New();
>
>     names->SetDirectory(std::string("d://RTK/build/bin/Release/Scan1/"));
>
>     names->SetRegularExpression(std::string("Proj_.*.hnd"));
>
>     ////////////////////////////////////////////////////////////////////////////////////////////////////
>
>     //// geometry
>
>     // Defines the RTK geometry object
>
>     typedefrtk::ThreeDCircularProjectionGeometryGeometryType;
>
>     GeometryType::Pointergeometry = GeometryType::New();
>
>     // Projection matrices
>
>     unsignedintnumberOfProjections = 86;
>
>     unsignedintfirstAngle = 0;
>
>     unsignedintangularArc = 360;
>
>     unsignedintsid = 1000;
>
>     unsignedintsdd = 1200;
>
>     intisox = 0;
>
>     intisoy = 0 ;
>
>     for(unsignedintnoProj=0; noProj<numberOfProjections; noProj++)
>
>     {
>
>     doubleangle = (float)firstAngle + (float)noProj * angularArc /
>     (float)numberOfProjections;
>
>     geometry->AddProjection(sid,
>
>     sdd,
>
>     angle,
>
>     isox,
>
>     isoy);
>
>     }
>
>     /////////////////////////////////////////////////////////////////////////////////////////////////////
>
>     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>     // Projections reader
>
>     typedefrtk::ProjectionsReader< OutputImageType> ReaderType;
>
>     ReaderType::Pointerreader = ReaderType::New();
>
>     reader->SetFileNames(names->GetFileNames());
>
>     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>
>     // Create reconstructed image ////////////////////////////////////
>
>     typedefrtk::ConstantImageSource< OutputImageType>
>     ConstantImageSourceType;
>
>     ConstantImageSourceType::PointerImageSource =
>     ConstantImageSourceType::New();
>
>     ConstantImageSourceType::PointTypeorigin;
>
>     ConstantImageSourceType::SizeTypesizeOutput;
>
>     ConstantImageSourceType::SpacingTypespacing;
>
>     origin[0] = -127.75;
>
>     origin[1] = -127.75;
>
>     origin[2] = -127.75;
>
>     sizeOutput[0] = 512;
>
>     sizeOutput[1] = 512;
>
>     sizeOutput[2] = 512;
>
>     spacing[0] = .5;
>
>     spacing[1] = .5;
>
>     spacing[2] = .5;
>
>     ImageSource->SetOrigin( origin );
>
>     ImageSource->SetSpacing( spacing );
>
>     ImageSource->SetSize( sizeOutput );
>
>     ImageSource->SetConstant( 0. );
>
>     // getchar(); //////////////////////////////////////
>
>     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>
>     std::cout << "Performing reconstruction"<< std::endl;
>
>     // FDK reconstruction filtering
>
>     // FDK reconstruction filtering
>
>     #ifdefUSE_CUDA
>
>     typedefrtk::CudaFDKConeBeamReconstructionFilterFDKType;
>
>     #elifUSE_OPENCL
>
>     typedefrtk::OpenCLFDKConeBeamReconstructionFilter FDKType;
>
>     #else
>
>     typedefrtk::FDKConeBeamReconstructionFilter< OutputImageType >
>     FDKType;
>
>     #endif
>
>     FDKType::Pointerfeldkamp = FDKType::New();
>
>     feldkamp->SetInput( 0, ImageSource->GetOutput() );
>
>     feldkamp->SetInput( 1, reader->GetOutput());
>
>     feldkamp->SetGeometry( geometry);
>
>     TRY_AND_EXIT_ON_ITK_EXCEPTION( feldkamp->Update() );
>
>     std::cout << "Writing output image"<< std::endl;
>
>     // Writer
>
>     typedefitk::Image< float, 3 > ImageType;
>
>     typedefitk::ImageFileWriter<ImageType> WriterType;
>
>     WriterType::Pointerwriter = WriterType::New();
>
>     writer->SetFileName( "output11.mha");
>
>     writer->SetInput( feldkamp->GetOutput() );
>
>     writer->Update();
>
>     getchar();
>
>     return0;
>
>     }
>
>
>
>
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/rtk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20150616/08628578/attachment-0010.html>


More information about the Rtk-users mailing list