Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
55002fb
chore(version): move to the next beta version [BUMP BETA]
sedghi Oct 12, 2023
c54658a
chore(version): version.json [skip ci]
ohif-bot Oct 12, 2023
33f1259
chore(version): Update package versions [skip ci]
ohif-bot Oct 12, 2023
93d798d
fix(calibration): No calibration popup caused by perhaps an unused co…
jbocce Oct 19, 2023
5f8325e
chore(version): version.json [skip ci]
ohif-bot Oct 19, 2023
fa599d0
chore(version): Update package versions [skip ci]
ohif-bot Oct 19, 2023
d9258ec
fix(cine): Use the frame rate specified in DICOM and optionally auto …
jbocce Oct 19, 2023
912b3c7
chore(version): version.json [skip ci]
ohif-bot Oct 19, 2023
43c882a
chore(version): Update package versions [skip ci]
ohif-bot Oct 19, 2023
49514ae
fix(recipes): package.json script orthanc:up docker-compose path (#3741)
edwardyangxin Oct 23, 2023
a7125f9
chore(version): version.json [skip ci]
ohif-bot Oct 23, 2023
c31c7f8
chore(version): Update package versions [skip ci]
ohif-bot Oct 23, 2023
eec9c33
docs(azure): Azure static Deployment details (#3740)
bluesteel23 Oct 23, 2023
6e99351
chore(version): version.json [skip ci]
ohif-bot Oct 23, 2023
3bbbcea
chore(version): Update package versions [skip ci]
ohif-bot Oct 23, 2023
d98439f
fix(sr): dcm4chee requires the patient name for an SR to match what i…
jbocce Oct 24, 2023
a5ad1cc
chore(version): version.json [skip ci]
ohif-bot Oct 24, 2023
2145b42
chore(version): Update package versions [skip ci]
ohif-bot Oct 24, 2023
dd6d976
fix(toolbar): allow customizable toolbar for active viewport and allo…
wayfarer3130 Oct 25, 2023
cafba99
chore(version): version.json [skip ci]
ohif-bot Oct 25, 2023
423ba7c
chore(version): Update package versions [skip ci]
ohif-bot Oct 25, 2023
db39585
fix(measurement service): Implemented correct check of schema keys in…
jbocce Oct 30, 2023
2a15ef0
feat(filters): save worklist query filters to session storage so that…
jbocce Oct 30, 2023
5b3b6ee
chore(version): version.json [skip ci]
ohif-bot Oct 30, 2023
c73a403
chore(version): Update package versions [skip ci]
ohif-bot Oct 30, 2023
330e11c
feat(i18n): enhanced i18n support (#3730)
pavelpisarev Oct 31, 2023
71a30dc
chore(version): version.json [skip ci]
ohif-bot Oct 31, 2023
09ff293
chore(version): Update package versions [skip ci]
ohif-bot Oct 31, 2023
b23eeff
fix(thumbnail): Avoid multiple promise creations for thumbnails (#3756)
jbocce Nov 2, 2023
a29f5bc
chore(version): version.json [skip ci]
ohif-bot Nov 2, 2023
f9f16bc
chore(version): Update package versions [skip ci]
ohif-bot Nov 2, 2023
ee67bcc
docs(faq): FAQ and Segmentation Mode Fix for some studies (#3762)
sedghi Nov 3, 2023
a2361fa
chore(version): version.json [skip ci]
ohif-bot Nov 3, 2023
1a68c06
chore(version): Update package versions [skip ci]
ohif-bot Nov 3, 2023
bf252bc
feat(hp callback): Add viewport ready callback (#3772)
sedghi Nov 8, 2023
dc345d1
chore(version): version.json [skip ci]
ohif-bot Nov 8, 2023
9575a6f
chore(version): Update package versions [skip ci]
ohif-bot Nov 8, 2023
442f99d
feat: add VolumeViewport rotation (#3776)
pedrokohler Nov 8, 2023
73e804c
chore(version): version.json [skip ci]
ohif-bot Nov 8, 2023
4bbba87
chore(version): Update package versions [skip ci]
ohif-bot Nov 8, 2023
8af1046
fix(arrow): ArrowAnnotate text key cause validation error (#3771)
edwardyangxin Nov 9, 2023
e1e1e60
chore(version): version.json [skip ci]
ohif-bot Nov 9, 2023
8c2f495
chore(version): Update package versions [skip ci]
ohif-bot Nov 9, 2023
8bbcd0e
fix(path): upgrade docusaurus for security (#3780)
pedrokohler Nov 10, 2023
26c9567
chore(version): version.json [skip ci]
ohif-bot Nov 10, 2023
5b513fd
chore(version): Update package versions [skip ci]
ohif-bot Nov 10, 2023
43b1c17
feat(dicomJSON): Add Loading Other Display Sets and JSON Metadata Gen…
sedghi Nov 10, 2023
73d8848
chore(version): version.json [skip ci]
ohif-bot Nov 10, 2023
1479349
chore(version): Update package versions [skip ci]
ohif-bot Nov 10, 2023
fd1251f
fix(overlay): Overlays aren't shown on undefined origin (#3781)
wayfarer3130 Nov 13, 2023
9b7f384
chore(version): version.json [skip ci]
ohif-bot Nov 13, 2023
fc438e9
chore(version): Update package versions [skip ci]
ohif-bot Nov 13, 2023
3234014
fix: 🐛 Run error handler for failed image requests (#3773)
igoroctaviano Nov 13, 2023
3fbc23b
chore(version): version.json [skip ci]
ohif-bot Nov 13, 2023
013068b
chore(version): Update package versions [skip ci]
ohif-bot Nov 13, 2023
b694228
feat(url): Add SeriesInstanceUIDs wado query param (#3746)
igoroctaviano Nov 15, 2023
4a6f1bd
chore(version): version.json [skip ci]
ohif-bot Nov 15, 2023
7867b29
chore(version): Update package versions [skip ci]
ohif-bot Nov 15, 2023
d83beb7
feat(docs): Added various training videos to support the OHIF CLI too…
jbocce Nov 18, 2023
d1eef6d
chore(version): version.json [skip ci]
ohif-bot Nov 18, 2023
04121e3
chore(version): Update package versions [skip ci]
ohif-bot Nov 18, 2023
8c8924a
fix(metadata): to handle cornerstone3D update for htj2k (#3783)
wayfarer3130 Nov 21, 2023
3cf4b6d
chore(version): version.json [skip ci]
ohif-bot Nov 21, 2023
c4e22c2
chore(version): Update package versions [skip ci]
ohif-bot Nov 21, 2023
00e7519
fix(DICOM Overlay): The overlay data wasn't being refreshed on change…
wayfarer3130 Nov 21, 2023
dfa8516
chore(version): version.json [skip ci]
ohif-bot Nov 21, 2023
786898f
chore(version): Update package versions [skip ci]
ohif-bot Nov 21, 2023
404b0a5
feat(events): broadcast series summary metadata (#3798)
pedrokohler Nov 21, 2023
6edb1c1
chore(version): version.json [skip ci]
ohif-bot Nov 21, 2023
1be5613
chore(version): Update package versions [skip ci]
ohif-bot Nov 21, 2023
c4ff2c2
feat: Merge Data Source (#3788)
igoroctaviano Nov 24, 2023
8b6256e
chore(version): version.json [skip ci]
ohif-bot Nov 24, 2023
622f18b
chore(version): Update package versions [skip ci]
ohif-bot Nov 24, 2023
9d1884d
fix: Update the CS3D packages to add the most recent HTJ2K TSUIDS (#3…
wayfarer3130 Nov 24, 2023
36ba20d
chore(version): version.json [skip ci]
ohif-bot Nov 24, 2023
abac6f5
chore(version): Update package versions [skip ci]
ohif-bot Nov 24, 2023
924affa
fix(cine): Set cine disabled on mode exit. (#3812)
jbocce Nov 27, 2023
7673a88
chore(version): version.json [skip ci]
ohif-bot Nov 27, 2023
4f9a00f
chore(version): Update package versions [skip ci]
ohif-bot Nov 27, 2023
f1a6764
fix(SM): drag and drop is now fixed for SM (#3813)
sedghi Nov 28, 2023
ecee25b
chore(version): version.json [skip ci]
ohif-bot Nov 28, 2023
74c98b6
chore(version): Update package versions [skip ci]
ohif-bot Nov 28, 2023
6651008
fix(auth): fix the issue with oauth at a non root path (#3840)
sedghi Dec 6, 2023
806c2f4
chore(version): version.json [skip ci]
ohif-bot Dec 6, 2023
78d4bea
chore(version): Update package versions [skip ci]
ohif-bot Dec 6, 2023
59576d6
feat(HP): Added new 3D hanging protocols to be used in the new layout…
jbocce Dec 8, 2023
6e5d8b6
chore(version): version.json [skip ci]
ohif-bot Dec 8, 2023
5a5c4f5
chore(version): Update package versions [skip ci]
ohif-bot Dec 8, 2023
d14a8f0
feat(i18n): enhanced i18n support (#3761)
pavelpisarev Dec 11, 2023
805c532
fix: address and improve system vulnerabilities (#3851)
pedrokohler Dec 13, 2023
f707b4e
feat(config): Add activateViewportBeforeInteraction parameter for vie…
Sofien-Sellami Dec 13, 2023
b1a04ec
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
d1c07d9
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
e1f55e6
feat(customizationService): Enable saving and loading of private tags…
pedrokohler Dec 13, 2023
920256d
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
7f0ca85
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
9c6e1cd
Fix(HPService): custom image load performed is now reset to false on …
salimkanoun Dec 13, 2023
ae16c7f
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
f99645f
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
97cb1f9
fix(dicom-seg) : Fix the missing color tag when loading Dicom-Seg (#3…
Celian-abd Dec 13, 2023
7bb2713
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
c45f60d
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
13d0c88
docs: Update HangingProtocolService.md doc sameAs example to contain …
dxlin Dec 13, 2023
7a05d16
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
c4064ac
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
0177b62
feat(overlay): add inline binary overlays (#3852)
pedrokohler Dec 13, 2023
6ca13c0
fix(icon-style): Ensure consistent icon dimensions (#3727)
Sofien-Sellami Dec 13, 2023
de4ad88
chore(version): version.json [skip ci]
ohif-bot Dec 13, 2023
2fa335c
chore(version): Update package versions [skip ci]
ohif-bot Dec 13, 2023
5915fad
chore(version): upgrade cornerstone3D versions (#3853)
sedghi Dec 14, 2023
b0bf5dc
chore(version): version.json [skip ci]
ohif-bot Dec 14, 2023
44a5a24
chore(version): Update package versions [skip ci]
ohif-bot Dec 14, 2023
0eb502a
chore(version): upgrade cornerstone3D versions to fix orientation (#3…
sedghi Dec 15, 2023
c6214d6
chore(version): version.json [skip ci]
ohif-bot Dec 15, 2023
eb7c950
chore(version): Update package versions [skip ci]
ohif-bot Dec 15, 2023
9413ff7
gradienthealth: whitelabel
Ouwen Oct 10, 2022
5bf9dbe
config: bigquery
Ouwen Apr 9, 2023
f25bf47
fix: Ignored Series metadata retrieval promise handling for DicomJSON…
maya-mohan Sep 21, 2023
2723111
feat: Deploy viewer to github pages
maya-mohan Sep 27, 2023
5dffc3c
feat:Added icad config
maya-mohan Sep 28, 2023
4e0290d
Merged icad.js config to gradient.js config.
maya-mohan Oct 3, 2023
c95e857
Added requestTransferSyntaxUID in datasource config
maya-mohan Oct 3, 2023
0feda28
feat: stack viewport and non-reconstructable segmentation
Adithyan-Dinesh-Trenser Nov 6, 2023
3e3c7a9
Added formpanel to segmentation mode and added form change listener i…
Adithyan-Dinesh-Trenser Jan 2, 2024
7a0d1bf
Revert "Added formpanel to segmentation mode and added form change li…
Ouwen Jan 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
105 changes: 105 additions & 0 deletions .github/workflows/deploy_ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Deploy viewer to github pages

on:
push:
branches: [ "gradienthealth/Stack-Segmentation" ]
#pull_request:
#branches: [ "main" ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Checkout cornerstone3D
uses: actions/checkout@v3
with:
repository: gradienthealth/cornerstone3D-beta
ref: gradienthealth/stack-segmentation-support-with-zip-image-loader
path: ./cornerstone3D

- name: Build cornerstone3D
run: |
cd ./cornerstone3D
yarn install
yarn build:all

- name: Checkout GradientExtensionsAndModes
uses: actions/checkout@v3
with:
repository: gradienthealth/GradientExtensionsAndModes
ref: gradienthealth/Segmentation-with-DicomJSON
path: ./GradientExtensionsAndModes

#- name: Build GradientExtensionsAndModes
# run: |
# cd ./GradientExtensionsAndModes/extensions/ohif-gradienthealth-extension
# yarn install
# yarn build:package
# cd ./modes/cohort
# yarn install
# yarn build:package

- name: Checkout Viewers
uses: actions/checkout@v3
with:
repository: gradienthealth/Viewers
path: ./Viewers

- name: Link
run: |
cd ./cornerstone3D/packages/adapters/dist
yarn link
cd ../../core/dist
yarn link
cd ../../dicomImageLoader/dist
yarn link
#cd ../../nifti-volume-loader/dist
#yarn link
cd ../../streaming-image-volume-loader/dist
yarn link
cd ../../tools/dist
yarn link
cd ../../../../Viewers
yarn link @cornerstonejs/adapters
yarn link @cornerstonejs/core
yarn link @cornerstonejs/dicom-image-loader
#yarn link @cornerstonejs/nifti-volume-loader
yarn link @cornerstonejs/streaming-image-volume-loader
yarn link @cornerstonejs/tools
yarn install
yarn run cli link-extension ../GradientExtensionsAndModes/extensions/ohif-gradienthealth-extension
yarn run cli link-mode ../GradientExtensionsAndModes/modes/cohort
yarn run cli link-mode ../GradientExtensionsAndModes/modes/breast-density-mode
yarn run build:gradient

- name: Checkout gh page
uses: actions/checkout@v3
with:
repository: gradienthealth/gradienthealth.github.io
path: ./gradienthealth.github.io
token: ${{ secrets.GH_DEPLOY_TOKEN }}

- name: Copy
run: |
mv ./gradienthealth.github.io/.git /tmp/
rm -r ./gradienthealth.github.io
cp -r ./Viewers/platform/app/dist/ ./gradienthealth.github.io
mv /tmp/.git ./gradienthealth.github.io
cd ./gradienthealth.github.io
cp index.html 404.html
git config --global user.name "maya-mohan"
git config --global user.email "maya@gradienthealth.io"
git remote set-url origin https://maya-mohan:${{ secrets.GH_DEPLOY_TOKEN }}@github.com/gradienthealth/gradienthealth.github.io
git add .
git commit -a -m "publishing viewer"
git push -u origin
265 changes: 265 additions & 0 deletions .scripts/dicom-json-generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
/*
* This script uses nodejs to generate a JSON file from a DICOM study folder.
* You need to have dcmjs installed in your project.
* The JSON file can be used to load the study into the OHIF Viewer. You can get more detail
* in the DICOM JSON Data source on docs.ohif.org
*
* Usage: node dicomStudyToJSONLaunch.js <studyFolder> <urlPrefix> <outputJSONPath>
*
* params:
* - studyFolder: path to the study folder
* - urlPrefix: prefix to the url that will be used to load the study into the viewer. For instance
* we use https://ohif-assets.s3.us-east-2.amazonaws.com/dicom-json/data as the urlPrefix for the
* example since the data is hosted on S3 and each study is in a folder. So the url in the generated
* json file for the first instance of the first series of the first study will be
* dicomweb:https://ohif-assets.s3.us-east-2.amazonaws.com/dicom-json/data/Series1/Instance1
* - outputJSONPath: path to the output JSON file
*/
const dcmjs = require('dcmjs');
const path = require('path');
const fs = require('fs').promises;

const args = process.argv.slice(2);
const [studyDirectory, urlPrefix, outputPath] = args;

if (args.length !== 3) {
console.error('Usage: node dicomStudyToJSONLaunch.js <studyFolder> <urlPrefix> <outputJSONPath>');
process.exit(1);
}

const model = {
studies: [],
};

async function convertDICOMToJSON(studyDirectory, urlPrefix, outputPath) {
try {
const files = await recursiveReadDir(studyDirectory);
console.debug('Processing...');

for (const file of files) {
if (!file.includes('.DS_Store') && !file.includes('.xml')) {
const arrayBuffer = await fs.readFile(file);
const dicomDict = dcmjs.data.DicomMessage.readFile(arrayBuffer.buffer);
const instance = dcmjs.data.DicomMetaDictionary.naturalizeDataset(dicomDict.dict);

instance.fileLocation = createImageId(file, urlPrefix, studyDirectory);
processInstance(instance);
}
}

console.log('Successfully loaded data');

model.studies.forEach(study => {
study.NumInstances = findInstancesNumber(study);
study.Modalities = findModalities(study).join('/');
});

await fs.writeFile(outputPath, JSON.stringify(model, null, 2));
console.log('JSON saved');
} catch (error) {
console.error(error);
}
}

async function recursiveReadDir(dir) {
let results = [];
const list = await fs.readdir(dir);
for (const file of list) {
const filePath = path.resolve(dir, file);
const stat = await fs.stat(filePath);
if (stat.isDirectory()) {
const res = await recursiveReadDir(filePath);
results = results.concat(res);
} else {
results.push(filePath);
}
}
return results;
}

function createImageId(fileLocation, urlPrefix, studyDirectory) {
const relativePath = path.relative(studyDirectory, fileLocation);
const normalizedPath = path.normalize(relativePath).replace(/\\/g, '/');
return `dicomweb:${urlPrefix}${normalizedPath}`;
}

function processInstance(instance) {
const { StudyInstanceUID, SeriesInstanceUID } = instance;
let study = getStudy(StudyInstanceUID);

if (!study) {
study = createStudyMetadata(StudyInstanceUID, instance);
model.studies.push(study);
}

let series = getSeries(StudyInstanceUID, SeriesInstanceUID);

if (!series) {
series = createSeriesMetadata(instance);
study.series.push(series);
}

const instanceMetaData =
instance.NumberOfFrames > 1
? createInstanceMetaDataMultiFrame(instance)
: createInstanceMetaData(instance);

series.instances.push(...[].concat(instanceMetaData));
}

function getStudy(StudyInstanceUID) {
return model.studies.find(study => study.StudyInstanceUID === StudyInstanceUID);
}

function getSeries(StudyInstanceUID, SeriesInstanceUID) {
const study = getStudy(StudyInstanceUID);
return study
? study.series.find(series => series.SeriesInstanceUID === SeriesInstanceUID)
: undefined;
}

const findInstancesNumber = study => {
let numInstances = 0;
study.series.forEach(aSeries => {
numInstances = numInstances + aSeries.instances.length;
});
return numInstances;
};

const findModalities = study => {
let modalities = new Set();
study.series.forEach(aSeries => {
modalities.add(aSeries.Modality);
});
return Array.from(modalities);
};

function createStudyMetadata(StudyInstanceUID, instance) {
return {
StudyInstanceUID,
StudyDescription: instance.StudyDescription,
StudyDate: instance.StudyDate,
StudyTime: instance.StudyTime,
PatientName: instance.PatientName,
PatientID: instance.PatientID || '1234', // this is critical to have
AccessionNumber: instance.AccessionNumber,
PatientAge: instance.PatientAge,
PatientSex: instance.PatientSex,
PatientWeight: instance.PatientWeight,
series: [],
};
}
function createSeriesMetadata(instance) {
return {
SeriesInstanceUID: instance.SeriesInstanceUID,
SeriesDescription: instance.SeriesDescription,
SeriesNumber: instance.SeriesNumber,
SeriesTime: instance.SeriesTime,
Modality: instance.Modality,
SliceThickness: instance.SliceThickness,
instances: [],
};
}
function commonMetaData(instance) {
return {
Columns: instance.Columns,
Rows: instance.Rows,
InstanceNumber: instance.InstanceNumber,
SOPClassUID: instance.SOPClassUID,
AcquisitionNumber: instance.AcquisitionNumber,
PhotometricInterpretation: instance.PhotometricInterpretation,
BitsAllocated: instance.BitsAllocated,
BitsStored: instance.BitsStored,
PixelRepresentation: instance.PixelRepresentation,
SamplesPerPixel: instance.SamplesPerPixel,
PixelSpacing: instance.PixelSpacing,
HighBit: instance.HighBit,
ImageOrientationPatient: instance.ImageOrientationPatient,
ImagePositionPatient: instance.ImagePositionPatient,
FrameOfReferenceUID: instance.FrameOfReferenceUID,
ImageType: instance.ImageType,
Modality: instance.Modality,
SOPInstanceUID: instance.SOPInstanceUID,
SeriesInstanceUID: instance.SeriesInstanceUID,
StudyInstanceUID: instance.StudyInstanceUID,
WindowCenter: instance.WindowCenter,
WindowWidth: instance.WindowWidth,
RescaleIntercept: instance.RescaleIntercept,
RescaleSlope: instance.RescaleSlope,
};
}

function conditionalMetaData(instance) {
return {
...(instance.ConceptNameCodeSequence && {
ConceptNameCodeSequence: instance.ConceptNameCodeSequence,
}),
...(instance.SeriesDate && { SeriesDate: instance.SeriesDate }),
...(instance.ReferencedSeriesSequence && {
ReferencedSeriesSequence: instance.ReferencedSeriesSequence,
}),
...(instance.SharedFunctionalGroupsSequence && {
SharedFunctionalGroupsSequence: instance.SharedFunctionalGroupsSequence,
}),
...(instance.PerFrameFunctionalGroupsSequence && {
PerFrameFunctionalGroupsSequence: instance.PerFrameFunctionalGroupsSequence,
}),
...(instance.ContentSequence && { ContentSequence: instance.ContentSequence }),
...(instance.ContentTemplateSequence && {
ContentTemplateSequence: instance.ContentTemplateSequence,
}),
...(instance.CurrentRequestedProcedureEvidenceSequence && {
CurrentRequestedProcedureEvidenceSequence: instance.CurrentRequestedProcedureEvidenceSequence,
}),
...(instance.CodingSchemeIdentificationSequence && {
CodingSchemeIdentificationSequence: instance.CodingSchemeIdentificationSequence,
}),
...(instance.RadiopharmaceuticalInformationSequence && {
RadiopharmaceuticalInformationSequence: instance.RadiopharmaceuticalInformationSequence,
}),
...(instance.ROIContourSequence && {
ROIContourSequence: instance.ROIContourSequence,
}),
...(instance.StructureSetROISequence && {
StructureSetROISequence: instance.StructureSetROISequence,
}),
...(instance.ReferencedFrameOfReferenceSequence && {
ReferencedFrameOfReferenceSequence: instance.ReferencedFrameOfReferenceSequence,
}),
...(instance.CorrectedImage && { CorrectedImage: instance.CorrectedImage }),
...(instance.Units && { Units: instance.Units }),
...(instance.DecayCorrection && { DecayCorrection: instance.DecayCorrection }),
...(instance.AcquisitionDate && { AcquisitionDate: instance.AcquisitionDate }),
...(instance.AcquisitionTime && { AcquisitionTime: instance.AcquisitionTime }),
...(instance.PatientWeight && { PatientWeight: instance.PatientWeight }),
...(instance.NumberOfFrames && { NumberOfFrames: instance.NumberOfFrames }),
...(instance.FrameTime && { FrameTime: instance.FrameTime }),
...(instance.EncapsulatedDocument && { EncapsulatedDocument: instance.EncapsulatedDocument }),
...(instance.SequenceOfUltrasoundRegions && {
SequenceOfUltrasoundRegions: instance.SequenceOfUltrasoundRegions,
}),
};
}

function createInstanceMetaData(instance) {
const metadata = {
...commonMetaData(instance),
...conditionalMetaData(instance),
};
return { metadata, url: instance.fileLocation };
}

function createInstanceMetaDataMultiFrame(instance) {
const instances = [];
const commonData = commonMetaData(instance);
const conditionalData = conditionalMetaData(instance);

for (let i = 1; i <= instance.NumberOfFrames; i++) {
const metadata = { ...commonData, ...conditionalData };
const result = { metadata, url: instance.fileLocation + `?frame=${i}` };
instances.push(result);
}
return instances;
}

convertDICOMToJSON(studyDirectory, urlPrefix, outputPath);
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"prettier.endOfLine": "lf",
"workbench.colorCustomizations": {},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
Loading