Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] fix lesion segmentation output (and refactor) #727

Merged
merged 25 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c65c09e
upgrade transformers and allow for globbing patterns in conditions in…
Remi-Gau Jul 10, 2022
f0a7753
refactor
Remi-Gau Jul 10, 2022
b930418
refactor
Remi-Gau Jul 10, 2022
2741a9c
add demo and update
Remi-Gau Jul 10, 2022
0ff6f32
update bids matlab
Remi-Gau Jul 11, 2022
ad7354b
update bids-matlab
Remi-Gau Jul 11, 2022
e572543
adpat getOptionsFromModel to new schema
Remi-Gau Jul 11, 2022
5795c33
update demo
Remi-Gau Jul 11, 2022
8307689
Merge branch 'main' into enh_trans
Remi-Gau Jul 20, 2022
1b4588d
add more explicit error message for input parsing of getData
Remi-Gau Jul 20, 2022
7e3f24f
Merge branch 'main' into fixes
Remi-Gau Jul 20, 2022
91e3fed
Merge pull request #716 from Remi-Gau/enh_trans
Remi-Gau Jul 20, 2022
eeb9a71
Merge pull request #726 from Remi-Gau/fixes
Remi-Gau Jul 20, 2022
f00b36c
refactor renaming functions
Remi-Gau Jul 20, 2022
2df8fc7
misc
Remi-Gau Jul 20, 2022
bc32b93
Merge branch 'main' into lesion_seg
Remi-Gau Jul 20, 2022
9d55fff
refactor renaming config for lesion segmentation
Remi-Gau Jul 20, 2022
bb9765e
refactor renaming config lesion segmentation
Remi-Gau Jul 20, 2022
5ee1360
refactor renaming configuration
Remi-Gau Jul 20, 2022
e8d89c4
Merge branch 'dev' into lesion_seg
Remi-Gau Jul 20, 2022
0d2a105
adapt renaming of lesion segmentation to chosen options
Remi-Gau Jul 20, 2022
f78c17a
add dummy test data
Remi-Gau Jul 20, 2022
cc9db49
resize ALI mask in function of chosen options
Remi-Gau Jul 20, 2022
ee05cad
deal with multiple iterations renaming
Remi-Gau Jul 20, 2022
81f4f67
adapt tests
Remi-Gau Jul 20, 2022
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
4 changes: 2 additions & 2 deletions demos/lesion_detection/run_lesion.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

bidsCopyInputFolder(opt);

% Step 1: segmentation
%% Step 1: segmentation
bidsLesionSegmentation(opt);

% % Step 2: lesion abnormalities
%% Step 2: lesion abnormalities
bidsLesionAbnormalitiesDetection(opt);

% % Step 3: overlap map
Expand Down
3 changes: 3 additions & 0 deletions demos/transformers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.mat
new_events.tsv
transformers.json
175 changes: 175 additions & 0 deletions demos/transformers/data/sub-03_task-VisuoTact_run-02_events.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
onset duration trial_type expected_response given_response response_time
0.000 1.358 BASE 0 0 0.000
1.358 2.026 CONG_LEFT 0 0 0.000
3.384 1.714 ISI 0 0 0.000
5.098 2.026 REST 0 0 0.000
7.124 2.047 ISI 0 0 0.000
9.171 2.046 P_LEFT 0 0 0.000
11.217 1.893 ISI 0 0 0.000
13.110 1.712 RESPONSE_P_LEFT 1 0 2147483.647
14.822 1.693 ISI 0 0 0.000
16.515 2.046 REST 0 0 0.000
18.561 2.381 ISI 0 0 0.000
20.942 2.028 INCONG_VR_PL 0 0 0.000
22.970 2.314 ISI 0 0 0.000
25.284 2.047 CONG_RIGHT 0 0 0.000
27.331 1.959 ISI 0 0 0.000
29.290 2.047 INCONG_VL_PR 0 0 0.000
31.337 1.712 ISI 0 0 0.000
33.049 2.027 V_LEFT 0 0 0.000
35.076 2.180 ISI 0 0 0.000
37.256 1.692 RESPONSE_V_LEFT 1 0 2147483.647
38.948 1.914 ISI 0 0 0.000
40.862 2.047 P_RIGHT 0 0 0.000
42.909 2.294 ISI 0 0 0.000
45.203 2.047 V_RIGHT 0 0 0.000
47.250 2.381 ISI 0 0 0.000
49.631 2.046 P_LEFT 0 0 0.000
51.677 1.693 ISI 0 0 0.000
53.370 2.046 INCONG_VL_PR 0 0 0.000
55.416 1.961 ISI 0 0 0.000
57.377 1.712 RESPONSE_INCONG_VL_PR 1 0 2147483.647
59.089 1.692 ISI 0 0 0.000
60.781 2.047 V_RIGHT 0 0 0.000
62.828 2.114 ISI 0 0 0.000
64.942 2.026 CONG_RIGHT 0 0 0.000
66.968 2.180 ISI 0 0 0.000
69.148 1.693 RESPONSE_CONG_RIGHT 1 0 2147483.647
70.841 2.046 ISI 0 0 0.000
72.887 2.048 INCONG_VR_PL 0 0 0.000
74.935 2.180 ISI 0 0 0.000
77.115 2.027 P_RIGHT 0 0 0.000
79.142 2.180 ISI 0 0 0.000
81.322 2.047 CONG_LEFT 0 0 0.000
83.369 2.160 ISI 0 0 0.000
85.529 2.047 V_LEFT 0 0 0.000
87.576 1.980 ISI 0 0 0.000
89.556 1.692 RESPONSE_V_LEFT 1 0 2147483.647
91.248 1.914 ISI 0 0 0.000
93.162 2.026 REST 0 0 0.000
95.188 2.114 ISI 0 0 0.000
97.302 2.047 REST 0 0 0.000
99.349 1.759 ISI 0 0 0.000
101.108 2.046 CONG_RIGHT 0 0 0.000
103.154 1.692 ISI 0 0 0.000
104.846 2.047 REST 0 0 0.000
106.893 2.381 ISI 0 0 0.000
109.274 2.028 P_LEFT 0 0 0.000
111.302 1.913 ISI 0 0 0.000
113.215 1.692 RESPONSE_P_LEFT 1 0 2147483.647
114.907 2.180 ISI 0 0 0.000
117.087 2.047 REST 0 0 0.000
119.134 2.113 ISI 0 0 0.000
121.247 2.027 V_LEFT 0 0 0.000
123.274 2.381 ISI 0 0 0.000
125.655 2.048 INCONG_VL_PR 0 0 0.000
127.703 1.826 ISI 0 0 0.000
129.529 2.046 P_RIGHT 0 0 0.000
131.575 1.846 ISI 0 0 0.000
133.421 2.027 INCONG_VR_PL 0 0 0.000
135.448 1.913 ISI 0 0 0.000
137.361 1.692 RESPONSE_INCONG_VR_PL 1 0 2147483.647
139.053 2.247 ISI 0 0 0.000
141.300 2.047 V_RIGHT 0 0 0.000
143.347 2.382 ISI 0 0 0.000
145.729 2.026 CONG_LEFT 0 0 0.000
147.755 1.980 ISI 0 0 0.000
149.735 2.047 CONG_LEFT 0 0 0.000
151.782 1.893 ISI 0 0 0.000
153.675 1.692 RESPONSE_CONG_LEFT 1 0 2147483.647
155.367 2.113 ISI 0 0 0.000
157.480 2.047 REST 0 0 0.000
159.527 1.759 ISI 0 0 0.000
161.286 2.048 P_RIGHT 0 0 0.000
163.334 1.979 ISI 0 0 0.000
165.313 2.027 INCONG_VR_PL 0 0 0.000
167.340 1.980 ISI 0 0 0.000
169.320 2.046 REST 0 0 0.000
171.366 1.759 ISI 0 0 0.000
173.125 2.047 INCONG_VL_PR 0 0 0.000
175.172 1.960 ISI 0 0 0.000
177.132 2.046 P_LEFT 0 0 0.000
179.178 1.760 ISI 0 0 0.000
180.938 2.047 V_RIGHT 0 0 0.000
182.985 2.114 ISI 0 0 0.000
185.099 1.692 RESPONSE_V_RIGHT 1 0 2147483.647
186.791 2.247 ISI 0 0 0.000
189.038 2.047 V_LEFT 0 0 0.000
191.085 1.692 ISI 0 0 0.000
192.777 2.047 CONG_RIGHT 0 0 0.000
194.824 2.093 ISI 0 0 0.000
196.917 2.048 INCONG_VR_PL 0 0 0.000
198.965 2.247 ISI 0 0 0.000
201.212 1.692 RESPONSE_INCONG_VR_PL 1 0 2147483.647
202.904 1.779 ISI 0 0 0.000
204.683 2.027 CONG_LEFT 0 0 0.000
206.710 1.846 ISI 0 0 0.000
208.556 2.047 INCONG_VL_PR 0 0 0.000
210.603 1.959 ISI 0 0 0.000
212.562 2.048 REST 0 0 0.000
214.610 2.113 ISI 0 0 0.000
216.723 2.027 CONG_RIGHT 0 0 0.000
218.750 1.712 ISI 0 0 0.000
220.462 1.692 RESPONSE_CONG_RIGHT 1 0 2147483.647
222.154 2.047 ISI 0 0 0.000
224.201 2.027 REST 0 0 0.000
226.228 2.046 ISI 0 0 0.000
228.274 2.047 V_LEFT 0 0 0.000
230.321 2.161 ISI 0 0 0.000
232.482 2.047 V_RIGHT 0 0 0.000
234.529 1.846 ISI 0 0 0.000
236.375 2.026 P_LEFT 0 0 0.000
238.401 2.315 ISI 0 0 0.000
240.716 2.046 P_RIGHT 0 0 0.000
242.762 2.381 ISI 0 0 0.000
245.143 1.692 RESPONSE_P_RIGHT 1 0 2147483.647
246.835 2.047 ISI 0 0 0.000
248.882 2.048 V_LEFT 0 0 0.000
250.930 2.294 ISI 0 0 0.000
253.224 2.047 V_RIGHT 0 0 0.000
255.271 2.046 ISI 0 0 0.000
257.317 2.027 CONG_LEFT 0 0 0.000
259.344 1.913 ISI 0 0 0.000
261.257 2.046 P_LEFT 0 0 0.000
263.303 2.227 ISI 0 0 0.000
265.530 2.048 INCONG_VR_PL 0 0 0.000
267.578 1.846 ISI 0 0 0.000
269.424 2.027 P_RIGHT 0 0 0.000
271.451 2.381 ISI 0 0 0.000
273.832 1.712 RESPONSE_P_RIGHT 1 0 2147483.647
275.544 1.960 ISI 0 0 0.000
277.504 2.046 REST 0 0 0.000
279.550 2.114 ISI 0 0 0.000
281.664 2.026 REST 0 0 0.000
283.690 2.115 ISI 0 0 0.000
285.805 2.047 CONG_RIGHT 0 0 0.000
287.852 1.759 ISI 0 0 0.000
289.611 2.046 INCONG_VL_PR 0 0 0.000
291.657 1.693 ISI 0 0 0.000
293.350 1.712 RESPONSE_INCONG_VL_PR 1 0 2147483.647
295.062 2.294 ISI 0 0 0.000
297.356 2.047 V_LEFT 0 0 0.000
299.403 1.846 ISI 0 0 0.000
301.249 2.027 P_RIGHT 0 0 0.000
303.276 2.314 ISI 0 0 0.000
305.590 2.047 CONG_LEFT 0 0 0.000
307.637 2.381 ISI 0 0 0.000
310.018 1.692 RESPONSE_CONG_LEFT 1 0 2147483.647
311.710 2.314 ISI 0 0 0.000
314.024 2.047 CONG_RIGHT 0 0 0.000
316.071 2.180 ISI 0 0 0.000
318.251 2.028 REST 0 0 0.000
320.279 2.180 ISI 0 0 0.000
322.459 2.047 V_RIGHT 0 0 0.000
324.506 1.826 ISI 0 0 0.000
326.332 1.712 RESPONSE_V_RIGHT 1 0 2147483.647
328.044 1.893 ISI 0 0 0.000
329.937 2.047 INCONG_VR_PL 0 0 0.000
331.984 2.093 ISI 0 0 0.000
334.077 2.047 P_LEFT 0 0 0.000
336.124 2.248 ISI 0 0 0.000
338.372 2.047 INCONG_VL_PR 0 0 0.000
340.419 1.959 ISI 0 0 0.000
342.378 2.047 REST 0 0 0.000
344.425 2.381 ISI 0 0 0.000
346.806 1.360 BASE 0 0 0.000
178 changes: 178 additions & 0 deletions demos/transformers/models/model-VisuoTact_smdl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"Name": "demo transformers",
"BIDSModelVersion": "1.0.0",
"Description": "demo transformers",
"Input": {
"task": [
"VisuoTact"
],
"space": [
"IXI549Space"
]
},
"Nodes": [
{
"Level": "Run",
"Name": "run_level",
"GroupBy": [
"run",
"subject"
],
"Transformations": {
"Transformer": "bids-matlab_v0.1.0dev",
"Instructions": [
{
"Name": "Replace",
"Input": "trial_type",
"Replace": {
"key": "^RESPONSE.*",
"value": "RESPONSE"
},
"Attribute": "value"
},
{
"Name": "Filter",
"Input": "trial_type",
"Query": "trial_type==^.*LEFT$",
"Output": "tmp"
},
{
"Name": "LabelIdenticalRows",
"Cumulative": true,
"Input": [
"tmp"
],
"Output": [
"label"
]
},
{
"Name": "Concatenate",
"Input": [
"tmp",
"label"
],
"Output": [
"LEFT"
]
},
{
"Name": "Delete",
"Input": [
"tmp",
"label"
]
},
{
"Name": "Filter",
"Input": "trial_type",
"Query": "trial_type==^.*RIGHT$",
"Output": "tmp"
},
{
"Name": "LabelIdenticalRows",
"Cumulative": true,
"Input": [
"tmp"
],
"Output": [
"label"
]
},
{
"Name": "Concatenate",
"Input": [
"tmp",
"label"
],
"Output": [
"RIGHT"
]
},
{
"Name": "Delete",
"Input": [
"tmp",
"label"
]
},
{
"Name": "Filter",
"Input": "trial_type",
"Query": "trial_type==^INCONG.*$",
"Output": "tmp"
},
{
"Name": "LabelIdenticalRows",
"Cumulative": true,
"Input": [
"tmp"
],
"Output": [
"label"
]
},
{
"Name": "Concatenate",
"Input": [
"tmp",
"label"
],
"Output": [
"INCONG"
]
},
{
"Name": "Delete",
"Input": [
"tmp",
"label"
]
}
]
},
"Model": {
"X": [
"trial_type.REST",
"LEFT.P_LEFT_?",
"LEFT.V_LEFT_?",
"LEFT.CONG_LEFT_?",
"RIGHT.P_RIGHT_?",
"RIGHT.V_RIGHT_?",
"RIGHT.CONG_RIGHT_?",
"INCONG.INCONG*"
],
"HRF": {
"Variables": [
"trial_type.REST",
"LEFT.P_LEFT_?",
"LEFT.V_LEFT_?",
"LEFT.CONG_LEFT_?",
"RIGHT.P_RIGHT_?",
"RIGHT.V_RIGHT_?",
"RIGHT.CONG_RIGHT_?",
"INCONG.INCONG*"
],
"Model": "spm"
},
"Type": "glm",
"Options": {
"HighPassFilterCutoffHz": 0.0078,
"Mask": {
"suffix": [
"mask"
],
"desc": [
"brain"
]
}
},
"Software": {
"SPM": {
"SerialCorrelation": "AR(1)"
}
}
}
}
]
}
Loading