Closed magerkurth closed 2 years ago
PS: I am happy to help with the phase encoding direction problem: Fix phase encoding property #81
@magerkurth Thank you for reporting this!
Two comments:
PhaseEncodingDirectionPositive
CSA field is found in the CSAImageHeaderInfo
((0029, 1010)
) and not CSASeriesHeaderInfo
((0029, 1020)
) private tag (see the Header
class' get_phase_encoding_direction
method. CSAImageHeaderInfo
and CSASeriesHeaderInfo
tags are parsed automatically, so you should be able to just do: header.get("CSAImageHeaderInfo")
to return the parsed dictionary.I think you should try:
>>> header = dicom_parser.Header(path)
>>> csa_header = header.get("CSAImageHeaderInfo")
>>> csa_header.get("PhaseEncodingDirectionPositive")
{'index': 20, 'VR': 'IS', 'VM': 1, 'value': 1}
# Or, do return i/j/-/+:
>>> header.get_phase_encoding_direction()
'i-'
Does this work?
Hi,
Thank for the quick response. Oh dear, I have missed the "Image" instead of the "Series". I will try your suggestion after I am back from my annual leave.
Best wishes.
"Image" instead of "Series" did the trick.
However, header.get("CSAImageHeaderInfo")
does not return a parsed object, but type byte. I can live with this, using the following work around.
self._csa_image_header = dicom_parser.utils.siemens.csa.header.CsaHeader(self._header.get("CSAImageHeaderInfo", parsed=False))
logger.debug2('Parsing CSA Image header\n')
self._csa_image_header_parsed = self._csa_image_header.read()
I am using the dicom_parser version from 19.02. I will try it again with the updated version uploaded a few hours ago.
Ok, let me know how it goes. If it still doesn't work, I'd suggest trying to use the tag instead of the name (("0029", "1010")
).
@magerkurth any updates? Can this be closed?
Describe the bug PhaseEncodingDirectionPositive not extracted from CSA header
To Reproduce Steps to reproduce the behavior:
No key with "PhaseEncodingDirectionPositive" in the dictionary (or sub-diktioniers and lists) of self._csa_header_parsed
Desktop:
Prove that DICOM file contains "PhaseEncodingDirectionPositive" In a bash terminal execute:
strings /incoming/dicom.dcm | sort | grep -I phase
This code finds a field "PhaseEncodingDirectionPositive"
Further comments I was working on the problem of extracting the phase encoding direction, when I came across this issue. I have not checked if other fields are missing too, but that could be very well the case.