[Rtk-users] 答复: 答复: Rtk Detector Displacemets

Freyman li lihanwei_1500 at 126.com
Wed Dec 30 07:54:04 CET 2015


Dear Simon,

Thanks for your reply for my question!

I solved this problem under your reminding and there is no longer display the error message.

I set the origin point as (-0.5*0.254*767,-0.5*0.254*959) to make the origin coordinate at the center of the projection.

Also, I adjust the geometry calibration to fit your projection model but still can’t acquire the right image with my projection data.

I attached my key code(just the version overwrite rtkfdk.cxx)and hope that you can give me some advice.

Freyman li

 

发件人: simon.rit at gmail.com [mailto:simon.rit at gmail.com] 代表 Simon Rit
发送时间: 2015年12月29日 6:26
收件人: Freyman li
抄送: louie L; rtk-users at public.kitware.com
主题: Re: [Rtk-users] 答复: Rtk Detector Displacemets

 

Dear Freyman li,

Have you solved your problem ? If not, my guess would be that you have not set the origin of your projections correctly. Where does your calibration assume the location of point (0,0) in your projections? Since you have very small X projection offsets, it probably assumes that it's at the center of the projection so you must set the origin, i.e., the coordinate of the first pixel, at (0.5*0.254*767, 0.5*0.254*959). If you don't do that, rtkfdk detects a large offset that it cannot correct for.

Simon

 

On Mon, Dec 14, 2015 at 6:32 AM, Freyman li <lihanwei_1500 at 126.com <mailto:lihanwei_1500 at 126.com> > wrote:

Thanks for your help! I attached the geometry settings to this email. And my detector size is 768*960 with a pixel size 0.254mm.

 

 

 

 

发件人: louie L [mailto:ghostcz at hotmail.com <mailto:ghostcz at hotmail.com> ] 
发送时间: 2015年12月14日 11:38
收件人: Freyman li; rtk-users at public.kitware.com <mailto:rtk-users at public.kitware.com> 
主题: RE: [Rtk-users] Rtk Detector Displacemets

 

 

 

Sent from Mail <http://go.microsoft.com/fwlink/?LinkId=550986>  for Windows 10

 


From: louie L <mailto:ghostcz at hotmail.com> 
Sent: Monday, December 14, 2015 04:38
To: Freyman li <mailto:lihanwei_1500 at 126.com> 
Subject: RE: [Rtk-users] Rtk Detector Displacemets

 

Hi,

 

Can you post your geometry file to the mail list? Your problem sounds like a result of wrong geometry settings.

 

Best regards,

Louie

 

Sent from Mail <http://go.microsoft.com/fwlink/?LinkId=550986>  for Windows 10

 


From: Freyman li <mailto:lihanwei_1500 at 126.com> 
Sent: Monday, December 14, 2015 04:25
To: Rtk-users at public.kitware.com <mailto:Rtk-users at public.kitware.com> 
Cc: rtk-users at openrtk.org <mailto:rtk-users at openrtk.org> 
Subject: [Rtk-users] Rtk Detector Displacemets

 

Dear rtk-users,

 

I have generated the geometry XML file by using the geometry calibration in my CBCT system. And I want to reconstruct the volume from 360 raw projections data.

But after running the rtkfdk.cxx, I get an output message that "Cannot account for too large detector displacements, a part of space must be covered by all projections."

And I try to use the addprojection function to generate a simple geometry structure using only SID and SDD, this problem did not happen but the reconstruction result is not correct.

How can I solve this problem? Is there any limitation about the detector weighting?

 

I really appreciate any help you can provide.

 

With regards,

Freyman li

 

 

 


_______________________________________________
Rtk-users mailing list
Rtk-users at public.kitware.com <mailto:Rtk-users at public.kitware.com> 
http://public.kitware.com/mailman/listinfo/rtk-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20151230/5988d815/attachment.htm>
-------------- next part --------------

#include "rtkGgoFunctions.h"
#include "rtkConfiguration.h"

#include "rtkThreeDCircularProjectionGeometryXMLFile.h"
#include "rtkDisplacedDetectorForOffsetFieldOfViewImageFilter.h"
#include "rtkParkerShortScanImageFilter.h"
#include "rtkFDKConeBeamReconstructionFilter.h"

#include "rtkFDKWarpBackProjectionImageFilter.h"
#include "rtkCyclicDeformationImageFilter.h"

#include <itkStreamingImageFilter.h>
#include <itkImageFileWriter.h>
#include "itkRawImageIO.h"
#include "itkImageSeriesReader.h"
#include "itkNumericSeriesFileNames.h"
#include "itkImageRegionIterator.h"
int main(int , char **)
{


  typedef float OutputPixelType;

  typedef itk::Image< OutputPixelType, 3 >     OutputImageType3d;

  typedef itk::RawImageIO<float,OutputImageType3d::ImageDimension> RawImageIOType3d;
  
  typedef itk::ImageFileReader< OutputImageType3d >  ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  std::string Infile="E:\\data\\Im.mhd";
   reader->SetFileName( Infile );

  itk::TimeProbe readerProbe;

    readerProbe.Start();
    try
  {
	  std::cerr << "Performing reading..." << std::endl;
	  reader->Update();
  }
   catch( itk::ExceptionObject & excep )
  {
	std::cerr << "Exception caught !" << std::endl;
	std::cerr << excep << std::endl;
   }
    readerProbe.Stop();
      std::cout << "It took " << readerProbe.GetMean() << ' ' << readerProbe.GetUnit() << std::endl;

  // Geometry

  rtk::ThreeDCircularProjectionGeometryXMLFileReader::Pointer geometryReader;
  geometryReader = rtk::ThreeDCircularProjectionGeometryXMLFileReader::New();
  geometryReader->SetFilename("E:\\Rtk_fun\\Geo_Simu\\bin\\Applicationset.xml");
  TRY_AND_EXIT_ON_ITK_EXCEPTION( geometryReader->GenerateOutputInformation() )


   //Displaced detector weighting
  typedef rtk::DisplacedDetectorImageFilter< OutputImageType3d >                     DDFCPUType;
  typedef rtk::DisplacedDetectorForOffsetFieldOfViewImageFilter< OutputImageType3d > DDFOFFFOVType;


  DDFCPUType::Pointer ddf;

    ddf = DDFOFFFOVType::New();
  ddf->SetInput( reader->GetOutput() );
  ddf->SetGeometry( geometryReader->GetOutputObject() );

   //Short scan image filter
  typedef rtk::ParkerShortScanImageFilter< OutputImageType3d > PSSFCPUType;


  PSSFCPUType::Pointer pssf;

    pssf = PSSFCPUType::New();
  pssf->SetInput( ddf->GetOutput() );
  pssf->SetGeometry( geometryReader->GetOutputObject() );
  pssf->InPlaceOff();

   //Create reconstructed image
  typedef rtk::ConstantImageSource< OutputImageType3d> ConstantImageSourceType;
  ConstantImageSourceType::Pointer constantImageSource = ConstantImageSourceType::New();
  ConstantImageSourceType::PointType origin;
  ConstantImageSourceType::SpacingType spacing;
  ConstantImageSourceType::SizeType sizeOutput;
 
  origin[0] = -256*0.3;
  origin[1] = -256*0.3;
  origin[2] = -15*0.3;
 
  spacing[0] = 0.3;
  spacing[1] = 0.3;
  spacing[2] = 0.3;
   
  sizeOutput[0] = 512;
  sizeOutput[1] = 512;
  sizeOutput[2] = 30;
 
  constantImageSource->SetOrigin( origin );
  constantImageSource->SetSpacing( spacing );
  constantImageSource->SetSize( sizeOutput );
  constantImageSource->SetConstant( 0. );
	

  // FDK reconstruction filtering
  typedef rtk::FDKConeBeamReconstructionFilter< OutputImageType3d > FDKCPUType;
  FDKCPUType::Pointer feldkamp;

  itk::Image< OutputPixelType, 3 > *pfeldkamp = NULL;

    feldkamp = FDKCPUType::New();
	feldkamp->SetInput( 0, constantImageSource->GetOutput() ); 
	feldkamp->SetInput( 1, reader->GetOutput() ); 
    feldkamp->SetGeometry( geometryReader->GetOutputObject() );  
    feldkamp->GetRampFilter()->SetTruncationCorrection(0.); 
    feldkamp->GetRampFilter()->SetHannCutFrequency(0.0); 
    feldkamp->GetRampFilter()->SetHannCutFrequencyY(0.0); 
    feldkamp->SetProjectionSubsetSize(4);

    pfeldkamp = feldkamp->GetOutput();
	std::cout << "Reconstructing... " << std::flush;
	feldkamp->Update();


   //Streaming depending on streaming capability of writer
  typedef itk::StreamingImageFilter<OutputImageType3d, OutputImageType3d> StreamerType;
  StreamerType::Pointer streamerBP = StreamerType::New();
  streamerBP->SetInput( pfeldkamp );
  streamerBP->SetNumberOfStreamDivisions( 1 );

   //Write
  RawImageIOType3d::Pointer io1 = RawImageIOType3d::New();
  io1->SetFileDimensionality(3);    // ¶ÁÈ¡3άÊý¾Ý
  io1->SetDimensions( 0, 512 );    // ͼÏñ¿í
  io1->SetDimensions( 1, 512 );    // ͼÏñ¸ß
  io1->SetDimensions( 2, 30 );    // ͼÏñ¸ß
  io1->SetOrigin(0,-256*0.3);           // ͼÏñÔ­µã
  io1->SetOrigin(1,-256*0.3);           // ͼÏñÔ­µã
  io1->SetOrigin(2,-15*0.3);           // ͼÏñÔ­µã
  io1->SetHeaderSize(0);

 typedef itk::ImageFileWriter<OutputImageType3d> WriterType;
  WriterType::Pointer writer = WriterType::New();
  writer->SetFileName( "3dt.raw" );
  writer->SetInput( streamerBP->GetOutput() );
  writer->SetImageIO(io1);

    std::cout << "writing... " << std::flush;
  itk::TimeProbe writerProbe;

  writerProbe.Start();
  TRY_AND_EXIT_ON_ITK_EXCEPTION( writer->Update() );
  writerProbe.Stop();

    std::cout << "It took " << writerProbe.GetMean() << ' ' << readerProbe.GetUnit() << std::endl;
      feldkamp->PrintTiming(std::cout);



  return EXIT_SUCCESS;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Im.mhd
Type: application/octet-stream
Size: 178 bytes
Desc: not available
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20151230/5988d815/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Applicationset.xml
Type: text/xml
Size: 304367 bytes
Desc: not available
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20151230/5988d815/attachment.xml>


More information about the Rtk-users mailing list