CSA Headers

Some Siemens MRI scans may include CSA headers that provide valuable information regarding the acquisition and storage of the data (for more information see this excellent NiBabel article. These headers are stored as two private data elements:

  • (0029, 1010) - CSA Image Header Info

  • (0029, 1020) - CSA Series Header Info

By default, the Header instance’s get() method will parsed the CSA header information as a dict:

>>> from dicom_parser import Image
>>> image = Image("/path/to/siemens/csa.dcm")
>>> csa = image.header.get("CSASeriesHeaderInfo")
>>> csa["SliceAcceleration"]["MultiBandFactor"]

dicom_parser uses the CsaHeader class in order to created the parsed dictionary.

To learn more about the CsaHeader class, let’s have a look at the raw CSA header value returned by pydicom:

>>> from dicom_parser.utils.siemens.csa.header import CsaHeader
>>> raw_csa = image.header.get("CSASeriesHeaderInfo", parsed=False)
>>> type(raw_csa)
>>> raw_csa[:35]

Now, we will create an instance of the CsaHeader class and use it to parse the raw header:

>>> csa_header = CsaHeader(raw_csa)

>>> parsed_csa = csa_header.parse()
>>> type(parsed_csa)

# (we can also use the `parsed` property)
>>> csa_header.parsed["SliceArray"]["Size"]

>>> instance_number = image.header.get("InstanceNumber")
>>> parsed_csa["SliceArray"]["Slice"][instance_number]["Position"]["Tra"]