How to set source to detector distance

I’m currently looking GetDRRSiddonJacobsRayTracing [1] to generate DRR images from 3D-CT volumes. Does this example have a way to set source to detector distance ?

If so can you elaborate with an example.


Maybe post this question on RTK mailing list. But even posting here, @simon.rit might answer.

This is actually not using RTK. The interpolate function which is used itk::SiddonJacobsRayCastInterpolateImageFunction, does not seem to have such an option so I’m guessing the DRR is computed at the isocenter. Changing it to another distance is a simple matter of changing the spacing and the origin of your DRR I suppose.

I need to add source to detector distance to this code as 1536 mm. In that case how can apply this change ? Could you please help me to figure it out ?

@isuruwi If you’re still having this issue, here is my solution. There are two ways to change the source to detector distance (scd) in the GetDRRSiddonJacobsRayTracing.cxx file you linked.

  1. you can use a command line input when you call the program from the command line. For example, in the directory with the .exe you could type: “programName.exe -scd 1536 CTVolumeName.nrrd”. This will set the isocenter to 1536 for that one instance of the program.
  2. If you’re looking to change the scd inside of the program, on line 109 the scd variable is defined. Changing this from the default 1000.0 to 1536. will cause the program’s default to be set to 1536. All subsequent instances of the program will use 1536 as their default scd
1 Like