Skip to content

Commit

Permalink
started working on DICOM support (stored in Media object) (fastenheal…
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Apr 5, 2023
1 parent 390cea6 commit 01b6cc3
Show file tree
Hide file tree
Showing 32 changed files with 729 additions and 27 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Next we'll start the processes described above:

# In terminal #1, run the following
cd frontend
yarn install
yarn dist -- -c [sandbox|prod]
# eg. yarn dist -- -c prod

Expand Down
3 changes: 2 additions & 1 deletion backend/pkg/database/sqlite_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ func (sr *SqliteRepository) GetFlattenedResourceGraph(ctx context.Context) ([]*m
graph.DFS(g, vertexId, func(relatedVertexId string) bool {
relatedResourceFhir, _ := g.Vertex(relatedVertexId)
//skip the current resource if it's referenced in this list.
if vertexId != resourceVertexId(relatedResourceFhir) {
//also skip the current resource if its a Binary resource (which is a special case)
if vertexId != resourceVertexId(relatedResourceFhir) && relatedResourceFhir.SourceResourceType != "Binary" {
resource.RelatedResourceFhir = append(resource.RelatedResourceFhir, relatedResourceFhir)
}
return false
Expand Down
12 changes: 9 additions & 3 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
{
"glob": "**/*",
"input": "./node_modules/dwv/decoders/",
"output": "/assets/dwv/decoders/"
},
],
"styles": [
"src/styles.scss"
],
"scripts": [
"node_modules/@panva/oauth4webapi/build/index.js"
"node_modules/@panva/oauth4webapi/build/index.js",

]
},
"configurations": {
Expand All @@ -55,7 +61,7 @@
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"maximumError": "10mb"
},
{
"type": "anyComponentStyle",
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"asmcrypto.js": "^2.3.2",
"bootstrap": "^4.4.1",
"chart.js": "2.9.4",
"dwv": "^0.31.0",
"fhirpath": "^3.3.0",
"humanize-duration": "^3.27.3",
"idb": "^7.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<div class="row">
<div class="col text-center">
<div class="btn-group" role="group" aria-label="Basic example">
<button ngbTooltip="scroll layers" type="button" (click)="onChangeTool('Scroll')" class="btn btn-secondary pd-x-25" [class.active]="selectedTool == 'Scroll'"><i class="fas fa-bars"></i></button>
<button ngbTooltip="zoom and pan" type="button" (click)="onChangeTool('ZoomAndPan')" class="btn btn-secondary pd-x-25" [class.active]="selectedTool == 'ZoomAndPan'"><i class="fas fa-search"></i></button>
<button ngbTooltip="change brightness" type="button" (click)="onChangeTool('WindowLevel')" class="btn btn-secondary pd-x-25" [class.active]="selectedTool == 'WindowLevel'"><i class="fas fa-adjust"></i></button>
<button ngbTooltip="add measurements" type="button" (click)="onChangeTool('Draw')" class="btn btn-secondary pd-x-25" [class.active]="selectedTool == 'Draw'"><i class="fas fa-edit"></i></button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button ngbTooltip="toggle orientation" type="button" (click)="toggleOrientation()" class="btn btn-secondary pd-x-25"><i class="fas fa-compress"></i></button>
</div>

<div class="btn-group" role="group" aria-label="Info">
<button ngbTooltip="show info" type="button" (click)="openTagsModal(tagsModal)" class="btn btn-secondary pd-x-25"><i class="fas fa-info"></i></button>
</div>
</div>
</div>

<div id="dwv">
<!-- <mat-progress-bar mode="determinate" value="{{ loadProgress }}"></mat-progress-bar>-->
<!-- <div class="button-row">-->
<!-- <mat-button-toggle-group name="tool" [disabled]="!dataLoaded">-->
<!-- <mat-button-toggle value="{{ tool }}" color="primary"-->
<!-- *ngFor="let tool of toolNames"-->
<!-- title="{{ tool }}"-->
<!-- (click)="onChangeTool(tool)"-->
<!-- [disabled]="!dataLoaded || !canRunTool(tool)">-->
<!-- <mat-icon>{{ getToolIcon(tool) }}</mat-icon>-->
<!-- </mat-button-toggle>-->
<!-- </mat-button-toggle-group>-->
<div id="layerGroup0" class="layerGroup pd-t-10">
<div id="dropBox"></div>
</div>
</div>


<ng-template #tagsModal let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">DICOM tags</h4>

<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table table-striped mg-b-0">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let row of visibleMetaData">
<th scope="row">{{row.id}}</th>
<td>{{row.name}}</td>
<td>{{row.value}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<ngb-pagination
class="mr-auto"
[collectionSize]="metaData.length"
[(page)]="tagsPage"
[pageSize]="tagsPageSize"
(pageChange)="refreshTags()"
>
</ngb-pagination>
<button type="button" class="btn btn-outline-dark" (click)="modal.close('Close click')">Close</button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Layers */
//.layerGroup {
// position: relative;
// padding: 0;
// display: flex;
// justify-content: center;
// height: 90%;
//}
//.layer {
// position: absolute;
// pointer-events: none;
//}

#dwv {
width: 100%;
height: 700px;
}

#layerGroup0 {
//width: 90%;
height: 90%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DicomComponent } from './dicom.component';

describe('DicomComponent', () => {
let component: DicomComponent;
let fixture: ComponentFixture<DicomComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DicomComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(DicomComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit 01b6cc3

Please sign in to comment.