Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 418203a

Browse files
committed
enh: added a URL input and changed to a new compontent for the report
1 parent 1a04c76 commit 418203a

File tree

7 files changed

+213
-108
lines changed

7 files changed

+213
-108
lines changed

preafqViewer/package-lock.json

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

preafqViewer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"build": "node build/build.js"
1515
},
1616
"dependencies": {
17+
"axios": "^0.18.0",
1718
"bootstrap-vue": "^2.0.0-rc.11",
1819
"d3": "^5.7.0",
1920
"vue": "^2.5.2",

preafqViewer/src/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
</template>
66

77
<script>
8-
import Vue from 'vue'
9-
import BootstrapVue from 'bootstrap-vue'
10-
import 'bootstrap/dist/css/bootstrap.css'
11-
import 'bootstrap-vue/dist/bootstrap-vue.css'
8+
import Vue from 'vue';
9+
import BootstrapVue from 'bootstrap-vue';
10+
import 'bootstrap/dist/css/bootstrap.css';
11+
import 'bootstrap-vue/dist/bootstrap-vue.css';
1212
1313
Vue.use(BootstrapVue);
1414

preafqViewer/src/components/HelloWorld.vue

Lines changed: 17 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,119 +6,34 @@
66
<b-form-file class="mt-3" v-model="file"
77
:state="Boolean(file)" placeholder="Choose a file...">
88
</b-form-file>
9-
<div v-if="report.b0" class="mt-3">
10-
<h2 class="mt-3 pt-3">Corrected dwi</h2>
11-
<p class="lead">Result of eddy</p>
12-
<vue-slider ref="timeSlider" v-model="time"
13-
:min="0" :max="report.dwi_corrected[0].num_slices-1">
14-
</vue-slider>
15-
<sprite4d v-for="view in report.dwi_corrected"
16-
:key="view.orientation"
17-
:M="view.M"
18-
:N="view.N"
19-
:img="view.img"
20-
:num_slices="view.num_slices"
21-
:pix="view.pix"
22-
:id="view.orientation"
23-
:time="time"
24-
:overlayMode="false"
25-
opacity="1"
26-
>
27-
</sprite4d>
289

29-
<h2 class="mt-3 pt-3">Eddy Report</h2>
30-
<p class="lead"> <b-btn v-b-toggle.collapse1 variant="primary">
31-
Outliers ({{report.eddy_report.length}})</b-btn> </p>
32-
<b-collapse id="collapse1" class="mt-2">
33-
<b-card>
10+
<p class="lead mt-3">OR copy/paste a URL</p>
11+
<b-input-group size="md" class="mb-3" prepend="URL">
12+
<b-form-input v-model="url" />
13+
<b-input-group-append>
14+
<b-btn size="md" text="Button"
15+
variant="primary"
16+
@click="navigate">Go</b-btn>
17+
</b-input-group-append>
18+
</b-input-group>
3419

35-
<p v-for="e in report.eddy_report" :key="e">{{e}}</p>
36-
37-
</b-card>
38-
</b-collapse>
39-
40-
<div style="height: 200px; width: 100%; display: inline-flex;">
41-
<line-chart id="motion_params"
42-
:data="report.eddy_params"
43-
xlabel="TR"
44-
ylabel="RMS"
45-
:highlightIdx="time"
46-
>
47-
</line-chart>
48-
</div>
49-
50-
<h2 class="mt-3 pt-3">Registration + Brain Mask</h2>
51-
<p class="lead">Brain mask computed on T1w, and mapped to B0</p>
52-
53-
<sprite4d
54-
:key="'bmask'+2"
55-
:M="report.b0.M"
56-
:N="report.b0.N"
57-
:num_slices="report.b0.num_slices"
58-
id="b0_mask"
59-
:pix="report.b0.pix"
60-
:time="spriteSlice"
61-
:img="report.b0.img"
62-
opacity="1"
63-
></sprite4d>
64-
<sprite4d
65-
:key="'anat_mask'+1"
66-
:M="report.anat_mask.M"
67-
:N="report.anat_mask.N"
68-
:num_slices="report.anat_mask.num_slices"
69-
id="anat_mask"
70-
:pix="report.anat_mask.pix"
71-
:time="spriteSlice"
72-
:img="report.anat_mask.img"
73-
:overlayMode="true"
74-
opacity="1"
75-
></sprite4d>
76-
<vue-slider ref="timeSlider"
77-
v-model="spriteSlice" :min="0"
78-
:max="report.b0.num_slices-1"></vue-slider>
79-
80-
<h2 class="mt-3 pt-3">DTI: ColorFA</h2>
81-
<p class="lead">Color FA mapped on B0</p>
82-
83-
<sprite4d
84-
key="bmask1"
85-
:M="report.b0.M"
86-
:N="report.b0.N"
87-
:num_slices="report.b0.num_slices"
88-
id="b0_mask"
89-
:pix="report.b0.pix"
90-
:time="spriteSlice"
91-
:img="report.b0.img"
92-
opacity="1"
93-
></sprite4d>
94-
<sprite4d
95-
key="colorfa_mask"
96-
:M="report.colorFA.M"
97-
:N="report.colorFA.N"
98-
:num_slices="report.colorFA.num_slices"
99-
id="colorfa_mask"
100-
:pix="report.colorFA.pix"
101-
:time="spriteSlice"
102-
:img="report.colorFA.img"
103-
:overlayMode="true"
104-
opacity="0.5"
105-
></sprite4d>
106-
107-
</div>
20+
<report v-if="report.b0" :report="report"></report>
10821
</b-container>
10922
</template>
11023

11124
<script>
11225
import vueSlider from 'vue-slider-component';
11326
import sprite4d from './Sprite4D';
11427
import lineChart from './LineChart';
28+
import report from './Report';
11529
11630
export default {
11731
name: 'HelloWorld',
11832
components: {
11933
sprite4d,
12034
vueSlider,
12135
lineChart,
36+
report,
12237
},
12338
data() {
12439
return {
@@ -127,12 +42,17 @@ export default {
12742
report: {},
12843
time: 0,
12944
spriteSlice: 0,
45+
url: null,
13046
};
13147
},
13248
methods: {
13349
get_mid_slice() {
13450
return Math.floor(this.report.b0.num_slices / 2);
13551
},
52+
navigate() {
53+
console.log(this.url);
54+
this.$router.push({ path: '/report', query: { url: this.url } });
55+
},
13656
},
13757
watch: {
13858
file() {

preafqViewer/src/components/LineChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default {
100100
d3.select(`#${this.id} .dot-series-2`)
101101
.attr('r', 7)
102102
.attr('cx', () => self.x(self.highlightIdx))
103-
.attr('cy', () => self.y(self.data[self.highlightIdx][0]))
103+
.attr('cy', () => self.y(self.data[self.highlightIdx][1]))
104104
.attr('fill', 'red');
105105
},
106106
plotData() {

0 commit comments

Comments
 (0)