Skip to content

Commit e2eb434

Browse files
author
hackermd
committed
Fix usage example in README
1 parent fc26369 commit e2eb434

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const url = 'http://localhost:8080/dicomweb';
4444
const client = new DICOMwebClient.api.DICOMwebClient({url});
4545
const studyInstanceUID = '1.2.3.4';
4646
const seriesInstanceUID = '1.2.3.5';
47+
const searchInstanceOptions = {
48+
studyInstanceUID,
49+
seriesInstanceUID
50+
};
4751
client.searchForInstances(searchInstanceOptions).then((instances) => {
4852
const promises = []
4953
for (let i = 0; i < instances.length; i++) {
@@ -55,10 +59,9 @@ client.searchForInstances(searchInstanceOptions).then((instances) => {
5559
};
5660
const promise = client.retrieveInstanceMetadata(retrieveInstanceOptions).then(metadata => {
5761
const imageType = metadata[0]["00080008"]["Value"];
58-
if ( imageType[2] !== "VOLUME") {
59-
return(null);
62+
if (imageType[2] === "VOLUME") {
63+
return(metadata[0]);
6064
}
61-
return(metadata[0]);
6265
});
6366
promises.push(promise);
6467
}

0 commit comments

Comments
 (0)