write a dicom image with input that is not dicom

조회 수: 8 (최근 30일)
drummer
drummer 2019년 12월 11일
답변: Walter Roberson 2019년 12월 11일
Hi fellows,
Before showing the link, I have already read the documentation for dicomwrite. It turns out that it works in the instance of an input image already being a dicom image.
I want to create a dicom file using an image that is an object in matlab environment.
I understand that the metadata structure go nuts, because there is no info in the structure (as the input is not derived from a dicom file).
When I try to create the dicom image, I get the following message:
Error using dicom_prep_ImagePixel>getPhotometricInterp (line 134)
Cannot determine photometric interpretation.
Error in dicom_prep_ImagePixel (line 9)
metadata.(dicom_name_lookup('0028', '0004', dictionary)) =
getPhotometricInterp(metadata, X, map, txfr, dictionary);
Error in dicom_prep_metadata (line 51)
metadata = dicom_prep_ImagePixel(metadata, X, map, txfr,
useMetadataBitDepths, dictionary);
Error in dicom_create_IOD (line 26)
metadata = dicom_prep_metadata(IOD_UID, metadata, X, map, options.txfr,
options.usemetadatabitdepths, dictionary);
Error in dicomwrite>write_message (line 276)
[attrs, status] = dicom_create_IOD(SOP_UID, X, map, ...
Error in dicomwrite (line 212)
[status, options] = write_message(X, filename, map, metadata,
options);
How can I surpass this issue?
Thanks in advance
  댓글 수: 3
drummer
drummer 2019년 12월 11일
my input is the volumetric minc file from brainweb. I wonder it has not any metadata structure embedded.
Rik
Rik 2019년 12월 11일
You are trying to call dicomwrite. What is your exact input? Either give exact code to reproduce your variables, or attach a mat file.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 12월 11일
I recommend that you find an existing dicom file that has the same properties you want, and use dicominfo() to read the meta-data. (You could store the metadata somewhere so that you did not need to keep the base image around.)
Then when you use dicomwrite() pass the saved metadata before any name/value pairs. dicomwrite() knows enough to override the information about the number of pixels, but will retain (most of?) the other information. You would want to do some testing to ensure it does not accidentally duplicate UUIDs specific to the patient.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by