-
Notifications
You must be signed in to change notification settings - Fork 5
Example for DICOMRT #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Example for DICOMRT #112
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
912fe33
example 6 DICOMRT
Meekalll 8cd9378
Delete panelDicomImport.png
Meekalll 43a432a
Edited Example 6
Meekalll 27d9c28
Minor bugfix
sahehb fd60283
css change
sahehb ee2490c
Keyboard shortcuts formatted and added
sahehb 677dd20
Edited Example 6
Meekalll 930f688
Merge branch 'MLAB-5610-DICOMRT' of https://github.com/MeVisLab/examp…
Meekalll 7034f07
minor fix
Meekalll 378fe99
Changes after review
sahehb ec6f3ba
The final changes for example 6
Meekalll e4df490
Merge branch 'MLAB-5610-DICOMRT' of https://github.com/MeVisLab/examp…
Meekalll 4376d2b
final edited example 6 .
Meekalll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
625 changes: 625 additions & 0 deletions
625
mevislab.github.io/content/examples/image_processing/example6/DICOMRT.mlab
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+230 KB
mevislab.github.io/content/examples/image_processing/example6/panelDicomImport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 170 additions & 0 deletions
170
mevislab.github.io/content/tutorials/image_processing/image_processing6.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| --- | ||
| title: "Example 6: DICOM RT Visualization in MeVisLab – RTSTRUCT and RTDOSE Workflow" | ||
| date: 2025-05-05 | ||
| status: "OK" | ||
| draft: false | ||
| weight: 630 | ||
| tags: ["Advanced", "Tutorial", "Image Processing", "DICOM", "RTSTRUCT", "RTDOSE", "RTPLAN"] | ||
| menu: | ||
| main: | ||
| identifier: "imageprocessing6" | ||
| title: "Step-by-Step Guide to Loading and Visualizing DICOM RT Data (RTSTRUCT & RTDOSE) in MeVisLab." | ||
| weight: 630 | ||
| parent: "imageprocessing" | ||
| --- | ||
|
|
||
| # Example 6: DICOM RT Visualization in MeVisLab – RTSTRUCT and RTDOSE Workflow | ||
|
|
||
| ## Introduction | ||
| This tutorial explains how to load and visualize DICOM RT data in MeVisLab step by step. You will learn how to: | ||
| * Load CT and related RTSTRUCT data. | ||
| * Visualize RTSTRUCTs as colored CSOs. | ||
| * Visualize RTDOSE as a colored overlay. | ||
| * Show labels next to each RTSTRUCT contour. | ||
| We use the `ExtractRTStruct`module for this example. | ||
|
|
||
| **DICOM RT (Radiotherapy)** files are essential in radiotherapy treatment planning. They include: | ||
| * **RTSTRUCT**: Defines contours of tumors and organs. | ||
| * **RTDOSE**: Shows planned 3D dose distribution. | ||
| * **RTPLAN**: Contains treatment plan details like beams and dose settings. | ||
| Together, they ensure accurate and safe radiotherapy delivery. | ||
|
|
||
| ## Prepare your network | ||
| First, we need to download the ZIP file at **DICOM patient export** from: | ||
|
|
||
| https://medicalaffairs.varian.com/headandneckbilat-imrtsx2 | ||
|
|
||
| It contains the CT, RTSTRUCT, and RTDOSE files needed for this tutorial to work correctly in MeVisLab. | ||
|
|
||
| {{<alert class="warning" caption="Attention">}} | ||
| This data is FOR EDUCATIONAL AND SCIENTIFIC EXCHANGE ONLY – NOT FOR SALES OR PROMOTIONAL USE. | ||
| {{</alert>}} | ||
|
|
||
| Create a new folder named *DICOM_FILES*. Extract the ZIP file into this folder. | ||
|
|
||
| We will use it in this tutorial. | ||
|
|
||
| Add the module `DicomImport` to your workspace. | ||
|
|
||
|  | ||
|
|
||
| Then click Browse and select the new folder named *DICOM_FILES* where you copied the content of the ZIP file earlier, then press Import. You can see it in the below figure: | ||
|
|
||
|  | ||
|
|
||
| Now add a `View2D` module and connect it to `DicomImport`. | ||
|
|
||
| As shown in the Data Tree (middle pane), the imported DICOM RT structure includes: | ||
|
|
||
| * **eByLuKOZoWxBUrIW** – An anonymized Patient ID. | ||
|
|
||
| * **0000-00-00** – Missing or anonymized Birth/Study Date. | ||
|
|
||
| When you expand the tree view you will see: | ||
|
|
||
| * **RTPLAN** – Treatment plan metadata (no image). | ||
| * **RTSTRUCT** – Contour data (e.g., organs, tumors; no image). | ||
| * **CT 512×512×272×1** – The full CT scan volume (visible anatomy). | ||
| * **RTDOSE 199×115×147×1** – The 3D dose distribution (dose grid). | ||
|
|
||
| After connecting, open the `View2D` and click on each of these items to visualize the corresponding data in the viewer, as shown in the figures below. | ||
|
|
||
| {{< imagegallery 4 "/images/tutorials/image_processing/" "RTPLAN" "RTSTRUCT" "CT512" "RTDOSE">}} | ||
|
|
||
| Select the CT 512×512×272×1 series. | ||
| We now want to view the CT images and the RTSTRUCT data together. The module `DicomImport` only allows to select one single object. In order to select more than one object, we use a `DicomImportExtraOutput` module. Select the CT series in the `DicomImport` module and the RTSTRUCT in the `DicomImportExtraOutput` module. | ||
|
|
||
| You have to select the correct index for the RTSTRUCT. In our example it is index 2. | ||
|
|
||
| Add `DicomImportExtraOutput` module as shown in the figure below: | ||
|
|
||
|  | ||
|
|
||
| ### **Visualize RTSTRUCTs as colored CSOs:** | ||
|
|
||
| Now we need an `ExtractRTStruct` module to convert RTSTRUCT data into CSOs (Contour Segmentation Objects). CSOs allow MeVisLab to visualize the contours on the CT scan and to interact with them. | ||
|
|
||
| Then connect it with the `DicomImportExtraOutput` as shown in the figure: | ||
|
|
||
|  | ||
|
|
||
|
|
||
| Add `SoView2DCSOExtensibleEditor` to enable visualization and interaction with the CSOs in the 2D viewer, allowing you to edit and work with the contours directly. Connect it with `View2D` and `ExtractRTStruct` modules, as shown, where `View2D` displays the CT scan with the contours. | ||
|
|
||
|  | ||
|
|
||
| There are no names for the contours by default, we want to show the names for the contour to identify the segmented structure, so we need the `CSOLabelRenderer` module to add labels (e.g., 'Bladder', 'Prostate') next to each contour, helping to clearly identify the anatomy. The figure below shows that: | ||
|
|
||
|  | ||
|
|
||
| As you can see, the contours are labeled with numbers. We want to show the names for the contour to identify the segmented structure. To do this, open the `CSOLabelRenderer` panel — it will display the panel shown below. | ||
|
|
||
|
|
||
|  | ||
|
|
||
| Now, add this line to make the numbers names for the contour: | ||
| {{< highlight >}} | ||
| ```Python | ||
| labelString = cso.getGroupAt(0).getLabel() | ||
| ``` | ||
| {{</highlight>}} | ||
|
|
||
| Then press apply. You can see the names of the structures next to the contours. | ||
|
|
||
|  | ||
|
|
||
| ### **3D Visualization of Contours Using `SoExaminerViewer`** | ||
|
|
||
| If you want to visualize the contours in 3D, follow these steps: | ||
|
|
||
| Add the `SoCSO3DRenderer` module and connect it to the `ExtractRTStruct` module. The `SoCSO3DRenderer` will render the contours (CSOs) in the 3D space. | ||
|
|
||
| Add the `SoExaminerViewer` module and connect it to the `SoCSO3DRenderer` module. The `SoExaminerViewer` will allow you to view the 3D contours. You can rotate, zoom, and move around the 3D image. | ||
|
|
||
| The following figure shows the network and the result: | ||
|
|
||
|  | ||
|
|
||
| ### **Visualizing RTDOSE as a Color Overlay Using LUT** | ||
|
|
||
| Now we need to add another `DicomImportExtraOutput` module to import multiple DICOM objects. You have to select the right index for the example it is index 4 thats mean RTDOSE 199*115*147*1 . Add `MinMaxScan` module to scan the input image and updates the minimum and maximum values of the output image, and connect it with the `DicomImportExtraOutput`. | ||
|
|
||
|  | ||
|
|
||
| Add `Histogram` module to calculate the image's intensity distribution, and connect it with `MinMaxScan`. | ||
|
|
||
| The `Histogram` module computes the image's intensity distribution, and is connected to the `SoLUTEditor` module to modify the lookup table (LUT). The LUT is then passed to the `SoGroup` module, which is connected to the `SoView2DOverlay` module to blend the 2D image overlay in a 2D viewer. The `SoLUTEditor` module allows interactive editing of the LUT, while `SoView2DOverlay` module facilitates overlaying the modified image in a 2D scene. | ||
|
|
||
| Note that the `SoView2DOverlay` module is for 2D blending, and the `GVROrthoOverlay` module should be used for `OrthoView2D`. | ||
|
|
||
| The below figure shows the connections of the network: | ||
|
|
||
|  | ||
|
|
||
| Now we should update the `Histogram` module by pressing the update button on it. | ||
|
|
||
|  | ||
|
|
||
| Now open `SoLUTEditor` module panel, go to *Range*, *Update Range From Histogram* to apply the histogram values, as shown in the figure: | ||
|
|
||
|  | ||
|
|
||
| Then in the same panel from (*Editor*... *change the color of the values*), as shown in the figure: | ||
|
|
||
|  | ||
|
|
||
|
|
||
| Finally, when you press `View2D`, it will display a 2D anatomical image with a colored RTDOSE overlay, where the dose distribution is visualized using a customized Lookup Table (LUT) that clearly highlights the radiation intensity levels within the body. | ||
|
|
||
|  | ||
|
|
||
| ## **Summary** | ||
|
|
||
| * Load DICOM RT data including RTDOSE and RTSTRUCT. | ||
| * Visualize RTSTRUCTs with `ExtractRTStruct` and `CSOLabelRenderer`. | ||
| * Display contour labels using `CSOLabelRenderer`. | ||
| * View images in 2D (`View2D`) and 3D (`SoExaminerViewer`). | ||
| * Visualize RTDOSE as a color overlay using `SoLUTEditor`. | ||
| * Adjust dose intensity with `Histogram` and `MinMaxScan`. | ||
|
|
||
| {{< networkfile "/examples/image_processing/example6/DICOMRT.mlab" >}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-373 KB
mevislab.github.io/static/images/tutorials/image_processing/2DSlice_3D.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+157 KB
mevislab.github.io/static/images/tutorials/image_processing/CSOLabelRenderer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.3 KB
...ab.github.io/static/images/tutorials/image_processing/CSOLabelRendererpanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.1 KB
mevislab.github.io/static/images/tutorials/image_processing/CT512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+203 KB
....io/static/images/tutorials/image_processing/ConnectionandtheoutputofView2D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.4 KB
mevislab.github.io/static/images/tutorials/image_processing/DicomImport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.6 KB
mevislab.github.io/static/images/tutorials/image_processing/Dicommm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.2 KB
mevislab.github.io/static/images/tutorials/image_processing/Import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
mevislab.github.io/static/images/tutorials/image_processing/LUTEditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+232 KB
...hub.io/static/images/tutorials/image_processing/OutputoftheSoExaminerViewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.8 KB
...hub.io/static/images/tutorials/image_processing/PanelDicomImportExtaOutput1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+254 KB
mevislab.github.io/static/images/tutorials/image_processing/PanelView2DPanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+101 KB
...io/static/images/tutorials/image_processing/PanelView2Dafternamedthecontour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.3 KB
mevislab.github.io/static/images/tutorials/image_processing/RTDOSE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.3 KB
mevislab.github.io/static/images/tutorials/image_processing/RTSTRUCT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.4 KB
...slab.github.io/static/images/tutorials/image_processing/SELECTINGCTRTSTRUCT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.3 KB
mevislab.github.io/static/images/tutorials/image_processing/SelectingC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.2 KB
mevislab.github.io/static/images/tutorials/image_processing/Varian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+118 KB
mevislab.github.io/static/images/tutorials/image_processing/Visualizing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+146 KB
mevislab.github.io/static/images/tutorials/image_processing/contournamed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.9 KB
mevislab.github.io/static/images/tutorials/image_processing/converter.png
Oops, something went wrong.
Binary file added
BIN
+149 KB
mevislab.github.io/static/images/tutorials/image_processing/cotour.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+30.1 KB
mevislab.github.io/static/images/tutorials/image_processing/dico1.png
Oops, something went wrong.
Binary file added
BIN
+32.4 KB
mevislab.github.io/static/images/tutorials/image_processing/editior.png
Oops, something went wrong.
Binary file added
BIN
+23.2 KB
mevislab.github.io/static/images/tutorials/image_processing/histo.png
Oops, something went wrong.
Binary file added
BIN
+32.7 KB
mevislab.github.io/static/images/tutorials/image_processing/importt.png
Oops, something went wrong.
Binary file added
BIN
+91 KB
mevislab.github.io/static/images/tutorials/image_processing/minmaxscan.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+276 KB
...ic/images/tutorials/image_processing/panelCSOLabelRenderertonamethecontour..png
Oops, something went wrong.
Binary file added
BIN
+230 KB
mevislab.github.io/static/images/tutorials/image_processing/panelDicomImport.png
Oops, something went wrong.
Binary file added
BIN
+127 KB
...ages/tutorials/image_processing/panelDicomImportExtraOutputtoshowthecontour.png
Oops, something went wrong.
Binary file added
BIN
+252 KB
...tic/images/tutorials/image_processing/panelofView2Dwithcontouringandnumbers.png
Oops, something went wrong.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
mevislab.github.io/themes/MeVisLab/layouts/partials/footer.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mevislab.github.io/themes/MeVisLab/layouts/partials/nextprev.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.