I am using Plastimatch DRR module within the SlicerRT extension to create synthetic lateral x-rays from a CT volume. I am trying to produce DRRs with the clearest vertebral margins (minimizing blur due to pixelation and banding artifacts) and I can’t find documentation of the “Spacing” parameter within the “Imager and Image” parameters in Plastmatch materials or 3D Slicer.
I have played around with the “Resolution” and “Spacing” parameters, but I don’t understand the relationship between them. At low values of both, the DRR doesn’t capture enough of the anatomy around the isocenter position and it is pixelated with significant banding artifacts.
Thank you for the prompt and informative response. I applied the settings that you recommended (Resolution = 2000, Spacing = 0.2mm) and the resulting DRR has some banding artifacts. See area around the navel.
Is there a combination of resolution/spacing that would result in the clearest margins of the vertebral bodies, not taking into account practicality?
I believe that I can achieve clearer visualization of the spine by cropping out the surrounding tissues and adjusting the SAD/SID. Before attempting those two avenues, I wanted to optimize resolution and spacing as much as possible.
I always use the volume renderer for DRR generation. It is blazing fast (you can render 100+ images per second with a good GPU), by adjusting the cropping ROI and editing the transfer functions you can get very good contrast for the bones. Use the CT-X-ray volume rendering preset and set the view background to black. I find that the image appearance overall is quite to an X-ray or fluoroscopy image.
I have used the CT-X-ray volume rendering for demonstrations, but I am not sure if it will meet my ultimate goal. I am trying to create a simulated XR (PNG, JPEG, or DICOM) in which the pixel coordinates of certain predetermined anatomic landmarks are known. To do this, I am marking the anatomic landmarks and the isocenter for the DRR on a CT or MHA in the Markup module. Then, I am calculating the distance between the isocenter and each of the coordinates in RAS and mapping those distances to the DRR using the center of the DRR as a reference.
Is there a better way of generating a simulated lateral x-ray in which the pixel coordinates of certain anatomic landmarks are known?
Volume rendering is perfect for this. You know the pixel coordinates of anatomic landmarks from the camera parameters. You can even make the landmarks appear in the DRR by enabling Occluded visibility in Markup module (Display / Advanced / 3D Display).
That’s great. Using the “CT-X-ray” preset in the Volume Rendering module, I created a DRR in the blue window. Do you recommend using the “Screenshot” or “ScreenView” tools to create a PNG of the contents of the blue window?
Where can I view the camera parameters? I looked at documentation for the “Cameras” module, but that doesn’t appear to contain the information that I need.
You can try to increase “Threshold below” value (for example set this value to 150). Below that threshold the HU values of CT data will be set to -1000 (air), so some soft tissues can be replaced with air.
The DRR calculation process can be significantly upgraded, if use RTK library for projection calculation.
I don’t know, possibly not. 3D Slicer doesn’t compile ITK with RTK support.
Official documentation only describes classes and methods of the library in C++. I work in C++ most of the time as well. If you familiar with C++ you could look at applications/rtkforwardprojections directory in RTK source. CT data must be a single mha file and projection geometry must be setup for proper forward projection reconstruction. I can send you a C++ example, but it only for Linux.
I forgot to mention that RTK can only increase calculation speed of DRR, any other features like projections of markups must be done (programmed) by the user.
You can right-click the 3D viewer, choose Copy image, then paste&save it in Paint or other image viewer software. You can also do it by Python scripting as shown in these examples (hit Ctrl-3 to open the Python console and copy-paste the code snippet).
There are so many tools in 3D Slicer and related libraries that can generate DRRs, all with specific advantages and disadvantages. The right choice depends on what you would like to achieve. What is your end goal with the DRR generation? CT/fluoro registration? What is the target anatomy and clinical procedure?
The ultimate goal is to evaluate a novel method for measuring thoracolumbar endplate orientation in sagittal plane radiographs (DR, CR, and EOS). The method must be implemented in custom measurement software.
To accomplish this, the process that I envisioned was to create “ideal” reference points in a CT volume, then hide those points and generate a synthetic lateral XR of the spine. The synthetic lateral XR would then be imported into the custom software that I am using for making endplate measurements and my team would make measurements per the novel protocol. Finally, I would compare the known coordinates of the “ideal” reference points in the DRR to the manually-measured points placed by my team.
It is similar to a process described by Hipp et al. 2022 in a recent publication (pages 9 and 10). They used Plastimatch’s DRR functionality, so I thought that Plastimatch would work for my purposes. Unfortunately, the quality of the DRRs is not representative of normal lumbar x-ray. See image below.
The “DRR Generation” module is the one that I was using in previous posts. I was able to generate a DRR of reasonable image quality by switching CT series to one with smaller “Image Spacing” (0.77, 0.77, 0.80. vs 0.85, 0.85, 1.0).
Fortunately (or unfortunately) the lack of resolution of the CTs that I was using may have been causing my issues all along.
I have two questions regarding the DRR Generation module:
How can I map the A and S components of the RAS coordinates of a point placed on the CT volume using the Markup module to the P,S or pixel coordinates of the DRR?
The DRR isocenter is set to a known LPS coordinate in the CT (ex. approximate center of L3, [-3,-120,380])
Therefore the center of the resulting DRR is known in relation to the CT volume
If I have the A, S distance from the center of L3 in the CT volume to a landmark of interest, can I transform those values to find the coordinates of the landmark of interest in the DRR?
Would you recommend exporting the DRR as a DICOM by right clicking the DRR volume in the “Data” module, selecting the “Export to DICOM” option, and checking the box for “Export to folder”? I am searching for the optimal method for exporting the DRR without compromising the relationship between the RAS coordinates of the CT volume and the pixel coordinates of the DRR.
Thanks again for all of your help! The documentation and community support for 3D Slicer is exceptional.
We don’t have a DICOM exporter for DRR (or fluoro) images in Slicer. It would not be hard to add it, but it may be simpler to save the image in a research file format and the DRR parameters in custom fields or in a sidecar file. Spending time with writing a DICOM exporter script may worth it if you will process the data with software that takes advantage of all the DRR parameters stored in these DRR files or for long-term archival or sharing of the images outside your group.
Great, I will dig into the Plastimatch documentation that you linked.
I am probably misunderstanding something, but it appears that I can create a DICOM export of the DRR using the “Data” module. This produces a .dcm file of ~8MB.
Separately, how can I specify the filename for a DRR in the DRR Generation module when the output format is “pgm” or “pfm”? When “pgm” or “pfm” is selected, I receive the following error: