Why do I receive the error message "sliceViewer requires 3-D grayscale(MxNxP) or 3-D RGB volume(MxNxPx3) with no singleton dimensions"?

5 ビュー (過去 30 日間)
I am using the following code to load a stacks of CT images for 3D multiplanar and volume viewing. All my images are of dicom format images without the .dcm extension.
I try to use the following code to open my images.
dataFolder = fullfile("folder_name");
sourceTable = dicomCollection(dataFolder);
medVol = medicalVolume(sourceTable);
My medVol function gives the following result:
medVol =
medicalVolume with properties:
Voxels: [512×512 uint16]
VolumeGeometry: [1×1 medicalref3d]
SpatialUnits: "mm"
Orientation: "transverse"
VoxelSpacing: [1 1 1]
NormalVector: [0 0 1]
NumCoronalSlices: 512
NumSagittalSlices: 512
NumTransverseSlices: 1
PlaneMapping: ["sagittal" "coronal" "transverse"]
Modality: "CT"
WindowCenters: 200
WindowWidths: 50
sliceViewer(medVol)
My sliceViewer returned the following error message:
"Error using images.stacks.browser.internal.SliceViewer/validateVolume
sliceViewer requires 3-D grayscale(MxNxP) or 3-D RGB volume(MxNxPx3) with no singleton dimensions.
Error in images.stacks.browser.internal.SliceViewer/loadData
Error in sliceViewer"
Why my dicom images does not contain 3D grayscale or 3D RGB volume?
I tried to search online for ways to convert such images to grayscale or RGB but to no avail. I only get search results on conversion of grayscale to RGB and vice versa. Is there any way to convert my dicom images to 3D grayscale or 3D RGB volume? Any help is very much appreciated. Thank you.

採用された回答

Matt J
Matt J 2023 年 5 月 1 日
編集済み: Matt J 2023 年 5 月 1 日
I see nothing in your code that would be expected to access the numeric content of the DICOM files. You should probably be using dicomreadVolume to read in your data, perhaps
V = dicomreadVolume(sourceTable)
But even then, you should check what is being read in, and if it indeed has the form of a numeric volume array,
whos V
  2 件のコメント
Siang Ching
Siang Ching 2023 年 5 月 2 日
Thanks for your help for narrowing my troubleshooting area! Would need some time to figure it out and post my updates here.
Matt J
Matt J 2023 年 5 月 2 日
You're welcome, but if it ends up working, please Accept-click the answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMedical Physics についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by