Heesung Yang

[명령어] dcmodify

  • DCMTK 버전: 3.6.5
  • DICOM 파일명 : sample.dcm

옵션

~$ dcmodify -imt -nb -ep -ea "(0018,1020)" "${FILE}"
~$ dcmodify -nb -i "(0018,1020)=Myhome" "${FILE}"
~$ dcmodify -nb -m "(0018,1020)=Myhome" "${FILE}"
  • -i : 태그 추가
  • -m : 태그 수정
  • -nb : 수정 시 원본 파일 백업 안함
    • 해당 옵션을 사용하지 않으면, 자동으로 백업파일 생성됨
  • -imt : ignore missing tag
  • -ep : 모든 private 태그 삭제
  • -ea : 매치되는 모든 태그 삭제

태그 추가

단일 태그

~$ dcmodify -i "ImageLaterality=L" sample.dcm

시퀀스 태그

# (0028,3010)     SQ (Sequence with explicit length #=1)      # 8246, 1 VOILUTSequence
#   (fffe,e000)   na (Item with explicit length #=3)          # 8238, 1 Item
#     (0028,3002) US 4096\0\12                                # 6,    3 LUTDescriptor
#     (0028,3003) LO [Inserted string2]                       # 16,   1 LUTExplanation  <<< Add this line

# 아래 5가지 표현식으로 가능
~$ dcmodify -i "VOILUTSequence[0].LUTExplanation=Inserted string" sample.dcm
~$ dcmodify -i "(0028,3010)[0].LUTExplanation=Inserted string" sample.dcm
~$ dcmodify -i "(0028,3010)[0].0028,3003=Inserted string" sample.dcm
~$ dcmodify -i "(0028,3010)[0].(0028,3003)=Inserted string" sample.dcm
~$ dcmodify -i "0028,3010[0].0028,3003=Inserted string" sample.dcm

태그 삭제

~$ dcmodify -e "(0028,3010)" sample.dcm
# 또는
~$ dcmodify -e "VOILUTSequence" sample.dcm

태그 수정

~$ dcmodify -m "ImageLaterality=R" sample.dcm

Previous post

[명령어] ip