-
Notifications
You must be signed in to change notification settings - Fork 1
/
alohaSessionReport.jq
62 lines (56 loc) · 1.57 KB
/
alohaSessionReport.jq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def mriInfo(m): (
if (m.Missing == true) then
{
"AcquisitionLabel": "Missing"
, "AcquisitionId": "Missing"
, "FileName": "Missing"
, "FileId": "Missing"
}
else
{
"AcquisitionLabel": m.AcquisitionLabel
, "AcquisitionId": m.AcquisitionId
, "FileName": m.FileName
, "FileId": m.FileId
}
end
);
def segAnalysisInfo(m): (
{
"AnalysisLabel": m.AnalysisLabel
, "AnalysisId": m.AnalysisId
, "AnalysisTimestamp": m.AnalysisTimestamp
}
);
def segInfo(m): (
{
"FileName": m.FileName
, "FileId": m.FileId
}
);
def baselineSessionInfo(s): (
{
"SessionLabel": s.SessionLabel
, "SessionId": s.SessionId
, "SessionScanDateTime": s.SessionScanDateTime
, "T1": mriInfo(s.T1)
, "T2": mriInfo(s.T2)
, "T1Analysis": segAnalysisInfo(s.T1LeftSegmentation)
, "T1LeftSegmentation": segInfo(s.T1LeftSegmentation)
, "T1RightSegmentation": segInfo(s.T1RightSegmentation)
, "T2Anlysis": segAnalysisInfo(s.T2LeftSegmentation)
, "T2LeftSegmentation": segInfo(s.T2LeftSegmentation)
, "T2RightSegmentation": segInfo(s.T2RightSegmentation)
}
);
def followupSessionInfo(s): (
{
"SessionLabel": s.SessionLabel
, "SessionId": s.SessionId
, "SessionScanDateTime": s.SessionScanDateTime
, "T1": mriInfo(s.T1)
, "T2": mriInfo(s.T2)
}
);
baselineSessionInfo(.Baseline) as $BaselineInfo
| .Followups[] | { "Baseline": $BaselineInfo, "Followup": followupSessionInfo(.) }