Skip to content

Commit 20d18f2

Browse files
authored
Merge pull request #9 from leej3/task_fix
WIP Task fix
2 parents dee7dbf + 17feff4 commit 20d18f2

File tree

5 files changed

+254
-153
lines changed

5 files changed

+254
-153
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ RUN npm install -g bids-validator@0.24.0
7575

7676
COPY run.py /run.py
7777
COPY . /code
78-
78+
RUN mkdir /work
7979
COPY version /version
8080
ENTRYPOINT ["/run.py"]
8181

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ This App has the following command line arguments:
6060
Optional: command string for afni proc. Parameters
6161
that vary by subject should be encapsulated in curly
6262
braces and must all be included {subj_id},
63-
{out_dir}, {anat_path}, or {epi_paths}.The first
63+
{out_dir}, {anat_path}, or {epi_paths}.-script option
64+
is added automatically so don't add it to the command. The first
6465
_T1w for each subject will currently be used as the
6566
anat.All of the _bold will be used as the
66-
functionals.Example:-subj_id {subj_id} -script
67-
proc.bids -scr_overwrite -out_dir {out_dir} -blocks
67+
functionals.Example:-subj_id {subj_id}
68+
-scr_overwrite -out_dir {out_dir} -blocks
6869
tshift align tlrc volreg blur mask scale -copy_anat
6970
{anat_path} -tcat_remove_first_trs 0 -dsets
7071
{epi_paths} -align_opts_aea -cost lpc+ZZ -giant_move

reports/group.html

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
$("#nrtodo").text(counts.registration["-1"])
5151
}
5252

53-
function qc_update(subj_id, stage, value) {
54-
subjs[subj_id - 1][stage] = parseInt(value)
53+
function qc_update(run_id, stage, value) {
54+
subjs[run_id][stage] = parseInt(value)
5555
updateCounts();
5656
}
5757

@@ -124,30 +124,46 @@ <h1>afni_proc.py: group report</h1>
124124
{% for config in configs %}
125125
<div class="subject mt-3 mb-3 pt-3 pb-3">
126126
<script type="text/javascript">
127-
var subj_qc = {id:{{ config['subj_id'] }}, motion:null, registration:null}
127+
{% if config['session_label'] %}
128+
var subj_qc = {id:{{ config['report_num'] }}, subject: "{{ config['subj_id'] }}", session: "{{ config['session_label'] }}", task:"{{ config['task_label'] }}", motion:null, registration:null}
129+
{% else %}
130+
var subj_qc = {id:{{ config['report_num'] }}, subject: "{{ config['subj_id'] }}", session: null, task:"{{ config['task_label'] }}", motion:null, registration:null}
131+
{% endif %}
128132
</script>
129-
130-
<h2>Subject {{ config['subj_id'] }} Summary</h2>
133+
{% if config['session_label'] %}
134+
<h2>Subject {{ config['subj_id'] }}, Session {{ config['session_label'] }}, {{ config['task_label'] }} Summary</h2>
135+
{% else %}
136+
<h2>Subject {{ config['subj_id'] }}, {{ config['task_label'] }} Summary</h2>
137+
{% endif %}
131138
<ul class="simple">
132139
<li>Subject ID: {{ config['subj_id'] }}.</li>
140+
{% if config['session_label'] %}
141+
<li>Session: {{ config['session_label'] }}</li>
142+
{% endif %}
143+
<li>Task: {{ config['task_label'] }}</li>
144+
<li>Number of runs: {{ config['num_runs'] }}</li>
133145
<li>Blocks run: {{ config['blocks'] }}.</li>
134146

135147
{% if config['warnings'] %}
136148
<li>Warnings:
137149
<ul class="sub-simple">
138150
{% for warn_name, warn_text in config['warnings'].items() %}
139-
<li>{{ warn_name }}: {{ warn_text }}</li>
151+
<li>{{ warn_name }}:
152+
{% for line in warn_text %}
153+
{{ line }}<br />
154+
{% endfor %}
155+
</li>
140156
{% endfor %}
141157
</ul>
142158
</li>
143159
{% endif %}
144160
</ul>
145161

146162
{% if config['motion_report'] %}
147-
<h3 class="muted">Subject {{ config['subj_id'] }} Motion Report</h3>
163+
<h3 class="muted">Motion Report</h3>
148164
<div class="radio">
149-
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['subj_id'] }}, 'motion', this.value)"> Good </label>
150-
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['subj_id'] }}, 'motion', this.value)"> Bad</label>
165+
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['report_num'] }}, 'motion', this.value)"> Good </label>
166+
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['report_num'] }}, 'motion', this.value)"> Bad</label>
151167
</div>
152168
<div class="embeded-report">
153169
{{ config['motion_report'] }}
@@ -158,15 +174,15 @@ <h3 class="muted">Subject {{ config['subj_id'] }} Motion Report</h3>
158174
{% endif %}
159175

160176
{% if config['volreg_report_anat'] %}
161-
<h3>Subject {{ config['subj_id'] }} Registration</h3>
177+
<h3>Registration</h3>
162178
<div class="radio">
163-
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['subj_id'] }}, 'registration', this.value)"> Good </label>
164-
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['subj_id'] }}, 'registration', this.value)"> Bad</label>
179+
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['report_num'] }}, 'registration', this.value)"> Good </label>
180+
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['report_num'] }}, 'registration', this.value)"> Bad</label>
165181
</div>
166182
<div class="embeded-report">
167183
<div>
168-
<canvas id="3Dviewer_{{ config['subj_id'] }}", onclick="change_{{ config['subj_id'] }}();" resize>
169-
<img id="spriteImg_{{ config['subj_id'] }}" class="hidden" src="data:image/jpeg;base64,{{ config['volreg_report_anat'] }}">
184+
<canvas id="3Dviewer_{{ config['report_num'] }}", onclick="change_{{ config['report_num'] }}();" resize>
185+
<img id="spriteImg_{{ config['report_num'] }}" class="hidden" src="data:image/jpeg;base64,{{ config['volreg_report_anat'] }}">
170186
</div>
171187
</div>
172188
<script type="text/javascript">
@@ -182,29 +198,29 @@ <h3>Subject {{ config['subj_id'] }} Registration</h3>
182198

183199
<script type="text/javascript">
184200

185-
var image_tracker_{{ config['subj_id'] }} = 'anat';
186-
var anat_src_{{ config['subj_id'] }} = null
201+
var image_tracker_{{ config['report_num'] }} = 'anat';
202+
var anat_src_{{ config['report_num'] }} = null
187203

188-
function change_{{ config['subj_id'] }}(){
189-
var image = document.getElementById("spriteImg_{{ config['subj_id'] }}");
204+
function change_{{ config['report_num'] }}(){
205+
var image = document.getElementById("spriteImg_{{ config['report_num'] }}");
190206

191-
if(image_tracker_{{ config['subj_id'] }}=='anat'){
192-
if(anat_src_{{ config['subj_id'] }}){
207+
if(image_tracker_{{ config['report_num'] }}=='anat'){
208+
if(anat_src_{{ config['report_num'] }}){
193209
}else{
194-
anat_src_{{ config['subj_id'] }}=image.src
210+
anat_src_{{ config['report_num'] }}=image.src
195211
}
196212
image.src="data:image/jpeg;base64,{{ config['volreg_report_func'] }}";
197-
image_tracker_{{ config['subj_id'] }}='func';
213+
image_tracker_{{ config['report_num'] }}='func';
198214
}else{
199-
image.src=anat_src_{{ config['subj_id'] }};
200-
image_tracker_{{ config['subj_id'] }}='anat';
215+
image.src=anat_src_{{ config['report_num'] }};
216+
image_tracker_{{ config['report_num'] }}='anat';
201217
}
202218
}
203219

204220
$( window ).load(function() {
205221
var brain = brainsprite({
206-
canvas: "3Dviewer_{{ config['subj_id'] }}",
207-
sprite: "spriteImg_{{ config['subj_id'] }}",
222+
canvas: "3Dviewer_{{ config['report_num'] }}",
223+
sprite: "spriteImg_{{ config['report_num'] }}",
208224
nbSlice: { 'Y':{{ config['anat_ap_ext'] }} , 'Z':{{ config['anat_is_ext'] }} }
209225
});
210226
});

reports/individual.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,26 @@ <h1>afni_proc.py: individual report</h1>
104104

105105
<h2>Summary</h2>
106106
<ul class="simple">
107-
<li>Subject ID: {{ subj_id }}.</li>
107+
<li>Subject ID: {{ subj_id }}</li>
108+
{% if session_label %}
109+
<li>Session: {{ session_label }}</li>
110+
{% endif %}
111+
<li>Task: {{ task_label }}</li>
112+
<li>Number of runs: {{ num_runs }}</li>
108113
<li>Blocks run: {{ blocks }}.</li>
109-
<li>AP extent: {{ anat_ap_ext }}.</li>
110-
<li>IS extent: {{ anat_is_ext }}.</li>
114+
<li>AP extent: {{ anat_ap_ext }}</li>
115+
<li>IS extent: {{ anat_is_ext }}</li>
111116

112117

113118
{% if warnings %}
114119
<li>Warnings:
115120
<ul class="sub-simple">
116121
{% for warn_name, warn_text in warnings.items() %}
117-
<li>{{ warn_name }}: {{ warn_text }}</li>
122+
<li>{{ warn_name }}:
123+
{% for line in warn_text %}
124+
{{ line }}<br />
125+
{% endfor %}
126+
</li>
118127
{% endfor %}
119128
</ul>
120129
</li>

0 commit comments

Comments
 (0)