<div dir="ltr"><span style="font-size:13px">Hi </span><div style="font-size:13px">My code for Reconstruction is shown in the following<br></div><div style="font-size:13px">this code work very well for .hnd and .his projection but when i insert .dcm projection, the output(reconstructed image) is black completely</div><div style="font-size:13px">please solve this problem for me(10 .dcm projections and reconstructed image(just one slice) are attached to mail)</div><div style="font-size:13px"><br></div><div style="font-size:13px"><br></div><div style="font-size:13px"><div>int main(int , char **)</div><div>{</div><div>  </div><div>  //// variable</div><div>  typedef itk::Image< float, 3 > ImageType;</div><div>  typedef rtk::ConstantImageSource< ImageType > ConstantImageSourceType;</div><div>  /////////////////////////////////////////////////////////////////////////////////////////////////////</div><div>  // Generate file names of projections</div><div>  itk::RegularExpressionSeriesFileNames::Pointer names = itk::RegularExpressionSeriesFileNames::New();</div><div>  names->SetDirectory(std::string("E://RTK/RTK-BUILD/bin/Debug/dcmprojection/"));</div><div>  names->SetRegularExpression(std::string(".*.dcm"));</div><div> </div><div>  //// set projection file</div><div>  ////////////////////////////////////////////////////////////////////////////////////////////////////</div><div>  //// geometry</div><div>  // Defines the RTK geometry object</div><div>   typedef rtk::ThreeDCircularProjectionGeometry GeometryType;</div><div>  GeometryType::Pointer geometry = GeometryType::New();</div><div><br></div><div>  // Projection matrices</div><div>  unsigned int numberOfProjections = 10;</div><div>  unsigned int firstAngle = 0;</div><div>  unsigned int angularArc = 360;</div><div>  unsigned int sid = 1000; // source to isocenter distance in mm</div><div>  unsigned int sdd = 1500; // source to detector distance in mm</div><div>  int isox = 0; // X coordinate on the projection image of isocenter</div><div>  int isoy = 0; // Y coordinate on the projection image of isocenter</div><div><br></div><div>  for(unsigned int noProj=0; noProj<numberOfProjections; noProj++)</div><div>    {</div><div>    double angle = (float)firstAngle + (float)noProj * angularArc / (float)numberOfProjections;</div><div>    geometry->AddProjection(sid,</div><div>                            sdd,</div><div>                            angle,</div><div>                            isox,</div><div>                            isoy);</div><div>    }</div><div><br></div><div>  /////////////////////////////////////////////////////////////////////////////////////////////////////</div><div>   ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</div><div>  // Projections reader</div><div>  </div><div>  typedef rtk::ProjectionsReader< ImageType > ReaderType;</div><div>  ReaderType::Pointer reader = ReaderType::New();</div><div>  reader->SetFileNames(names->GetFileNames());</div><div>    </div><div><span style="white-space:pre-wrap">  </span></div><div><span style="white-space:pre-wrap"> </span></div><div> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// </div><div>   // Create reconstructed image                                                             ////////////////////////////////////</div><div> </div><div>  ConstantImageSourceType::Pointer constantImageSource = ConstantImageSourceType::New();</div><div>  ConstantImageSourceType::PointType origin;</div><div>  ConstantImageSourceType::SpacingType spacing;</div><div>  ConstantImageSourceType::SizeType sizeOutput;</div><div><br></div><div>  origin[0] = -127.75;//12.875</div><div>  origin[1] = -127.75;//30</div><div>  origin[2] = -127.75;//12.875</div><div>  </div><div>  // Adjust size according to geometry</div><div>  sizeOutput[0] = 512;//512</div><div>  sizeOutput[1] = 512;</div><div>  sizeOutput[2] = 512;</div><div><br></div><div>  spacing[0] = .5;//.25</div><div>  spacing[1] = .5;</div><div>  spacing[2] = .5;</div><div>  </div><div>  constantImageSource->SetOrigin( origin );</div><div>  constantImageSource->SetSpacing( spacing );</div><div>  constantImageSource->SetSize( sizeOutput );</div><div>  constantImageSource->SetConstant( 0. ); </div><div>                                                                                                //////////////////////////////////////</div><div>/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    </div><div>  std::cout << "Performing reconstruction" << std::endl;</div><div>   // FDK reconstruction filtering</div><div>  typedef rtk::FDKConeBeamReconstructionFilter< ImageType> FDKCPUType;</div><div>  FDKCPUType::Pointer feldkamp = FDKCPUType::New();</div><div>  feldkamp->SetInput( 0, constantImageSource->GetOutput() );</div><div>  feldkamp->SetInput( 1, reader->GetOutput());</div><div>  feldkamp->SetGeometry( geometry);</div><div>   feldkamp->Update();</div><div><br></div><div>  std::cout << "Writing output image" << std::endl;</div><div><br></div><div>  // Writer</div><div>  typedef itk::ImageFileWriter<ImageType> WriterType;</div><div>  WriterType::Pointer writer = WriterType::New();</div><div>  writer->SetFileName( "output11.mha" );//mha</div><div>  //writer->SetUseCompression(true);</div><div>  writer->SetInput( feldkamp->GetOutput() );</div><div>  writer->Update();</div><div>  </div><div>   std::cout << "Done" << std::endl;</div><div>    return 0;</div><div>}</div></div></div>