[Insight-users] xxxxxSPAMxxxxx DirectFourierReconstruction Filter

alex alexdowson at hotmail.com
Mon May 17 05:33:33 EDT 2010


Hi

I want to reconstruct image taken from the x-ray detector. I had looked at 
DirectFourierReconstructionImageToImageFilter is doing reconstruction. I am 
new to this field read lot of document over CT reconstruction but still not 
exactly understand how to use this class.

I have also looked at  sample test application but donot know it's 
parameters and how to use it .

 I have 200 project of total 180 degree at 0.9 degree interval. I want to 
reconstruct slice of particular levels but this application is taking only 
single image so how can i use to build backprojection or slice from my 
original images using this applications ?


Here is the code of ITK test suite. Please let me know if any one used it 
already then how to use it >?


int main (int argc, char * argv[] )

{

 if ( argc != 18)

{

std::cerr << "Wrong number of input arguments" << std::endl;

std::cerr << "Usage : " << std::endl << "\t";

std::cerr << argv[0] << " input output r_dir z_dir alpha_dir nz ng fc nb 
alpha_range x y z sx sy sz sigma" << std::endl;

return 1;

}

ReaderType::Pointer reader = ReaderType::New();

reader->SetFileName( argv[1] );



SmootherType::Pointer smoother = SmootherType::New();

smoother->SetInput( reader->GetOutput() );

smoother->SetSigma( atof( argv[17] ) );

smoother->SetDirection( atoi( argv[3] ) );





ReconstructionFilterType::Pointer reconstruct = 
ReconstructionFilterType::New();

if ( atof( argv[17] ) == 0 ) reconstruct->SetInput( reader->GetOutput() );

else reconstruct->SetInput( smoother->GetOutput() );

reconstruct->SetRDirection( atoi( argv[3] ) );

reconstruct->SetZDirection( atoi( argv[4] ) );

reconstruct->SetAlphaDirection( atoi( argv[5] ) );

reconstruct->SetZeroPadding( atoi( argv[6] ) );

reconstruct->SetOverSampling( atoi( argv[7] ) );

reconstruct->SetCutoff( atof( argv[8] ) );

reconstruct->SetRadialSplineOrder( atoi( argv[9] ) );

reconstruct->SetAlphaRange( atoi( argv[10] ) );

CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New();

reconstruct->AddObserver( itk::ProgressEvent(), observer );




RescalerType::Pointer rescaler = RescalerType::New();

rescaler->SetInput( reconstruct->GetOutput() );

rescaler->SetOutputMinimum( itk::NumericTraits< OutputPixelType >::min() );

rescaler->SetOutputMaximum( itk::NumericTraits< OutputPixelType >::max() );




ROIFilterType::Pointer ROIFilter = ROIFilterType::New();

ROIFilter->SetInput( rescaler->GetOutput() );


ROIFilterType::IndexType start;

ROIFilterType::SizeType size;


start[0] = atoi( argv[11] );

start[1] = atoi( argv[12] );

start[2] = atoi( argv[13] );


size[0] = atoi( argv[14] );

size[1] = atoi( argv[15] );

size[2] = atoi( argv[16] );

ROIFilterType::RegionType requestedRegion;

requestedRegion.SetIndex( start );

requestedRegion.SetSize( size );


ROIFilter->SetRegionOfInterest( requestedRegion );





WriterType::Pointer writer = WriterType::New();

writer->SetFileName( "recon.img" );

writer->SetInput( ROIFilter->GetOutput() );






try

{

writer->Update();

}

catch ( itk::ExceptionObject err )

{

std::cerr << "An error occurred somewhere:" << std::endl;

std::cerr << err << std::endl;

return 2;

}

std::cout << "Done" << std::endl;


std::cout << reconstruct << std::endl;

return 0;

} // main


Alex 



More information about the Insight-users mailing list