Skip to content

Commit

Permalink
display series and instances count
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Aug 28, 2024
1 parent 3285522 commit d4a0fa0
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Plugin/DefaultConfiguration.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
// - special columns:
// - "modalities": the list of modalities in the study
// - "seriesCount": the number of series in the study
// - "instancesCount": the number of instances in the study
// - "seriesAndInstancesCount": a combined value with the number of series/instances in the study
"StudyListColumns" : [
"PatientBirthDate",
"PatientName",
Expand All @@ -154,7 +156,7 @@
"StudyDate",
"modalities",
"AccessionNumber",
"seriesCount"
"seriesAndInstancesCount"
],

// The list of patient level tags that are displayed in the study details and in the modification dialog.
Expand Down
26 changes: 24 additions & 2 deletions WebApplication/src/components/StudyItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,22 @@ export default {
} else if (this.study.Series) {
return this.study.Series.length;
}
},
instancesCount() {
if (this.study.RequestedTags) {
return this.study.RequestedTags.NumberOfStudyRelatedInstances;
}
},
seriesAndInstancesCount() {
const seriesCount = this.seriesCount;
const instancesCount = this.instancesCount;
if (instancesCount) {
return String(seriesCount) + "/" + String(instancesCount);
} else {
return seriesCount;
}
}
},
components: { SeriesList, StudyDetails }
}
Expand All @@ -133,7 +148,7 @@ export default {
</div>
</td>
<td v-for="columnTag in uiOptions.StudyListColumns" :key="columnTag" class="cut-text"
:class="{ 'text-center': columnTag in ['modalities', 'seriesCount'] }" data-bs-toggle="collapse"
:class="{ 'text-center': columnTag in ['modalities', 'seriesCount', 'instancesCount', 'seriesAndInstancesCount'] }" data-bs-toggle="collapse"
v-bind:data-bs-target="'#study-details-' + this.studyId">
<span v-if="columnTag == 'StudyDate'" data-bs-toggle="tooltip"
v-bind:title="study.MainDicomTags.StudyDate">{{ formatedStudyDate }}
Expand All @@ -157,7 +172,14 @@ export default {
v-bind:title="modalitiesInStudyForDisplay">{{
modalitiesInStudyForDisplay }}
</span>
<span v-else-if="columnTag == 'seriesCount'">{{ seriesCount }}
<span v-else-if="columnTag == 'seriesCount'" data-bs-toggle="tooltip"
v-bind:title="seriesCount">{{ seriesCount }}
</span>
<span v-else-if="columnTag == 'instancesCount'" data-bs-toggle="tooltip"
v-bind:title="instancesCount">{{ instancesCount }}
</span>
<span v-else-if="columnTag == 'seriesAndInstancesCount'" data-bs-toggle="tooltip"
v-bind:title="seriesAndInstancesCount">{{ seriesAndInstancesCount }}
</span>
<span v-else>{{ study.MainDicomTags[columnTag] }}
</span>
Expand Down
20 changes: 15 additions & 5 deletions WebApplication/src/components/StudyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ document._studyColumns = {
"seriesCount": {
"width": "4%"
},
"instancesCount": {
"width": "4%"
},
"seriesAndInstancesCount": {
"width": "7%"
},
"undefined": {
"width": "10%"
}
Expand Down Expand Up @@ -160,7 +166,7 @@ export default {
// console.log("StudyList: Configuration has been loaded, updating study filter: ", this.$route.params.filters);
this.initModalityFilter();
for (const tag of this.uiOptions.StudyListColumns) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount'].indexOf(tag) == -1) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount', 'instancesCount', 'seriesAndInstancesCount'].indexOf(tag) == -1) {
this.filterGenericTags[tag] = '';
}
}
Expand Down Expand Up @@ -269,6 +275,10 @@ export default {
columnTitle(tagName) {
if (tagName == "seriesCount") {
return this.$i18n.t('series_count_header');
} else if (tagName == "instancesCount") {
return this.$i18n.t('instances_count_header');
} else if (tagName == "seriesAndInstancesCount") {
return this.$i18n.t('series_and_instances_count_header');
} else if (tagName == "modalities") {
return translateDicomTag(this.$i18n.t, this.$i18n.te, "ModalitiesInStudy");
} else {
Expand Down Expand Up @@ -391,7 +401,7 @@ export default {
return "";
},
hasFilter(tagName) {
return ['seriesCount'].indexOf(tagName) == -1;
return ['seriesCount', 'instancesCount', 'seriesAndInstancesCount'].indexOf(tagName) == -1;
},
getFilterPlaceholder(tagName) {
if (tagName in this.columns && this.columns[tagName].placeholder) {
Expand Down Expand Up @@ -502,7 +512,7 @@ export default {
this.filterPatientBirthDateForDatePicker = null;
this.filterGenericTags = {};
for (const tag of this.uiOptions.StudyListColumns) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount'].indexOf(tag) == -1) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount', 'instancesCount', 'seriesAndInstancesCount'].indexOf(tag) == -1) {
this.filterGenericTags[tag] = '';
}
}
Expand All @@ -512,7 +522,7 @@ export default {
isFilteringOnlyOnLabels() {
let hasGenericTagFilter = false;
for (const tag of this.uiOptions.StudyListColumns) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount'].indexOf(tag) == -1) {
if (['StudyDate', 'PatientBirthDate', 'modalities', 'seriesCount', 'instancesCount', 'seriesAndInstancesCount'].indexOf(tag) == -1) {
if (this.filterGenericTags[tag] && this.filterGenericTags[tag] != '') {
hasGenericTagFilter = true;
}
Expand All @@ -528,7 +538,7 @@ export default {
// update filters with the value of filter controls when we click the search button
await this.$store.dispatch('studies/clearFilterNoReload');
for (const tag of this.uiOptions.StudyListColumns) {
if (['modalities', 'seriesCount'].indexOf(tag) == -1) {
if (['modalities', 'seriesCount', 'instancesCount', 'seriesAndInstancesCount'].indexOf(tag) == -1) {
await this.$store.dispatch('studies/updateFilterNoReload', { dicomTagName: tag, value: this.getFilterValue(tag) });
}
}
Expand Down
2 changes: 2 additions & 0 deletions WebApplication/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"frames": "frames",
"instance": "Instance",
"instances": "Instances",
"instances_count_header": "# instances",
"instances_number": "Number of instances",
"labels": {
"add_button": "Add",
Expand Down Expand Up @@ -182,6 +183,7 @@
},
"series": "Series",
"series_count_header": "# series",
"series_and_instances_count_header": "# Ser/Inst",
"series_plural": "Series",
"settings": {
"allow_all_currents_and_futures_labels": "All current and future labels",
Expand Down
2 changes: 2 additions & 0 deletions WebApplication/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"frames": "Frames",
"instance": "Élément",
"instances": "Instances",
"instances_count_header": "# instances",
"instances_number": "Nombre d'instances",
"labels": {
"add_button": "Ajouter",
Expand Down Expand Up @@ -182,6 +183,7 @@
},
"series": "Série",
"series_count_header": "# séries",
"series_and_instances_count_header": "# Ser/Inst",
"series_plural": "Séries",
"settings": {
"allow_all_currents_and_futures_labels": "Toutes les étiquettes actuelles et futures",
Expand Down
6 changes: 2 additions & 4 deletions WebApplication/src/orthancApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export default {
"Level": "Study",
"Limit": store.state.configuration.uiOptions.MaxStudiesDisplayed,
"Query": filterQuery,
"RequestedTags": [
"ModalitiesInStudy"
],
"RequestedTags": store.state.configuration.requestedTagsForStudyList,
"Expand": true
};
if (labels && labels.length > 0) {
Expand Down Expand Up @@ -292,7 +290,7 @@ export default {
},
async getStudy(orthancId) {
// returns the same result as a findStudies (including RequestedTags !)
return (await axios.get(orthancApiUrl + "studies/" + orthancId + "?requestedTags=ModalitiesInStudy")).data;
return (await axios.get(orthancApiUrl + "studies/" + orthancId + "?requestedTags=" + store.state.configuration.requestedTagsForStudyList.join(';'))).data;
},
async getStudySeries(orthancId) {
return (await axios.get(orthancApiUrl + "studies/" + orthancId + "/series")).data;
Expand Down
11 changes: 11 additions & 0 deletions WebApplication/src/store/modules/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const state = () => ({
ohifDataSource: "dicom-web",
customLogoUrl: null,
hasCustomLogo: false,
requestedTagsForStudyList: []
})

///////////////////////////// GETTERS
Expand All @@ -29,6 +30,16 @@ const getters = {
const mutations = {
setUiOptions(state, { uiOptions }) {
state.uiOptions = uiOptions;

if (uiOptions.StudyListColumns.indexOf('modalities') != -1) {
state.requestedTagsForStudyList.push('ModalitiesInStudy')
}
if (uiOptions.StudyListColumns.indexOf('instancesCount') != -1 || uiOptions.StudyListColumns.indexOf('seriesAndInstancesCount') != -1) {
state.requestedTagsForStudyList.push('NumberOfStudyRelatedInstances')
}
if (uiOptions.StudyListColumns.indexOf('seriesCount') != -1 || uiOptions.StudyListColumns.indexOf('seriesAndInstancesCount') != -1) {
state.requestedTagsForStudyList.push('NumberOfStudyRelatedSeries')
}
},
setUserProfile(state, { profile }) {
state.userProfile = profile;
Expand Down
10 changes: 7 additions & 3 deletions WebApplication/src/store/modules/studies.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import api from "../../orthancApi"
import SourceType from "../../helpers/source-type";

import store from "../../store"

const _clearedFilter = {
StudyDate : "",
Expand Down Expand Up @@ -220,12 +220,16 @@ const actions = {
"PatientBirthDate": "",
"PatientID": "",
"AccessionNumber": "",
"ModalitiesInStudy": "",
"NumberOfStudyRelatedSeries": "",
"PatientBirthDate": "",
"StudyDescription": "",
"StudyDate": ""
};

// request values for e.g ModalitiesInStudy, NumberOfStudyRelatedSeries
for (let t of store.state.configuration.requestedTagsForStudyList) {
filters[t] = "";
}

// overwrite with the filtered values
for (const [k, v] of Object.entries(getters.filterQuery)) {
filters[k] = v;
Expand Down
7 changes: 6 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
Pending changes
===============

Changes:
- new configuration values for "UiOptions.StudyListColumns":
- "instancesCount" to show the number of instances in a study
- "seriesAndInstancesCount" to show the number of series/instances in a study. This now replaces "seriesCount" in the default configuration.

Fixes:
- Fixed the "UiOptions.EnableApiView" that was not taken into account. The API View button was always visible.
- Fixed the "UiOptions.EnableApiView" configuration that was not taken into account. The API View button was always visible.
- [Issue #65](https://github.com/orthanc-server/orthanc-explorer-2/issues/65) SeriesCount column is empty.
- [Issue #63](https://github.com/orthanc-server/orthanc-explorer-2/issues/63) This/last week selection in Date picker now starts on monday.

Expand Down

0 comments on commit d4a0fa0

Please sign in to comment.