Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/3.8.0 beta.36 #124

Merged
merged 192 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
dc73b18
fix(cli): various fixes for adding custom modes and extensions (#3683)
jbocce Sep 29, 2023
66abdac
chore(version): version.json [skip ci]
ohif-bot Sep 29, 2023
3dabee2
chore(version): Update package versions [skip ci]
ohif-bot Sep 29, 2023
a67d72d
fix(no sab): should work when shared array buffer is not required (#3…
sedghi Sep 29, 2023
d09938b
chore(version): version.json [skip ci]
ohif-bot Sep 29, 2023
c9c57b0
chore(version): Update package versions [skip ci]
ohif-bot Sep 29, 2023
1129c15
fix(config): support more values for the useSharedArrayBuffer (#3688)
sedghi Oct 3, 2023
e2e806f
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
b342972
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
8a335bd
fix(StackSync): Miscellaneous fixes for stack image sync (#3663)
wayfarer3130 Oct 3, 2023
e36a604
fix(dicom overlay): Handle special cases of ArrayBuffer for various D…
jbocce Oct 3, 2023
3415cf9
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
b33ad0c
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
eb22328
fix(typescript error): Change pubSubServiceInterface file type to typ…
Edward-Son Oct 3, 2023
06facd8
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
4c88a4a
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
4dc2acd
fix(editing): regression bug in disable editing (#3687)
rodrigobasilio2022 Oct 3, 2023
58f214b
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
2a086a6
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
5cc1dc9
docs(links): Adding references to two used markdown links (#3650)
yarikoptic Oct 3, 2023
49bc346
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
64f68f5
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
5e7fe91
feat(displayArea): add display area to hanging protocol (#3691)
sedghi Oct 3, 2023
38cd3d8
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
1b207f1
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
108383b
feat(debug): Add timing information about time to first image/all ima…
wayfarer3130 Oct 3, 2023
15eca78
chore(version): version.json [skip ci]
ohif-bot Oct 3, 2023
01d843f
chore(version): Update package versions [skip ci]
ohif-bot Oct 3, 2023
28cec04
fix(cli): Add npm packaged mode not working (#3689)
jbocce Oct 4, 2023
42b7d99
chore(version): version.json [skip ci]
ohif-bot Oct 4, 2023
a755cce
chore(version): Update package versions [skip ci]
ohif-bot Oct 4, 2023
29748d4
fix(translation): Side panel translate fix (#3156)
wx0322 Oct 4, 2023
c418185
chore(version): version.json [skip ci]
ohif-bot Oct 4, 2023
953c564
chore(version): Update package versions [skip ci]
ohif-bot Oct 4, 2023
745050a
feat(locale): Added Turkish language support (tr-TR) - Community PR (…
sedghi Oct 4, 2023
ed82511
chore(version): version.json [skip ci]
ohif-bot Oct 4, 2023
17f528b
chore(version): Update package versions [skip ci]
ohif-bot Oct 4, 2023
ebe8f71
feat(locale): add German translations - community PR (#3697)
sedghi Oct 4, 2023
83c001f
chore(version): version.json [skip ci]
ohif-bot Oct 4, 2023
646bef1
chore(version): Update package versions [skip ci]
ohif-bot Oct 4, 2023
c1d5ee7
fix(measurement and microscopy): various small fixes for measurement…
jbocce Oct 4, 2023
3f27c38
chore(version): version.json [skip ci]
ohif-bot Oct 4, 2023
748acaf
chore(version): Update package versions [skip ci]
ohif-bot Oct 4, 2023
1fd98d9
fix(segmentation scroll): and hydration bugs (#3701)
jbocce Oct 6, 2023
cdb66dc
chore(version): version.json [skip ci]
ohif-bot Oct 6, 2023
29aeb07
chore(version): Update package versions [skip ci]
ohif-bot Oct 6, 2023
8bc12a3
fix(bugs): fixing lots of bugs regarding release candidate (#3700)
sedghi Oct 6, 2023
a790be9
chore(version): version.json [skip ci]
ohif-bot Oct 6, 2023
eab42c1
chore(version): Update package versions [skip ci]
ohif-bot Oct 6, 2023
40673f6
feat(Segmentation): download RTSS from Labelmap(#3692)
dxlin Oct 6, 2023
a6a6aed
chore(version): version.json [skip ci]
ohif-bot Oct 6, 2023
349c503
chore(version): Update package versions [skip ci]
ohif-bot Oct 6, 2023
4911e47
fix(segmentation): do not use SAB if not specified (#3705)
sedghi Oct 9, 2023
6a5fe59
chore(version): version.json [skip ci]
ohif-bot Oct 9, 2023
f9f33f7
chore(version): Update package versions [skip ci]
ohif-bot Oct 9, 2023
0a42d57
fix(modality unit): fix the modality unit per target via upgrade of c…
sedghi Oct 9, 2023
820bb83
chore(version): version.json [skip ci]
ohif-bot Oct 9, 2023
7d87766
chore(version): Update package versions [skip ci]
ohif-bot Oct 9, 2023
52f34c6
fix(voi): should publish voi change event on reset (#3707)
sedghi Oct 10, 2023
f9c3d51
chore(version): version.json [skip ci]
ohif-bot Oct 10, 2023
f845505
chore(version): Update package versions [skip ci]
ohif-bot Oct 10, 2023
a9a6ad5
fix(segmentation): Various fixes for segmentation mode and other (#3…
jbocce Oct 10, 2023
5a3af83
chore(version): version.json [skip ci]
ohif-bot Oct 10, 2023
dc929d3
chore(version): Update package versions [skip ci]
ohif-bot Oct 10, 2023
7c57f67
fix(modules): add stylus loader as an option to be uncommented (#3710)
sedghi Oct 10, 2023
5ba63bd
chore(version): version.json [skip ci]
ohif-bot Oct 10, 2023
132938b
chore(version): Update package versions [skip ci]
ohif-bot Oct 10, 2023
c3a5847
fix(i18n): display set(s) are two words for English messages (#3711)
jbocce Oct 10, 2023
a894b6f
chore(version): version.json [skip ci]
ohif-bot Oct 10, 2023
8067f0c
chore(version): Update package versions [skip ci]
ohif-bot Oct 10, 2023
a3f2a1a
fix(export): wrong export for the tmtv RT function (#3715)
sedghi Oct 11, 2023
6874d5f
chore(version): version.json [skip ci]
ohif-bot Oct 11, 2023
75c3f94
chore(version): Update package versions [skip ci]
ohif-bot Oct 11, 2023
157b88c
fix(display messages): broken after timings (#3719)
sedghi Oct 11, 2023
70ea13e
chore(version): version.json [skip ci]
ohif-bot Oct 11, 2023
3f9ee14
chore(version): Update package versions [skip ci]
ohif-bot Oct 11, 2023
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
e7c863a
Merge branch 'master' into patch/3.8.0-beta.36
m00n620 Dec 22, 2023
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
  •  
  •  
  •  
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"
}
}
10 changes: 10 additions & 0 deletions .webpack/rules/stylusToJavaScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const stylusToJavaScript = {
test: /\.styl$/,
use: [
{ loader: 'style-loader' }, // 3. Style nodes from JS Strings
{ loader: 'css-loader' }, // 2. CSS to CommonJS
{ loader: 'stylus-loader' }, // 1. Stylus to CSS
],
};

module.exports = stylusToJavaScript;
4 changes: 4 additions & 0 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const loadShadersRule = require('./rules/loadShaders.js');
const loadWebWorkersRule = require('./rules/loadWebWorkers.js');
const transpileJavaScriptRule = require('./rules/transpileJavaScript.js');
const cssToJavaScript = require('./rules/cssToJavaScript.js');
const stylusToJavaScript = require('./rules/stylusToJavaScript.js');

// ~~ ENV VARS
const NODE_ENV = process.env.NODE_ENV;
Expand Down Expand Up @@ -112,6 +113,9 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
},
},
cssToJavaScript,
// Note: Only uncomment the following if you are using the old style of stylus in v2
// Also you need to uncomment this platform/app/.webpack/rules/extractStyleChunks.js
// stylusToJavaScript,
{
test: /\.wasm/,
type: 'asset/resource',
Expand Down
Loading