Skip to content

Commit

Permalink
Merge pull request #9 from leej3/task_fix
Browse files Browse the repository at this point in the history
WIP Task fix
  • Loading branch information
Shotgunosine authored Dec 21, 2017
2 parents dee7dbf + 17feff4 commit 20d18f2
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 153 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RUN npm install -g bids-validator@0.24.0

COPY run.py /run.py
COPY . /code

RUN mkdir /work
COPY version /version
ENTRYPOINT ["/run.py"]

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ This App has the following command line arguments:
Optional: command string for afni proc. Parameters
that vary by subject should be encapsulated in curly
braces and must all be included {subj_id},
{out_dir}, {anat_path}, or {epi_paths}.The first
{out_dir}, {anat_path}, or {epi_paths}.-script option
is added automatically so don't add it to the command. The first
_T1w for each subject will currently be used as the
anat.All of the _bold will be used as the
functionals.Example:-subj_id {subj_id} -script
proc.bids -scr_overwrite -out_dir {out_dir} -blocks
functionals.Example:-subj_id {subj_id}
-scr_overwrite -out_dir {out_dir} -blocks
tshift align tlrc volreg blur mask scale -copy_anat
{anat_path} -tcat_remove_first_trs 0 -dsets
{epi_paths} -align_opts_aea -cost lpc+ZZ -giant_move
Expand Down
68 changes: 42 additions & 26 deletions reports/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
$("#nrtodo").text(counts.registration["-1"])
}

function qc_update(subj_id, stage, value) {
subjs[subj_id - 1][stage] = parseInt(value)
function qc_update(run_id, stage, value) {
subjs[run_id][stage] = parseInt(value)
updateCounts();
}

Expand Down Expand Up @@ -124,30 +124,46 @@ <h1>afni_proc.py: group report</h1>
{% for config in configs %}
<div class="subject mt-3 mb-3 pt-3 pb-3">
<script type="text/javascript">
var subj_qc = {id:{{ config['subj_id'] }}, motion:null, registration:null}
{% if config['session_label'] %}
var subj_qc = {id:{{ config['report_num'] }}, subject: "{{ config['subj_id'] }}", session: "{{ config['session_label'] }}", task:"{{ config['task_label'] }}", motion:null, registration:null}
{% else %}
var subj_qc = {id:{{ config['report_num'] }}, subject: "{{ config['subj_id'] }}", session: null, task:"{{ config['task_label'] }}", motion:null, registration:null}
{% endif %}
</script>

<h2>Subject {{ config['subj_id'] }} Summary</h2>
{% if config['session_label'] %}
<h2>Subject {{ config['subj_id'] }}, Session {{ config['session_label'] }}, {{ config['task_label'] }} Summary</h2>
{% else %}
<h2>Subject {{ config['subj_id'] }}, {{ config['task_label'] }} Summary</h2>
{% endif %}
<ul class="simple">
<li>Subject ID: {{ config['subj_id'] }}.</li>
{% if config['session_label'] %}
<li>Session: {{ config['session_label'] }}</li>
{% endif %}
<li>Task: {{ config['task_label'] }}</li>
<li>Number of runs: {{ config['num_runs'] }}</li>
<li>Blocks run: {{ config['blocks'] }}.</li>

{% if config['warnings'] %}
<li>Warnings:
<ul class="sub-simple">
{% for warn_name, warn_text in config['warnings'].items() %}
<li>{{ warn_name }}: {{ warn_text }}</li>
<li>{{ warn_name }}:
{% for line in warn_text %}
{{ line }}<br />
{% endfor %}
</li>
{% endfor %}
</ul>
</li>
{% endif %}
</ul>

{% if config['motion_report'] %}
<h3 class="muted">Subject {{ config['subj_id'] }} Motion Report</h3>
<h3 class="muted">Motion Report</h3>
<div class="radio">
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['subj_id'] }}, 'motion', this.value)"> Good </label>
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['subj_id'] }}, 'motion', this.value)"> Bad</label>
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['report_num'] }}, 'motion', this.value)"> Good </label>
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['report_num'] }}, 'motion', this.value)"> Bad</label>
</div>
<div class="embeded-report">
{{ config['motion_report'] }}
Expand All @@ -158,15 +174,15 @@ <h3 class="muted">Subject {{ config['subj_id'] }} Motion Report</h3>
{% endif %}

{% if config['volreg_report_anat'] %}
<h3>Subject {{ config['subj_id'] }} Registration</h3>
<h3>Registration</h3>
<div class="radio">
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['subj_id'] }}, 'registration', this.value)"> Good </label>
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['subj_id'] }}, 'registration', this.value)"> Bad</label>
<label><input type="radio" name="inlineRadio" id="inlineRating1" value="1" onclick="qc_update({{ config['report_num'] }}, 'registration', this.value)"> Good </label>
<label><input type="radio" name="inlineRadio" id="inlineRating0" value="0" onclick="qc_update({{ config['report_num'] }}, 'registration', this.value)"> Bad</label>
</div>
<div class="embeded-report">
<div>
<canvas id="3Dviewer_{{ config['subj_id'] }}", onclick="change_{{ config['subj_id'] }}();" resize>
<img id="spriteImg_{{ config['subj_id'] }}" class="hidden" src="data:image/jpeg;base64,{{ config['volreg_report_anat'] }}">
<canvas id="3Dviewer_{{ config['report_num'] }}", onclick="change_{{ config['report_num'] }}();" resize>
<img id="spriteImg_{{ config['report_num'] }}" class="hidden" src="data:image/jpeg;base64,{{ config['volreg_report_anat'] }}">
</div>
</div>
<script type="text/javascript">
Expand All @@ -182,29 +198,29 @@ <h3>Subject {{ config['subj_id'] }} Registration</h3>

<script type="text/javascript">

var image_tracker_{{ config['subj_id'] }} = 'anat';
var anat_src_{{ config['subj_id'] }} = null
var image_tracker_{{ config['report_num'] }} = 'anat';
var anat_src_{{ config['report_num'] }} = null

function change_{{ config['subj_id'] }}(){
var image = document.getElementById("spriteImg_{{ config['subj_id'] }}");
function change_{{ config['report_num'] }}(){
var image = document.getElementById("spriteImg_{{ config['report_num'] }}");

if(image_tracker_{{ config['subj_id'] }}=='anat'){
if(anat_src_{{ config['subj_id'] }}){
if(image_tracker_{{ config['report_num'] }}=='anat'){
if(anat_src_{{ config['report_num'] }}){
}else{
anat_src_{{ config['subj_id'] }}=image.src
anat_src_{{ config['report_num'] }}=image.src
}
image.src="data:image/jpeg;base64,{{ config['volreg_report_func'] }}";
image_tracker_{{ config['subj_id'] }}='func';
image_tracker_{{ config['report_num'] }}='func';
}else{
image.src=anat_src_{{ config['subj_id'] }};
image_tracker_{{ config['subj_id'] }}='anat';
image.src=anat_src_{{ config['report_num'] }};
image_tracker_{{ config['report_num'] }}='anat';
}
}

$( window ).load(function() {
var brain = brainsprite({
canvas: "3Dviewer_{{ config['subj_id'] }}",
sprite: "spriteImg_{{ config['subj_id'] }}",
canvas: "3Dviewer_{{ config['report_num'] }}",
sprite: "spriteImg_{{ config['report_num'] }}",
nbSlice: { 'Y':{{ config['anat_ap_ext'] }} , 'Z':{{ config['anat_is_ext'] }} }
});
});
Expand Down
17 changes: 13 additions & 4 deletions reports/individual.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,26 @@ <h1>afni_proc.py: individual report</h1>

<h2>Summary</h2>
<ul class="simple">
<li>Subject ID: {{ subj_id }}.</li>
<li>Subject ID: {{ subj_id }}</li>
{% if session_label %}
<li>Session: {{ session_label }}</li>
{% endif %}
<li>Task: {{ task_label }}</li>
<li>Number of runs: {{ num_runs }}</li>
<li>Blocks run: {{ blocks }}.</li>
<li>AP extent: {{ anat_ap_ext }}.</li>
<li>IS extent: {{ anat_is_ext }}.</li>
<li>AP extent: {{ anat_ap_ext }}</li>
<li>IS extent: {{ anat_is_ext }}</li>


{% if warnings %}
<li>Warnings:
<ul class="sub-simple">
{% for warn_name, warn_text in warnings.items() %}
<li>{{ warn_name }}: {{ warn_text }}</li>
<li>{{ warn_name }}:
{% for line in warn_text %}
{{ line }}<br />
{% endfor %}
</li>
{% endfor %}
</ul>
</li>
Expand Down
Loading

0 comments on commit 20d18f2

Please sign in to comment.