Skip to content

Commit

Permalink
Merge pull request #217 from OpenImaging/image-to-frame
Browse files Browse the repository at this point in the history
Rename Image as Frame
  • Loading branch information
annehaley authored Nov 8, 2021
2 parents 50eacf0 + 9bb6de1 commit ed9cd4e
Show file tree
Hide file tree
Showing 29 changed files with 320 additions and 277 deletions.
22 changes: 11 additions & 11 deletions client/src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UserAvatar from './UserAvatar.vue';
import ScanDecision from './ScanDecision.vue';
export default {
name: 'Dataset',
name: 'Frame',
components: {
EvaluationResults,
UserAvatar,
Expand All @@ -31,10 +31,10 @@ export default {
]),
...mapGetters([
'currentViewData',
'nextDataset',
'getDataset',
'previousDataset',
'currentDataset',
'nextFrame',
'getFrame',
'previousFrame',
'currentFrame',
]),
...mapMutations([
'updateExperiment',
Expand All @@ -52,7 +52,7 @@ export default {
return this.currentViewData.lockOwner;
},
representation() {
return this.currentDataset && this.proxyManager.getRepresentations()[0];
return this.currentFrame && this.proxyManager.getRepresentations()[0];
},
winMin() {
return this.representation.getPropertyDomainByName('windowWidth').min;
Expand Down Expand Up @@ -90,7 +90,7 @@ export default {
this.representation.setWindowLevel(value);
}
},
currentDataset() {
currentFrame() {
this.updateWinLev();
},
experimentId(newValue, oldValue) {
Expand Down Expand Up @@ -151,11 +151,11 @@ export default {
updateImage() {
if (this.direction === 'back') {
this.$router
.push(this.previousDataset ? this.previousDataset : '')
.push(this.previousFrame ? this.previousFrame : '')
.catch(this.handleNavigationError);
} else if (this.direction === 'forward') {
this.$router
.push(this.nextDataset ? this.nextDataset : '')
.push(this.nextFrame ? this.nextFrame : '')
.catch(this.handleNavigationError);
} else if (this.direction === 'previous') {
this.$router
Expand Down Expand Up @@ -383,7 +383,7 @@ export default {
style="text-align: right"
>
<v-btn
:disabled="!previousDataset"
:disabled="!previousFrame"
@mousedown="handleKeyPress('back')"
small
depressed
Expand All @@ -392,7 +392,7 @@ export default {
<v-icon>fa-caret-left</v-icon>
</v-btn>
<v-btn
:disabled="!nextDataset"
:disabled="!nextFrame"
@mousedown="handleKeyPress('forward')"
small
depressed
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/EmailDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export default defineComponent({
},
setup() {
const screenshots = computed(() => store.state.screenshots);
const currentDataset = computed(() => store.getters.currentDataset);
const currentFrame = computed(() => store.getters.currentFrame);
const currentScan = computed(() => store.getters.currentScan);
const { removeScreenshot } = store.commit;
const user = inject('user') as User;
return {
screenshots,
currentDataset,
currentFrame,
currentScan,
removeScreenshot,
user,
Expand Down Expand Up @@ -59,7 +59,7 @@ export default defineComponent({
this.initialize();
}
},
currentDataset(value) {
currentFrame(value) {
if (value) {
this.initialize();
}
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/ExperimentsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default {
'experimentScans',
'loadingExperiment',
'scans',
'scanDatasets',
'datasets',
'scanFrames',
'frames',
]),
...mapGetters(['currentScan', 'currentExperiment']),
orderedExperiments() {
Expand All @@ -53,8 +53,8 @@ export default {
};
});
},
getIdOfFirstDatasetInScan(scanId) {
return `${this.scanDatasets[scanId][0]}`;
getIdOfFirstFrameInScan(scanId) {
return `${this.scanFrames[scanId][0]}`;
},
decisionToRating(decisions) {
if (decisions.length === 0) return {};
Expand Down Expand Up @@ -125,7 +125,7 @@ export default {
class="body-1"
>
<v-btn
:to="getIdOfFirstDatasetInScan(scan.id)"
:to="getIdOfFirstFrameInScan(scan.id)"
class="ml-0 px-1 scan-name"
href
text
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/KeyboardShortcutDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default defineComponent({
},
data: () => ({
shortcuts: [
['Next dataset', [['']]],
['Previous dataset', [['']]],
['Next frame', [['']]],
['Previous frame', [['']]],
[
'Change slices',
[
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({
KeyboardShortcutDialog,
},
props: {
datasetView: {
frameView: {
type: Boolean,
default: false,
},
Expand All @@ -40,7 +40,7 @@ export default defineComponent({
'screenshots',
]),
...mapGetters([
'currentDataset',
'currentFrame',
]),
notes() {
if (this.currentScan) {
Expand Down Expand Up @@ -87,7 +87,7 @@ export default defineComponent({
</v-tabs>
<v-spacer />

<div v-if="datasetView">
<div v-if="frameView">
<v-btn
@click="keyboardShortcutDialog = true"
icon
Expand All @@ -96,7 +96,7 @@ export default defineComponent({
<v-icon>keyboard</v-icon>
</v-btn>
<v-btn
:disabled="!currentDataset"
:disabled="!currentFrame"
@click="emailDialog = true"
icon
class="mr-4"
Expand Down
16 changes: 8 additions & 8 deletions client/src/components/VtkViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Vue from 'vue';
import { mapState, mapGetters, mapMutations } from 'vuex';
import { cleanDatasetName } from '@/utils/helper';
import { cleanFrameName } from '@/utils/helper';
import fill2DView from '../utils/fill2DView';
import { getView } from '../vtk/viewManager';
Expand All @@ -23,12 +23,12 @@ export default {
screenshotContainer: document.createElement('div'),
}),
computed: {
...mapState(['proxyManager', 'loadingDataset', 'xSlice', 'ySlice', 'zSlice', 'iIndexSlice', 'jIndexSlice', 'kIndexSlice']),
...mapGetters(['currentDataset', 'currentScan']),
...mapState(['proxyManager', 'loadingFrame', 'xSlice', 'ySlice', 'zSlice', 'iIndexSlice', 'jIndexSlice', 'kIndexSlice']),
...mapGetters(['currentFrame', 'currentScan']),
representation() {
return (
// force add dependency on currentDataset
this.currentDataset
// force add dependency on currentFrame
this.currentFrame
&& this.proxyManager.getRepresentation(null, this.view)
);
},
Expand Down Expand Up @@ -94,7 +94,7 @@ export default {
this.initializeSlice();
this.initializeView();
},
currentDataset() {
currentFrame() {
this.representation.setSlice(this.slice);
},
currentScan() {
Expand Down Expand Up @@ -139,7 +139,7 @@ export default {
fill2DView(this.view);
if (this.name !== 'default') {
this.modifiedSubscription = this.representation.onModified(() => {
if (!this.loadingDataset) {
if (!this.loadingFrame) {
this.slice = this.representation.getSlice();
}
});
Expand Down Expand Up @@ -173,7 +173,7 @@ export default {
this.setCurrentScreenshot({
name: `${this.currentScan.experiment}/${
this.currentScan.name
}/${cleanDatasetName(this.currentDataset.name)}/${this.displayName}`,
}/${cleanFrameName(this.currentFrame.name)}/${this.displayName}`,
dataURL,
});
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/django.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const djangoClient = {
const { data } = await apiClient.post('/scan-decisions', { scan: scanId, decision, note: comment });
return data;
},
async images(scanId: string) {
const { data } = await apiClient.get('/images', {
async frames(scanId: string) {
const { data } = await apiClient.get('/frames', {
params: { scan: scanId },
});
const { results } = data;
Expand Down
8 changes: 4 additions & 4 deletions client/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vue from 'vue';
import Router from 'vue-router';

import Projects from './views/Projects.vue';
import Dataset from './views/Dataset.vue';
import Frame from './views/Frame.vue';
import Login from './views/Login.vue';

Vue.use(Router);
Expand All @@ -21,9 +21,9 @@ export default new Router({
},
// Order matters
{
path: '/:datasetId?',
name: 'dataset',
component: Dataset,
path: '/:frameId?',
name: 'frame',
component: Frame,
},
{
path: '*',
Expand Down
Loading

0 comments on commit ed9cd4e

Please sign in to comment.