필터 지우기
필터 지우기

DICOM tag with missing VR loads inconsistently (Philips ScaleSlope)

조회 수: 5 (최근 30일)
I have two Philips mDixon datasets. In both, the VR for ScaleSlope is apparently missing:
(2005,100D) 00 A0 AA 44 # 1, 4
This should be read as a single value. In fact, dcminfo reads it correctly in one case: ScaleSlope = 1365, and incorrectly in the other: ScaleSlope = 0
160
170
68
Both times, I am using the same dictionary with the tag filled in (2005,100d) FL ScaleSlope 1.
1) What might cause one case to read correctly and the other not?
2) Is it possible to convert the string of 4 int8 numbers to a single 'single data type' number?
Many thanks,
Bogdan

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 15일
A = uint8(sscanf('00 A0 AA 44', '%2x'))
A = 4×1
0 160 170 68
typecast(A, 'single')
ans = single 1365
(Thank you for mentioning your release -- that saved me from showing you code that would not work in your release)
  댓글 수: 1
Bogdan Dzyubak
Bogdan Dzyubak 2021년 7월 15일
편집: Bogdan Dzyubak 2021년 7월 15일
Thanks so much! I was able to also salvage another dataset by converting '20 20' to int16 based on your example. Matlab has the most helpful Q&A!!!
If anyone also needs a python equivalent, it is:
import struct
if len(value) == 4:
value = struct.unpack('f',ds['2005','100d'].value)[0]
elif len(value) == 2:
value = struct.unpack('h',ds['2005','100d'].value)[0]
# For data type codes: https://pypi.org/project/rawutil/

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by