Skip to content

Commit e391f71

Browse files
authored
Add gyrotools support
1 parent 2a3483e commit e391f71

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ParXRec.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ Load .PAR header.
692692
"""
693693
function readpar(path::AbstractString)
694694
version = ""
695+
gyrotools = false
695696

696697
series = SeriesInfo()
697698
images = Vector{ImageInfo}()
@@ -715,6 +716,9 @@ function readpar(path::AbstractString)
715716
end
716717
iter = iterate(doc, state)
717718
break
719+
720+
elseif occursin(r"GyroTools|gyrotools", line)
721+
gyrotools = true
718722
end
719723

720724
iter = iterate(doc, state)
@@ -761,7 +765,11 @@ function readpar(path::AbstractString)
761765

762766
ks, vs = strip.(split(line[2:end], ": "))
763767

764-
if v3 && occursin("[msec]", ks)
768+
if gyrotools && ks == "Patient Position"
769+
ks = "Patient position"
770+
end
771+
772+
if (gyrotools || v3) && occursin("[msec]", ks)
765773
ks = replace(ks, "[msec]" => "[ms]")
766774
end
767775

0 commit comments

Comments
 (0)