Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
Run this code to download the MedicalVolumNIfTIData.zip file from the MathWorks® website, then unzip the file.
The size of the data file is approximately 76 MB.
Specify the filenames of the CT volume and label image used in this example.
medVolData =
medicalVolume with properties:
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 1/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
medvolLabels =
medicalVolume with properties:
queryPoints = linspace(min(intensity),max(intensity),256);
alphamap = interp1(intensity,alpha,queryPoints)';
colormap = interp1(intensity,color,queryPoints);
To display the volume in the patient coordinate system, pass the medicalVolume object as input to volshow. Use the
CinematicRendering rendering style to view the volume with realistic lighting and shadows. Specify the custom
colormap and transparency map. The volshow function uses the spatial details in medVol to set the
Transformation property of the output Volume object, vol. The voxels are scaled to the correct anisotropic
dimensions. The axes display indicators label the inferior/superior (S), left/right (L), and anterior/posterior (P)
anatomical axes.
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 2/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
Pause to apply all of the cinematic rendering iterations before updating the display in Live Editor.
pause(4) Get
drawnow
View the tumor label image as an overlay on the CT volume. You can set the OverlayData and OverlayAlphamap
properties of an existing Volume object, or specify them during creation using volshow. Note that you must set the
OverlayData property to the numeric array in the Voxels property of medVolLabels, rather than the medicalVolume
object itself.
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 3/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
pause(4) Get
drawnow
Optionally, you can clean up the viewer window by using the 3-D Scissors tool, , to remove the patient bed. For a
detailed example, see Remove Objects from Volume Display Using 3-D Scissors.
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 4/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 5/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
To scroll through the transverse slices, pause the cursor on the transverse slice until it highlights in blue, then drag
the cursor along the inferior/superior axis.
Drag the cursor to rotate the volume. The tumor overlay is visible in the slices for which the overlay is defined.
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 6/7
28/09/2023 10:44 Display Labeled Medical Image Volume in Patient Coordinate System - MATLAB & Simulink - MathWorks France
References
[1] Medical Segmentation Decathlon. "Lung." Tasks. Accessed May 10, 2018. http://medicaldecathlon.com/. The
Medical Segmentation Decathlon data set is provided under the CC-BY-SA 4.0 license. All warranties and
representations are disclaimed. See the license for details.
See Also
volshow | Volume Properties | medicalref3d | medicalVolume | intrinsicToWorldMapping
Related Topics
Choose Approach for Medical Image Visualization
Display Medical Image Volume in Patient Coordinate System
Display Volume Using Cinematic Rendering
Remove Objects from Volume Display Using 3-D Scissors
https://fr.mathworks.com/help/medical-imaging/ug/display-labeled-medical-image-volume-in-patient-coordinates.html 7/7