write a dicom image with input that is not dicom

11 Ansichten (letzte 30 Tage)
drummer
drummer am 11 Dez. 2019
Beantwortet: Walter Roberson am 11 Dez. 2019
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 Kommentare
drummer
drummer am 11 Dez. 2019
my input is the volumetric minc file from brainweb. I wonder it has not any metadata structure embedded.
Rik
Rik am 11 Dez. 2019
You are trying to call dicomwrite. What is your exact input? Either give exact code to reproduce your variables, or attach a mat file.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Dez. 2019
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.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by