Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions suspect/io/rda.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"StationName", "InstitutionName", "DeviceSerialNumber", "InstanceDate",
"InstanceTime", "InstanceComments", "SequenceName", "SequenceDescription",
"Nucleus", "TransmitCoil", "PatientSex", "HammingFilter", "FrequencyCorrection"],
"float_arrays": ["PositionVector", "RowVector", "ColumnVector"],
"float_arrays": ["PositionVector", "RowVector", "ColumnVector","SlabThickness"],
"integer_arrays": ["CSIMatrixSize", "CSIMatrixSizeOfScan", "CSIGridShift"],
"string_arrays": ["SoftwareVersion"],
"dictionaries": ["TransmitRefAmplitude"]
"dictionaries": ["TransmitRefAmplitude","SlabOrientation","MidSlabPosition",""]
}


Expand All @@ -46,7 +46,7 @@ def load_rda(filename):
elif key in rda_types["integers"]:
header_dict[key] = int(value)
elif key in rda_types["floats"]:
header_dict[key] = float(value)
header_dict[key] = float(value.replace(",",".",1))
elif "[" in key and "]" in key:
# could be a dict or a list
key, index = re.split(r"\]|\[", key)[0:2]
Expand All @@ -57,7 +57,7 @@ def load_rda(filename):
else:
# not a dictionary, must be a list
if key in rda_types["float_arrays"]:
value = float(value)
value = float(value.replace(",",".",1))
elif key in rda_types["integer_arrays"]:
value = int(value)
index = int(index)
Expand Down Expand Up @@ -90,6 +90,17 @@ def load_rda(filename):
if "VOIReadoutFOV" not in header_dict:
if "VOIReadoutVOV" in header_dict:
header_dict["VOIReadoutFOV"] = header_dict.pop("VOIReadoutVOV")
#lazy workaround for new Viva scanner
elif "SlabOrientation" in header_dict:
header_dict["VOIReadoutFOV"] = 999.9
header_dict["VOIPhaseFOV"] = 999.9
header_dict["VOIThickness"] = 999.9
header_dict["VOIPositionSag"] = 999.9
header_dict["VOIPositionCor"] = 999.9
header_dict["VOIPositionTra"] = 999.9
#header_dict["PixelSpacingCol"] = 999.9
#header_dict["PixelSpacingRow"] = 999.9
header_dict["PixelSpacing3D"] = 999.9

# combine positional elements in the header
voi_size = (header_dict["VOIReadoutFOV"],
Expand Down