Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE committed Oct 20, 2023
1 parent 114e9f9 commit 6f1a36b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Support metadata and imaging data loading from AWS HealthImaging


## Authors
Bill Wallace, Mateus Freira, Radical Imaging, Chris Hafey, Ibrahim Mohamed
Bill Wallace, Mateus Freira, Radical Imaging, Chris Hafey

## License
MIT
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ohif-aws-healthimaging",
"version": "0.9.5",
"version": "0.9.6",
"description": "Support reading tree structured metadata",
"author": "Bill Wallace, Mateus Freira,Radical Imaging, Ibrahim Mohamed",
"author": "Bill Wallace, Mateus Freira,Radical Imaging",
"keywords": [
"ohif-extension"
],
Expand Down
4 changes: 2 additions & 2 deletions src/createDicomWebTreeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
return imageIds;
},

getImageIdsForInstance({ instance, frame = 0 }) {
getImageIdsForInstance({ instance, frame = 1 }) {
const { DatastoreID, ImageFrames, ImageSetID } = instance;
const frameID = ImageFrames?.[frame]?.ID;
const frameID = ImageFrames?.[frame - 1]?.ID;
const healthlakeParam = qidoDicomWebClient.healthlake?.images ? "true" : "false";
const extraParameters =
(DatastoreID && {
Expand Down
11 changes: 11 additions & 0 deletions src/utils/DicomTreeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default class DicomTreeClient extends api.DICOMwebClient {
return enrichImageSetMetadataWithImageSetId(metadataLoaded, imageSetId);
}));
const finalMetadata = reduceMetadata(metadataArray, this.healthlake);

return finalMetadata;
}
}
Expand Down Expand Up @@ -239,6 +240,16 @@ function reduceMetadata(metadataArray: any[], config: HealthLake) {
const series = seriesBySerieId[key];
seriesBySerieId[key] = seriesBySerieId[key][0];
seriesBySerieId[key].Instances = series.reduce((acc, cur) => {
Object.keys(cur.Instances).forEach((instanceKey) => {
const instance = cur.Instances[instanceKey];
if(instance.DICOM.RescaleSlope !== undefined) {
instance.DICOM.RescaleSlope = Math.floor(instance.DICOM.RescaleSlope)
}

if(instance.DICOM.RescaleIntercept !== undefined) {
instance.DICOM.RescaleIntercept = Math.floor(instance.DICOM.RescaleIntercept)
}
});
return Object.assign(acc, cur.Instances);
}, {});
});
Expand Down

0 comments on commit 6f1a36b

Please sign in to comment.