필터 지우기
필터 지우기

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

조회 수: 6 (최근 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 CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by