Read Modify and Write Siemens XA30 DICOM headers with all fields.

17 ビュー (過去 30 日間)
Jason
Jason 2023 年 4 月 11 日
コメント済み: Jason 2023 年 4 月 24 日
Hello
I'm trying to modify new Siemens XA30 DICOM headers. I only need to change a few fields (like Subject ID) but I need to preserve everything in the header. Based on the documentation, it looks to me that something like:
%--------
info=dicominfo(dicomFIleName);
info.PatientName.FamilyName='SOMETHINGELSE';
info.PatientID='SOMETHINGELSE';
dicomanon( dicomFileName, dicomFIleName, 'update', info, 'WritePrivate', true );
%------
should work. However, this wipes out a large number of fields like "ScanningSequence" and "SequenceVariant" as well as a large amount of the needed details about the scan (slice timing, totalreadouttime, etc.), basically ruining the header.
Is there either an alternative that would keep all the header information intact, or a plan to update the set of dicom functions in Matlab to more fully support the new Siemens format?
Thanks

回答 (2 件)

Manoj Mirge
Manoj Mirge 2023 年 4 月 21 日
Hi Jason,
The syntax “dicomanon(file_in,file_out)” removes confidential medical information from the DICOM file file_in and creates a new file file_out with the modified values. That is why your new file has some fields removed from it.
To achieve the intended result, you can use the dicomwrite function.
You can achieve your desired result using the below code:
x=dicomread(dicomFileName);
info=dicominfo(dicomFileName);
% Modify the metadata
info.PatientName.FamilyName='SOMETHINGELSE';
info.PatientID='SOMETHINGELSE';
% Write the modified metadata in same file
dicomwrite(x,dicomFileName,info,"CreateMode","copy");
% This will modify your dicom file’s header.
You can read more about dicomwrite function here:
Hope this helps.
  1 件のコメント
Jason
Jason 2023 年 4 月 24 日
Looks like I mistakenly commented (below) on my own question and not to this response.
As noted below, this answer does not work. The same problems of missing fields that should not be removed or altered exists.

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


Jason
Jason 2023 年 4 月 21 日
Thank you for the response however that doesn't work.
dicomanon with update and the original output of dicominfo should just put the header back in, but dicomwrite is probably the better method. However, both are stripping fields that are not "confidential medial information" (and dicomwrite shouldn't be stripping at all). In a T1, fields like
"ScanningSequence"
"SequenceVariant"
"ScanOptions"
"ImageTypeText"
"NonlinearGradientCorrection"
"PartialFourier"
"BaseResoluytion"
"ShimSetting"
"TxRefAmp"
"PhaseResolution"
"RecieveCoilName"
RecieveCoilSctiveElements"
"PulseSequenceDetails"
"CoilCombinationMethod"
"MatricCoilCode"
"ParallelReductionFactorInPlane"
"DwellTime"
are all missing using dicomwrite or dicomanon. Some of those are important, but regardless of whether their important or not, they shouldn't be lost reading and writing the file.
Thank you.

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by