diff --git a/src/atlasViewer/atlasViewer.component.ts b/src/atlasViewer/atlasViewer.component.ts index f2dac903f512b6be381c220af79f39029407cc6f..825e873c8d3a91f398f0ccf020de984e0e15dd8a 100644 --- a/src/atlasViewer/atlasViewer.component.ts +++ b/src/atlasViewer/atlasViewer.component.ts @@ -94,6 +94,7 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { public sidePanelOpen$: Observable<boolean> + dismissToastHandler: any get toggleMessage(){ return this.constantsService.toggleMessage @@ -227,19 +228,16 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { this.subscriptions.push( this.selectedParcellation$.subscribe(parcellation => { this.selectedParcellation = parcellation - this.niiFileSize = 0 - - if ((this.selectedParcellation['properties'] && (this.selectedParcellation['properties']['publications'] || this.selectedParcellation['properties']['description'])) || (this.selectedTemplate['properties'] && (this.selectedTemplate['properties']['publications'] || this.selectedTemplate['properties']['description']))) { - if (this.handleToast) { - this.handleToast() - this.handleToast = null + if (this.dismissToastHandler) { + this.dismissToastHandler() + this.dismissToastHandler = null } - this.handleToast = this.toastService.showToast(this.publications, { + this.dismissToastHandler = this.toastService.showToast(this.publications, { timeout: 7000 }) } diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html index 045fe85dfe3b204a3a2f70ac37bacf1013a54682..8c1054a713c72dfeac5ea24010bbb0cfe3751d3b 100644 --- a/src/atlasViewer/atlasViewer.template.html +++ b/src/atlasViewer/atlasViewer.template.html @@ -260,13 +260,15 @@ </ng-template> <ng-template #publications > - <reference-toast-component + <reference-toast-component *ngIf="selectedTemplate['properties'] || selectedParcellation['properties']" [templateName] = "selectedTemplate['name']? selectedTemplate['name'] : null" [parcellationName] = "selectedParcellation['name']? selectedParcellation['name'] : null" [templateDescription] = "selectedTemplate['properties'] && selectedTemplate['properties']['description']? selectedTemplate['properties']['description'] : null" [parcellationDescription] = "selectedParcellation['properties'] && selectedParcellation['properties']['description']? selectedParcellation['properties']['description'] : null" [templatePublications] = "selectedTemplate['properties'] && selectedTemplate['properties']['publications']? selectedTemplate['properties']['publications']: null" [parcellationPublications] = "selectedParcellation['properties'] && selectedParcellation['properties']['publications']? selectedParcellation['properties']['publications']: null" - [parcellationNifti] = "selectedParcellation['properties'] && selectedParcellation['properties']['nifti']? selectedParcellation['properties']['nifti'] : null"> + [parcellationNifti] = "selectedParcellation['properties'] && selectedParcellation['properties']['nifti']? selectedParcellation['properties']['nifti'] : null" + [templateExternalLink] ="selectedTemplate['properties'] && selectedTemplate['properties']['externalLink']? selectedTemplate['properties']['externalLink']: null" + [parcellationExternalLink] ="selectedParcellation['properties'] && selectedParcellation['properties']['externalLink']? selectedParcellation['properties']['externalLink']: null"> </reference-toast-component> </ng-template> \ No newline at end of file diff --git a/src/components/dropdown/dropdown.style.css b/src/components/dropdown/dropdown.style.css index 4391abae2dda2103486cc847912b72b533b40adb..99359c8ababa48549e10cad178d963e83a9695df 100644 --- a/src/components/dropdown/dropdown.style.css +++ b/src/components/dropdown/dropdown.style.css @@ -58,11 +58,11 @@ radio-list } -.dropdownTitle { +:host-context([isMobile="true"]) .dropdownTitle { border: 1px solid !important; } -.dropdownTitleOpen { +:host-context([isMobile="true"]) .dropdownTitleOpen { border: solid !important; border-width: 1px 1px 0 1px !important; } diff --git a/src/res/ext/MNI152.json b/src/res/ext/MNI152.json index 657e54448a563c3824f615d880f980a6abeac658..e5c969b7c28415349d990266c82a4f00d5d36acf 100644 --- a/src/res/ext/MNI152.json +++ b/src/res/ext/MNI152.json @@ -13,7 +13,8 @@ "version": "1.0", "description": "not yet", "publications": [], - "nifti": [{"file": "jubrain-max-pmap-v22c_space-mnicolin27.nii", "size": "4400000"}] + "nifti": [{"file": "jubrain-max-pmap-v22c_space-mnicolin27.nii", "size": "4400000"}], + "externalLink": "https://doi.org/10.25493/8EGG-ZAR" }, "regions": [ { @@ -5686,6 +5687,9 @@ "surfaceParcellation": true, "ngData": null, "name": "Fibre Bundle Atlas - Long Bundle", + "properties": { + "externalLink": "https://doi.org/10.25493/V5BH-P7P" + }, "regions": [ { "name": "Arcuate - Left", @@ -6918,4 +6922,4 @@ "name": "MNI 152", "description": "An unbiased non-linear average of multiple subjects from the MNI152 database, which provides high-spatial resolution and signal-to-noise while not being biased towards a single brain (Fonov et al., 2011). This template space is widely used as a reference space in neuroimaging. HBP provides the JuBrain probabilistic cytoarchitectonic atlas (Amunts/Zilles, 2015) as well as a probabilistic atlas of large fibre bundles (Guevara, Mangin et al., 2017) in this space." } -} \ No newline at end of file +} diff --git a/src/res/ext/colin.json b/src/res/ext/colin.json index 4e6e3f948e7408a2bad396a3f971f842c2812b67..985ebb575ae1051fd9cc06ab67e3339ac4ebf392 100644 --- a/src/res/ext/colin.json +++ b/src/res/ext/colin.json @@ -13,7 +13,8 @@ "version": "1.0", "description": "not yet", "publications": [], - "nifti": [{"file": "jubrain-max-pmap-v22c_space-mnicolin27.nii", "size": "4400000"}] + "nifti": [{"file": "jubrain-max-pmap-v22c_space-mnicolin27.nii", "size": "4400000"}], + "externalLink": "https://doi.org/10.25493/8EGG-ZAR" }, "regions": [ { @@ -5685,4 +5686,4 @@ "name": "MNI Colin 27", "description": "A stereotaxic average of 27 T1-weighted MRI scans of the same individual. (Holmes et al., 1998), mapped to fit the MNI305 space. Although not capturing brain variability, it is well established in neuroscience due to its high definition. HBP provides the JuBrain probabilistic cytoarchitectonic atlas (Amunts et al.) in this space." } -} \ No newline at end of file +} diff --git a/src/ui/referenceToast/referenceToast.component.ts b/src/ui/referenceToast/referenceToast.component.ts index 9b68e7dcd4d449704f96147a42e4341ef3d1d410..6ac6485407b43d7a7ce3416868b95731b2c5e06b 100644 --- a/src/ui/referenceToast/referenceToast.component.ts +++ b/src/ui/referenceToast/referenceToast.component.ts @@ -16,6 +16,8 @@ export class ReferenceToastComponent implements OnInit{ @Input() templatePublications? : any @Input() parcellationPublications? : any @Input() parcellationNifti? : any + @Input() templateExternalLink? : any + @Input() parcellationExternalLink? : any downloadingProcess = false niiFileSize = 0 diff --git a/src/ui/referenceToast/referenceToast.template.html b/src/ui/referenceToast/referenceToast.template.html index 7db995f2b15468c795a0b31d404475a16fa8ee0a..b35297ee1517389bd753fa41005dd75ac627d449 100644 --- a/src/ui/referenceToast/referenceToast.template.html +++ b/src/ui/referenceToast/referenceToast.template.html @@ -8,6 +8,9 @@ <div *ngFor="let tp of templatePublications" class="text-justify"> <a [href]="tp['doi']" target="_blank">{{tp['citation']}}</a> </div> + <div class="d-flex justify-content-end"> + <a class="align-self-end" *ngIf="templateExternalLink" href="{{templateExternalLink}}" target="_blank"><button mat-raised-button color="primary" class="downloadPublications">Explore <i class="fas fa-external-link-alt"></i></button></a> + </div> <hr *ngIf="parcellationPublications"> </div> <div *ngIf="parcellationDescription"> @@ -23,7 +26,7 @@ </div> <div class="align-self-end"> - <button mat-raised-button color="primary" class="downloadPublications" (click)="downloadPublications()">Explore <i class="fas fa-external-link-alt"></i></button> + <a *ngIf="parcellationExternalLink" href="{{parcellationExternalLink}}" target="_blank"><button mat-raised-button color="primary" class="downloadPublications">Explore <i class="fas fa-external-link-alt"></i></button></a> <button mat-raised-button color="primary" class="downloadPublications" (click)="downloadPublications()" [disabled] = "downloadingProcess" > Download <span *ngIf="niiFileSize > 0">(.nii {{niiFileSize/1000000 | number:'.1-2'}} Mb) </span> diff --git a/src/ui/signinBanner/signinBanner.template.html b/src/ui/signinBanner/signinBanner.template.html index d5991ef576160478525ef34583ca6ef697dae914..a0f0c16be66195c163ae89b3f2c7bc2d9320e1c9 100644 --- a/src/ui/signinBanner/signinBanner.template.html +++ b/src/ui/signinBanner/signinBanner.template.html @@ -82,7 +82,8 @@ <reference-toast-component *ngIf="loadedTemplates[chosenTemplateIndex]['properties'] && (loadedTemplates[chosenTemplateIndex]['properties']['description'] || loadedTemplates[chosenTemplateIndex]['properties']['publications'])" [templateName] = "loadedTemplates[chosenTemplateIndex]['name'] ? loadedTemplates[chosenTemplateIndex]['name'] : null" [templateDescription] = "loadedTemplates[chosenTemplateIndex]['properties']['description']? loadedTemplates[chosenTemplateIndex]['properties']['description'] : null" - [templatePublications] = "loadedTemplates[chosenTemplateIndex]['properties']['publications']? loadedTemplates[chosenTemplateIndex]['properties']['publications']: null"> + [templatePublications] = "loadedTemplates[chosenTemplateIndex]['properties']['publications']? loadedTemplates[chosenTemplateIndex]['properties']['publications']: null" + [templateExternalLink] ="loadedTemplates[chosenTemplateIndex]['properties']['externalLink']? loadedTemplates[chosenTemplateIndex]['properties']['externalLink']: null"> </reference-toast-component> </div> <ng-template #parcellationToast> @@ -92,7 +93,8 @@ [parcellationName] = "selectedTemplate.parcellations[chosenParcellationIndex]['name']? selectedTemplate.parcellations[chosenParcellationIndex]['name'] : null" [parcellationDescription] = "selectedTemplate.parcellations[chosenParcellationIndex]['properties']['description']? selectedTemplate.parcellations[chosenParcellationIndex]['properties']['description'] : null" [parcellationPublications] = "selectedTemplate.parcellations[chosenParcellationIndex]['properties']['publications']? selectedTemplate.parcellations[chosenParcellationIndex]['properties']['publications']: null" - [parcellationNifti] = "selectedTemplate.parcellations[chosenParcellationIndex]['properties']['nifti']? selectedTemplate.parcellations[chosenParcellationIndex]['properties']['nifti'] : null"> + [parcellationNifti] = "selectedTemplate.parcellations[chosenParcellationIndex]['properties']['nifti']? selectedTemplate.parcellations[chosenParcellationIndex]['properties']['nifti'] : null" + [parcellationExternalLink] ="selectedTemplate.parcellations[chosenParcellationIndex]['properties']['externalLink']? selectedTemplate.parcellations[chosenParcellationIndex]['properties']['externalLink']: null"> </reference-toast-component> </div> </div>