Compare commits

..
848 Commits
Author SHA1 Message Date
ohif-bot 522531cc5c chore(version): Update package versions [skip ci] 2025-08-05 13:48:31 +00:00
ohif-bot 8c89d9472c chore(version): version.json [skip ci] 2025-08-05 13:48:23 +00:00
Alireza Sedghi 9d94e26d5d chore: release 3p11 2025-08-05 09:39:33 -04:00
ohif-bot 974ef29aa1 chore(version): Update package versions [skip ci] 2025-08-05 13:31:53 +00:00
ohif-bot a4d1f56c01 chore(version): version.json [skip ci] 2025-08-05 13:31:46 +00:00
Alireza 35bc074a53 fix(annotation): Add command to show pleura percentage in USAnnotationPanel and update condition for BLinePleuraPercentage (#5297) 2025-08-05 09:26:52 -04:00
ohif-bot 4d74611eb1 chore(version): Update package versions [skip ci] 2025-07-31 04:25:53 +00:00
ohif-bot 79cfc58533 chore(version): version.json [skip ci] 2025-07-31 04:25:47 +00:00
Pedro KöhlerandBill Wallace 735405a855 feat: add support to scoord3d (#5016)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-07-31 00:21:26 -04:00
ohif-bot af40f06524 chore(version): Update package versions [skip ci] 2025-07-30 14:12:33 +00:00
ohif-bot 568cd0b39d chore(version): version.json [skip ci] 2025-07-30 14:12:26 +00:00
rodrigobasilio2022 8643c868fd Adds containsAll validator (#5279) 2025-07-30 10:07:12 -04:00
ohif-bot eede2945ae chore(version): Update package versions [skip ci] 2025-07-30 02:35:07 +00:00
ohif-bot 1fc38c7379 chore(version): version.json [skip ci] 2025-07-30 02:35:00 +00:00
Pedro KöhlerandJoe Boccanfuso 271b84f78f feat: improve segment label (#5217)
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
2025-07-29 22:30:18 -04:00
ohif-bot dd896fea25 chore(version): Update package versions [skip ci] 2025-07-28 19:30:15 +00:00
ohif-bot 1e3f69d977 chore(version): version.json [skip ci] 2025-07-28 19:30:08 +00:00
Joe Boccanfuso 341f1c4ce7 fix(colorbar): Allow for AdvancedRenderingControls to be placed at the left or right of the viewport. (#5273) 2025-07-28 15:25:36 -04:00
ohif-bot b8ff0a80f0 chore(version): Update package versions [skip ci] 2025-07-28 16:25:07 +00:00
ohif-bot 760194ac80 chore(version): version.json [skip ci] 2025-07-28 16:24:59 +00:00
Joe Boccanfuso d24fe54d2b fix(colorbar): Allow for AdvancedRenderingControls to be placed at the top or bottom of the viewport. (#5270) 2025-07-28 12:19:58 -04:00
ohif-bot 1cc78112e5 chore(version): Update package versions [skip ci] 2025-07-28 13:42:43 +00:00
ohif-bot 0f816e4733 chore(version): version.json [skip ci] 2025-07-28 13:42:35 +00:00
Salim Kanoun 04dcacd3a5 fix: null save voi range properties (#5268) 2025-07-28 09:37:24 -04:00
Joe Boccanfuso 47e231f061 fix(multiframes): Corrected combining frame instances for multiframes. (#5264) 2025-07-28 09:35:29 -04:00
ohif-bot 4b7c26e273 chore(version): Update package versions [skip ci] 2025-07-28 05:41:04 +00:00
ohif-bot d45dc473ad chore(version): version.json [skip ci] 2025-07-28 05:40:57 +00:00
dxlin c766f3c054 test(SegmentationPanel): add test for jump to center of segments from PACS and basic add, rename, delete from panel (#5262) 2025-07-28 01:35:50 -04:00
ohif-bot 03941dca8e chore(version): Update package versions [skip ci] 2025-07-25 17:36:46 +00:00
ohif-bot be6e228c36 chore(version): version.json [skip ci] 2025-07-25 17:36:39 +00:00
Ibrahim 570e087007 fix(tooltips): tool tips should be portals (#5265) 2025-07-25 13:30:43 -04:00
ohif-bot afac23a79a chore(version): Update package versions [skip ci] 2025-07-25 13:47:18 +00:00
ohif-bot 3322f652fe chore(version): version.json [skip ci] 2025-07-25 13:47:10 +00:00
Emmanuel Ferdman d0cf9e02f4 fix: prevent failure in DICOM loader for wadouri type (#5260)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-07-25 09:41:53 -04:00
ohif-bot 84e3e43ae3 chore(version): Update package versions [skip ci] 2025-07-24 17:03:31 +00:00
ohif-bot 71b685364f chore(version): version.json [skip ci] 2025-07-24 17:03:24 +00:00
Joe Boccanfuso 3c8446a5e5 fix(ArrowAnnotate): Allow free-form text for arrow annotations (#5259) 2025-07-24 12:58:45 -04:00
ohif-bot 4e6530d1d8 chore(version): Update package versions [skip ci] 2025-07-23 22:13:34 +00:00
ohif-bot 0b87691d50 chore(version): version.json [skip ci] 2025-07-23 22:13:27 +00:00
Joe Boccanfuso 730046f83c Fix flaky SEGDataOverlayForUnreferencedDisplaySetNoHydration test. (#5254) 2025-07-23 18:08:42 -04:00
ohif-bot 763002f2fe chore(version): Update package versions [skip ci] 2025-07-23 19:10:24 +00:00
ohif-bot 76e630cf61 chore(version): version.json [skip ci] 2025-07-23 19:10:18 +00:00
arul-trenserandBill Wallace 428b6ffbe7 fix: issue introduced from PR 5022 (#5223)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-07-23 15:05:42 -04:00
ohif-bot 78597aacac chore(version): Update package versions [skip ci] 2025-07-23 18:20:06 +00:00
ohif-bot eacebad315 chore(version): version.json [skip ci] 2025-07-23 18:19:59 +00:00
MatheusRdkandCopilot c8261d9883 Handle 200 status response and add default error handling (#5227)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-23 14:14:08 -04:00
ohif-bot eedaa9a2e2 chore(version): Update package versions [skip ci] 2025-07-23 17:58:03 +00:00
ohif-bot fa37acc2fb chore(version): version.json [skip ci] 2025-07-23 17:57:56 +00:00
dependabot[bot]andJoe Boccanfuso 05526e5cdc chore(deps): bump axios from 1.10.0 to 1.11.0 (#5252)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
2025-07-23 13:53:02 -04:00
ohif-bot cf2e58bdb9 chore(version): Update package versions [skip ci] 2025-07-23 16:53:09 +00:00
ohif-bot 9b953f0942 chore(version): version.json [skip ci] 2025-07-23 16:53:02 +00:00
IbrahimandBill Wallace 75cc6eff32 fix(calibration): do not override user set calibration (#5231)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-07-23 12:48:29 -04:00
ohif-bot c271e869c2 chore(version): Update package versions [skip ci] 2025-07-23 16:27:02 +00:00
ohif-bot b71b14efdd chore(version): version.json [skip ci] 2025-07-23 16:26:55 +00:00
Teo Udovčić 7ffe17deea fix: disable seg download/export buttons until a user has drawn something (#4953) 2025-07-23 12:21:31 -04:00
ohif-bot dd2e89bfdb chore(version): Update package versions [skip ci] 2025-07-23 16:15:47 +00:00
ohif-bot 18f8c88a89 chore(version): version.json [skip ci] 2025-07-23 16:15:40 +00:00
Patrick WespiandJoe Boccanfuso bd3ff5f57c fix(ViewportOrientationMarkers): round rotation to fix floating point issue (#5135)
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
2025-07-23 12:10:49 -04:00
ohif-bot 04a599962d chore(version): Update package versions [skip ci] 2025-07-23 14:55:46 +00:00
ohif-bot 3be5d84fc4 chore(version): version.json [skip ci] 2025-07-23 14:55:40 +00:00
Joe Boccanfuso 83d4bc4a5a fix(security): Removed stylus package due to potential security vulnerability and we don't use it. (#5250) 2025-07-23 10:50:53 -04:00
Joe Boccanfuso 83ea0ad93e fix(docs): Added docs for multimonitor and local linking (#5247) 2025-07-23 10:14:01 -04:00
ohif-bot b77b2f3fa0 chore(version): Update package versions [skip ci] 2025-07-22 17:35:21 +00:00
ohif-bot 111c3b3d0d chore(version): version.json [skip ci] 2025-07-22 17:35:15 +00:00
76a2b90c17 chore(deps): bump form-data from 4.0.3 to 4.0.4 (#5244)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
2025-07-22 13:30:29 -04:00
ohif-bot aa83cda49c chore(version): Update package versions [skip ci] 2025-07-22 12:36:09 +00:00
ohif-bot 1ae4967fe5 chore(version): version.json [skip ci] 2025-07-22 12:36:02 +00:00
arul-trenser 12de7a85c9 feat(segmentation): Add customization for handling missing referencedDisplaySetInstanceUID for the SEG/RTSTRUCT. (#4983) 2025-07-22 08:30:54 -04:00
ohif-bot 91d0ae7da6 chore(version): Update package versions [skip ci] 2025-07-21 14:49:45 +00:00
ohif-bot f7fab0c461 chore(version): version.json [skip ci] 2025-07-21 14:49:38 +00:00
Joe Boccanfuso bde0eb1f07 fix(docs): Added entry for the showStudyList configuration setting. (#5235) 2025-07-21 10:44:28 -04:00
ohif-bot 73ee3140ea chore(version): Update package versions [skip ci] 2025-07-21 14:20:21 +00:00
ohif-bot 2a738dec09 chore(version): version.json [skip ci] 2025-07-21 14:20:15 +00:00
Joe Boccanfuso 3d5ee687cb fix(security): Pin eslint-config-prettier and eslint-plugin-prettier versions. (#5234) 2025-07-21 10:15:28 -04:00
ohif-bot 7060aeca4b chore(version): Update package versions [skip ci] 2025-07-21 13:11:39 +00:00
ohif-bot 5ecb8e9821 chore(version): version.json [skip ci] 2025-07-21 13:11:32 +00:00
Salim Kanoun ed3de96e4c fix: labelmap init (#5228) 2025-07-21 09:06:34 -04:00
ohif-bot db8a54d965 chore(version): Update package versions [skip ci] 2025-07-18 16:13:18 +00:00
ohif-bot 3980150aef chore(version): version.json [skip ci] 2025-07-18 16:13:10 +00:00
Joe Boccanfuso 3d4ec3181d fix(multimonitor): Study browser more menu fixes (#5208) 2025-07-18 12:08:18 -04:00
ohif-bot 779907e526 chore(version): Update package versions [skip ci] 2025-07-17 12:16:46 +00:00
ohif-bot 1841d6202f chore(version): version.json [skip ci] 2025-07-17 12:16:38 +00:00
arul-trenser 6a4ca70836 fix: image slices are displayed in reverse order, if we switch from common layout to 2D MPR (#5022) 2025-07-17 08:11:26 -04:00
ohif-bot 8dda7d5f81 chore(version): Update package versions [skip ci] 2025-07-16 18:45:48 +00:00
ohif-bot e207f58031 chore(version): version.json [skip ci] 2025-07-16 18:45:41 +00:00
Ibrahim faef74ab21 fix(viewportgrid): don't subscribe to duplicate event listeners (#5218) 2025-07-16 14:40:47 -04:00
Ibrahim 3ff9a65ef3 fix(black-viewports): MPR viewports were turning black if their parent stack had it's properties reset (#5219) 2025-07-16 14:40:20 -04:00
Alexey Klimovich 26d77fb149 fix(DicomUpload): Fix upload form and some scrollbars styles (#5125) 2025-07-16 14:38:11 -04:00
ohif-bot 5977326665 chore(version): Update package versions [skip ci] 2025-07-16 17:18:03 +00:00
ohif-bot 27e4f0440c chore(version): version.json [skip ci] 2025-07-16 17:17:56 +00:00
Vishnu Suresh Perumbavoor f38805e6f1 fix(segmentation): Fix segmentationid undefined 5106 (#5107) 2025-07-16 13:12:47 -04:00
ohif-bot a7892c0d59 chore(version): Update package versions [skip ci] 2025-07-16 00:15:39 +00:00
ohif-bot 991f17e0ca chore(version): version.json [skip ci] 2025-07-16 00:15:32 +00:00
Joe Boccanfuso 522d2aa764 fix(TMTV): The TMTV CSV file now has the correct name and contents (#5215) 2025-07-15 20:09:23 -04:00
ohif-bot fceb515a68 chore(version): Update package versions [skip ci] 2025-07-15 13:07:36 +00:00
ohif-bot e1fb97f862 chore(version): version.json [skip ci] 2025-07-15 13:07:29 +00:00
Joe Boccanfuso e0289dc49f fix(segmentation): Removed LOAD/hydrate button for segmentation overlays (#5214) 2025-07-15 09:02:36 -04:00
ohif-bot 302705ea4d chore(version): Update package versions [skip ci] 2025-07-14 15:55:44 +00:00
ohif-bot ff0568f2ab chore(version): version.json [skip ci] 2025-07-14 15:55:36 +00:00
Joe Boccanfuso 545411137c fix(panels): Allow for setting the initial and minimum expanded widths of each side panel. (#5207) 2025-07-14 11:50:27 -04:00
ohif-bot 1f33b291b9 chore(version): Update package versions [skip ci] 2025-07-14 13:15:07 +00:00
ohif-bot 768e5ba928 chore(version): version.json [skip ci] 2025-07-14 13:15:00 +00:00
c175837273 feat(viewport): Enhance Orientation Menu with Reformat Option and UI Improvements (#5184)
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
Co-authored-by: Alireza <ar.sedghi@gmail.com>
2025-07-14 09:10:09 -04:00
ohif-bot 529806c0d9 chore(version): Update package versions [skip ci] 2025-07-14 02:39:23 +00:00
ohif-bot 658d824505 chore(version): version.json [skip ci] 2025-07-14 02:39:16 +00:00
Joe Boccanfuso 94bdcf414d fix(UI): Restored the scroll bar OHIF L&F (#5202) 2025-07-13 22:34:18 -04:00
ohif-bot a24ec13239 chore(version): Update package versions [skip ci] 2025-07-11 21:20:32 +00:00
ohif-bot 2c7c62443c chore(version): version.json [skip ci] 2025-07-11 21:20:25 +00:00
rodrigobasilio2022 540923ad8b fix: enhance preview accept method (#5199) 2025-07-11 17:15:26 -04:00
ohif-bot df926e2513 chore(version): Update package versions [skip ci] 2025-07-11 20:43:30 +00:00
ohif-bot 86ad50d886 chore(version): version.json [skip ci] 2025-07-11 20:43:23 +00:00
Dan Rukas 0ed9ef06c1 ui(icons): Adds action and helper icon artwork for segmentation (#5200) 2025-07-11 16:38:11 -04:00
Vinícius Alves de Faria Resende 4a59126dd9 fix(UnitTests): Fixing "Cannot find module @cornerstonejs/core" error while running unit tests (#5148) 2025-07-11 16:36:49 -04:00
ohif-bot 277cef2168 chore(version): Update package versions [skip ci] 2025-07-11 17:49:56 +00:00
ohif-bot 168d5b27f3 chore(version): version.json [skip ci] 2025-07-11 17:49:48 +00:00
rodrigobasilio2022 fd5bcee909 fix: exception in newly added segmentations (#5198) 2025-07-11 13:44:22 -04:00
ohif-bot 8bbf83fb84 chore(version): Update package versions [skip ci] 2025-07-11 16:38:14 +00:00
ohif-bot 4253982050 chore(version): version.json [skip ci] 2025-07-11 16:38:07 +00:00
Ibrahim 10d93161b4 feat(rendering): Introduce WebGLContextPool for parallel rendering in ContextPoolRenderingEngine (#5196) 2025-07-11 12:33:24 -04:00
ohif-bot 7d3e222182 chore(version): Update package versions [skip ci] 2025-07-11 15:30:57 +00:00
ohif-bot 46df245fb8 chore(version): version.json [skip ci] 2025-07-11 15:30:50 +00:00
Pedro Köhler 4d3ff5a6cc feat: group clear measurements history (#5194) 2025-07-11 11:26:10 -04:00
ohif-bot 4e99f1ed34 chore(version): Update package versions [skip ci] 2025-07-11 13:48:44 +00:00
ohif-bot 2ddeed981d chore(version): version.json [skip ci] 2025-07-11 13:48:38 +00:00
Joe Boccanfuso eeaf49c61a fix(security): Patch for Babel vulnerability (#5193) 2025-07-11 09:43:56 -04:00
ohif-bot 2c1e8cb3e1 chore(version): Update package versions [skip ci] 2025-07-10 14:28:05 +00:00
ohif-bot f772be8ae3 chore(version): version.json [skip ci] 2025-07-10 14:27:58 +00:00
Ibrahim 4c5e34d183 fix(rendering): Introduce SequentialRenderingEngine to resolve canvas size limitation, performance degradation on high res monitors and enhance multi-monitor support (#5195) 2025-07-10 10:23:09 -04:00
ohif-bot 0c62bd5e4e chore(version): Update package versions [skip ci] 2025-07-10 13:38:17 +00:00
ohif-bot 4424d2a2bc chore(version): version.json [skip ci] 2025-07-10 13:38:10 +00:00
Joe Boccanfuso 48473625f6 fix(segmentation overlays): Allow for the addition of multiple segmentation overlays. (#5189) 2025-07-10 09:33:39 -04:00
ohif-bot 32ab291305 chore(version): Update package versions [skip ci] 2025-07-09 18:16:44 +00:00
ohif-bot 93eb0dee19 chore(version): version.json [skip ci] 2025-07-09 18:16:38 +00:00
Pedro Köhler ac852485cd feat: add segment label tool (#5164) 2025-07-09 14:11:54 -04:00
ohif-bot d19cd6ec7b chore(version): Update package versions [skip ci] 2025-07-08 14:25:44 +00:00
ohif-bot 4556dd9713 chore(version): version.json [skip ci] 2025-07-08 14:25:37 +00:00
Ibrahim 7b2e37a44f fix(measurement-group): use measurment study uid instead of active study uid (#5091) 2025-07-08 10:20:49 -04:00
Ibrahim 64a634cab9 fix(labeling): measurement labeling dialog was overwriting the entire measurement and breaking it (#5095) 2025-07-08 10:19:18 -04:00
ohif-bot ca7defc668 chore(version): Update package versions [skip ci] 2025-07-07 22:14:28 +00:00
ohif-bot e5b95de0b0 chore(version): version.json [skip ci] 2025-07-07 22:14:21 +00:00
Joe Boccanfuso f08cc303e6 fix(overlay-menu): Adding, changing and removing segmentation overlays should update the overlay menu instantly (#5181) 2025-07-07 18:09:32 -04:00
ohif-bot b8b14b8940 chore(version): Update package versions [skip ci] 2025-07-03 18:19:12 +00:00
ohif-bot 7f19db7f0e chore(version): version.json [skip ci] 2025-07-03 18:19:05 +00:00
Salim Kanoun e277303395 fix: add force to remove image from cache (#5176) 2025-07-03 14:14:19 -04:00
ohif-bot f7cf356d46 chore(version): Update package versions [skip ci] 2025-07-03 18:13:29 +00:00
ohif-bot baad251259 chore(version): version.json [skip ci] 2025-07-03 18:13:23 +00:00
24e0263fb9 chore: recovery 2 (#5014) merge to 3.11 (#5175)
Co-authored-by: Alireza <ar.sedghi@gmail.com>
Co-authored-by: Dan Rukas <dan.rukas@gmail.com>
Co-authored-by: Tang Cheng <45505657+tctco@users.noreply.github.com>
2025-07-03 14:08:46 -04:00
ohif-bot 17ed63eb1d chore(version): Update package versions [skip ci] 2025-07-03 02:57:54 +00:00
ohif-bot 6f8592a449 chore(version): version.json [skip ci] 2025-07-03 02:57:48 +00:00
Celian-abd c112db13a8 feat: Add possibility to add additional props for PanelSection (#5172) 2025-07-02 22:52:49 -04:00
ohif-bot b0704b88cd chore(version): Update package versions [skip ci] 2025-07-02 12:43:01 +00:00
ohif-bot 8491407319 chore(version): version.json [skip ci] 2025-07-02 12:42:54 +00:00
Joe Boccanfuso 4f6f5254fb fix(segmentation): Added support for unhydrated RTSTRUCT in MPR. Added support for overlaying segmentations over display sets the segmentations do not reference. (#5168) 2025-07-02 08:38:22 -04:00
ohif-bot 77758fde4f chore(version): Update package versions [skip ci] 2025-06-27 17:13:02 +00:00
ohif-bot 90943b4dc5 chore(version): version.json [skip ci] 2025-06-27 17:12:55 +00:00
Ibrahim 4bddd53fcd feat(hp): add onStageChange callback (#5165) 2025-06-27 13:08:21 -04:00
ohif-bot c2b75e1a50 chore(version): Update package versions [skip ci] 2025-06-27 11:16:22 +00:00
ohif-bot 51f17a92c1 chore(version): version.json [skip ci] 2025-06-27 11:16:15 +00:00
Joe Boccanfuso c2624f116d fix(segmentation): Changes to fix problems with non hydrated/loaded segmentations to be viewable when switching hanging protocols (e.g. MPR) (#5139) 2025-06-27 07:11:46 -04:00
ohif-bot 9a81f8cef5 chore(version): Update package versions [skip ci] 2025-06-27 03:02:26 +00:00
ohif-bot 8a35453100 chore(version): version.json [skip ci] 2025-06-27 03:02:20 +00:00
dependabot[bot] b660a5d523 chore(deps): bump webpack to 5.95.0 (#5163) 2025-06-26 22:57:43 -04:00
ohif-bot da8ecdd88c chore(version): Update package versions [skip ci] 2025-06-26 20:24:13 +00:00
ohif-bot ef5ce6c19b chore(version): version.json [skip ci] 2025-06-26 20:24:06 +00:00
dependabot[bot] c063fe8550 chore(deps-dev): bump webpack from 5.89.0 to 5.94.0 in /extensions/usAnnotation (#5162) 2025-06-26 16:18:57 -04:00
ohif-bot 5524d1e845 chore(version): Update package versions [skip ci] 2025-06-26 16:04:50 +00:00
ohif-bot 27eb442f62 chore(version): version.json [skip ci] 2025-06-26 16:04:44 +00:00
rodrigobasilio2022 9824f79177 feat(labelmap): Add labelmap segmentation in OHIF (#5158) 2025-06-26 11:59:44 -04:00
ohif-bot e07bb212bb chore(version): Update package versions [skip ci] 2025-06-26 12:48:28 +00:00
ohif-bot 2a06a3c17f chore(version): version.json [skip ci] 2025-06-26 12:48:21 +00:00
dependabot[bot] 4c1356cab7 chore(deps-dev): bump webpack from 5.89.0 to 5.94.0 in /modes/usAnnotation (#5156) 2025-06-26 08:43:27 -04:00
ohif-bot a17fb5aeba chore(version): Update package versions [skip ci] 2025-06-25 22:43:05 +00:00
ohif-bot b919ebbc41 chore(version): version.json [skip ci] 2025-06-25 22:42:59 +00:00
Joe Boccanfuso ec0c4f7451 fix(unit-tests): Update bun.lock to fix unit tests. (#5159) 2025-06-25 18:38:36 -04:00
ohif-bot 746781f6a4 chore(version): Update package versions [skip ci] 2025-06-25 22:13:21 +00:00
ohif-bot 332d498d2c chore(version): version.json [skip ci] 2025-06-25 22:13:14 +00:00
Alireza 6c9d99eef8 fix(build): BUILD_PACKAGES_QUICK PR check (#5160) 2025-06-25 18:07:52 -04:00
Ibrahim 57f07ad9f2 feat(toolbar/hokeys): add pub sub events to hotkeys manager class, subscribe toolbar to hotkeys pressed event (#5157) 2025-06-25 10:43:27 -04:00
dxlin b1ad3787e4 test(MeasurementPanel): Converted MeasurementPanel interaction tests from cypress to playwright (#5153) 2025-06-24 23:33:21 -04:00
rodrigobasilio2022 226f9b0773 feat: Ultrasound Pleura B-line Annotation Mode & Extension (#5061) 2025-06-24 12:50:48 -04:00
ohif-bot 9b8eef9474 chore(version): Update package versions [skip ci] 2025-06-24 15:50:18 +00:00
ohif-bot 1e605027ff chore(version): version.json [skip ci] 2025-06-24 15:50:11 +00:00
b48aab263f chore(deps-dev): bump webpack-dev-server from 4.7.3 to 5.2.1 (#5114)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
2025-06-24 11:45:29 -04:00
dependabot[bot] 08d978bd75 chore(deps): bump pbkdf2 from 3.1.2 to 3.1.3 (#5152)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-24 11:43:19 -04:00
ohif-bot 4857e0002b chore(version): Update package versions [skip ci] 2025-06-20 15:31:20 +00:00
ohif-bot 9ed2d88cb1 chore(version): version.json [skip ci] 2025-06-20 15:31:13 +00:00
Ibrahim d6d3fa7ef4 fix(action-corners): check hideWhenDisabled at both the evaluator and prop levels (#5149) 2025-06-20 11:26:26 -04:00
ohif-bot 3f1ea26eba chore(version): Update package versions [skip ci] 2025-06-18 18:20:36 +00:00
ohif-bot 9f80732674 chore(version): version.json [skip ci] 2025-06-18 18:20:30 +00:00
Vinícius Alves de Faria Resende 268d62e991 fix(UnitTest): run was failing due to JS tests importing TS modules (#5145) 2025-06-18 14:15:50 -04:00
ohif-bot f6337e0970 chore(version): Update package versions [skip ci] 2025-06-18 03:08:58 +00:00
ohif-bot 2ed6172861 chore(version): version.json [skip ci] 2025-06-18 03:08:52 +00:00
Patrick Wespi dc829c8fca fix(getToolbarModule): fix enabled state of image slice sync (#5136) 2025-06-17 23:03:51 -04:00
ohif-bot afc2ca0dce chore(version): Update package versions [skip ci] 2025-06-13 14:48:30 +00:00
ohif-bot abb6da4458 chore(version): version.json [skip ci] 2025-06-13 14:48:22 +00:00
Joe BoccanfusoandBill Wallace 5311c941f7 fix(hp): When reapplying an hp the display set selectors should be considered. (#5074)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-06-13 10:43:31 -04:00
ohif-bot 4199d788a8 chore(version): Update package versions [skip ci] 2025-06-11 16:41:58 +00:00
ohif-bot 40eac04428 chore(version): version.json [skip ci] 2025-06-11 16:41:51 +00:00
dependabot[bot] abaf6582e0 chore(deps): bump tar-fs from 2.1.2 to 2.1.3 (#5096)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 12:37:24 -04:00
ohif-bot ce70c8401a chore(version): Update package versions [skip ci] 2025-06-11 13:05:36 +00:00
ohif-bot a906eb04ab chore(version): version.json [skip ci] 2025-06-11 13:05:29 +00:00
DanandDan Elkis d3c9ff50c7 fix(ToolbarService): Fixed removeButton bug for removing buttons inside sections (#5123)
Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
2025-06-11 09:00:54 -04:00
DanandDan Elkis 4da7fc307f feat(commandsModule): Enhanced flipViewport and rotateViewport commands (#5065)
Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
2025-06-11 08:59:37 -04:00
ohif-bot 68bbe0b1a5 chore(version): Update package versions [skip ci] 2025-06-11 11:41:43 +00:00
ohif-bot d15494f80c chore(version): version.json [skip ci] 2025-06-11 11:41:36 +00:00
Bill Wallace 75271ca416 fix: data-viewportId name is illegal, renamed to data-viewportid (#5121) 2025-06-11 07:36:26 -04:00
ohif-bot a83bd298f5 chore(version): Update package versions [skip ci] 2025-06-10 15:52:05 +00:00
ohif-bot 8ff59dacb5 chore(version): version.json [skip ci] 2025-06-10 15:51:59 +00:00
IbrahimandBill Wallace 26fd51f535 fix(markerlabelmap): accept preview/reject preview not working when the marker annotation tools are active (#5101)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
2025-06-10 11:47:20 -04:00
ohif-bot 10ef509ff1 chore(version): Update package versions [skip ci] 2025-06-09 13:32:53 +00:00
ohif-bot 735a13a85b chore(version): version.json [skip ci] 2025-06-09 13:32:47 +00:00
Joe Boccanfuso a361e556ef fix(touch): Prevent touch drag to refresh the browser page. (#5108) 2025-06-09 09:28:00 -04:00
ohif-bot 9baf153d0d chore(version): Update package versions [skip ci] 2025-06-09 12:34:55 +00:00
ohif-bot b99f64da1b chore(version): version.json [skip ci] 2025-06-09 12:34:48 +00:00
Alireza b194f672c0 docs: improved migration guides for 3p10 (#5110) 2025-06-09 08:30:20 -04:00
ohif-bot 635877f184 chore(version): Update package versions [skip ci] 2025-06-07 17:59:59 +00:00
ohif-bot 2306ec2a6d chore(version): version.json [skip ci] 2025-06-07 17:59:53 +00:00
Joe Boccanfuso 0afb3fc753 fix(WindowLevelActionMenu): The window level menu must show different contents for 3D volume viewports (#5113) 2025-06-07 13:55:33 -04:00
ohif-bot 2234121a19 chore(version): Update package versions [skip ci] 2025-06-05 17:55:24 +00:00
ohif-bot a1ecc826aa chore(version): version.json [skip ci] 2025-06-05 17:55:17 +00:00
Joe Boccanfuso 1a6aa09a77 fix(touch): Allow for multi-touch in OHIF (#5099) 2025-06-05 13:50:27 -04:00
ohif-bot 2e7124bace chore(version): Update package versions [skip ci] 2025-06-02 17:59:54 +00:00
ohif-bot 2ddfc95bfa chore(version): version.json [skip ci] 2025-06-02 17:59:48 +00:00
Joe Boccanfuso 316d5a7644 fix(tmtv): Corrected the various section names being referenced. (#5093) 2025-06-02 13:55:32 -04:00
ohif-bot 01c7d45c15 chore(version): Update package versions [skip ci] 2025-06-02 16:17:00 +00:00
ohif-bot e804d7473e chore(version): version.json [skip ci] 2025-06-02 16:16:54 +00:00
Joe Boccanfuso 38ed7ba744 fix(segmentation): Allow for debounced pub/sub events to be reliably cancelled when unsubscribed to. (#5092) 2025-06-02 12:12:31 -04:00
ohif-bot a1fb7217bd chore(version): Update package versions [skip ci] 2025-05-30 14:16:22 +00:00
ohif-bot 8adbeb54f9 chore(version): version.json [skip ci] 2025-05-30 14:16:16 +00:00
DanandDan Elkis 8b2f80b82e docs: Fixed incorrect documentation and variables names (#5080)
Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
2025-05-30 10:11:16 -04:00
ohif-bot 31e19ffe8c chore(version): Update package versions [skip ci] 2025-05-29 12:30:56 +00:00
ohif-bot 4f6c8766b1 chore(version): version.json [skip ci] 2025-05-29 12:30:49 +00:00
Pedro Köhler 5891505c51 feat: create memo when manually adding and removing annotations (#5051) 2025-05-29 08:26:16 -04:00
ohif-bot 9afded1720 chore(version): Update package versions [skip ci] 2025-05-29 02:45:33 +00:00
ohif-bot 60e6e686ec chore(version): version.json [skip ci] 2025-05-29 02:45:26 +00:00
Alireza c6327acdc1 fix(ui): Prevent unintended text selection and improve component behavior (#5077) 2025-05-28 22:41:15 -04:00
ohif-bot 773d6edaf7 chore(version): Update package versions [skip ci] 2025-05-28 13:13:03 +00:00
ohif-bot 843d99d9ef chore(version): version.json [skip ci] 2025-05-28 13:12:56 +00:00
DanandDan Elkis c88bdac4b1 fix(Customization): Fixed incorrect events broadcast (#5075)
Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
2025-05-28 09:08:05 -04:00
ohif-bot a8d438d8f7 chore(version): Update package versions [skip ci] 2025-05-26 23:13:44 +00:00
ohif-bot fec45860b8 chore(version): version.json [skip ci] 2025-05-26 23:13:38 +00:00
Alireza b9ca76ea67 fix: e2e playwright tests runnigns (#5070) 2025-05-26 19:09:26 -04:00
ohif-bot ffc7d2bd6b chore(version): Update package versions [skip ci] 2025-05-26 20:12:50 +00:00
ohif-bot 1d91871d2c chore(version): version.json [skip ci] 2025-05-26 20:12:43 +00:00
Joe Boccanfuso ebfa1ff5f2 fix(capture): Disable or enable the tool group based on the show flag. (#5069) 2025-05-26 16:08:17 -04:00
Joe Boccanfuso 1873a8405f fix(frame-view): After pan and/or zoom, stack scroll is now synchronized for frame view (#5067) 2025-05-26 16:08:01 -04:00
ohif-bot df35cb55b6 chore(version): Update package versions [skip ci] 2025-05-26 04:09:21 +00:00
ohif-bot 9247d07ccd chore(version): version.json [skip ci] 2025-05-26 04:09:15 +00:00
Joe Boccanfuso 14f5f0c074 fix(router): Expose the react router from the worklist too. (#5062) 2025-05-26 00:04:16 -04:00
ohif-bot c2cc0832f3 chore(version): Update package versions [skip ci] 2025-05-24 02:16:33 +00:00
ohif-bot 10d64322bf chore(version): version.json [skip ci] 2025-05-24 02:16:27 +00:00
Joe Boccanfuso cb814e6a60 fix(context-menu): Move the reposition logic from the context menu to the dialog component. (#5060) 2025-05-23 22:12:08 -04:00
ohif-bot fa9bbe3afc chore(version): Update package versions [skip ci] 2025-05-16 18:20:40 +00:00
ohif-bot 7f2f739b1b chore(version): version.json [skip ci] 2025-05-16 18:20:34 +00:00
Alexis jankowski dcde841839 fix(cli): removing missing imports in mode template (#5049) 2025-05-16 14:11:01 -04:00
ohif-bot c784b7e6d5 chore(version): Update package versions [skip ci] 2025-05-16 17:53:12 +00:00
ohif-bot 0d8f43fa30 chore(version): version.json [skip ci] 2025-05-16 17:53:05 +00:00
Alireza 9b1b501d83 fix: backward compatibility with toolbar service (#5052) 2025-05-16 13:42:35 -04:00
Joe Boccanfuso c6b28654b5 fix(segmentation): segmentation stats calculations were not being done on a subsequent navigation to a mode (#5046) 2025-05-16 13:33:57 -04:00
ohif-bot fb1c2673a8 chore(version): Update package versions [skip ci] 2025-05-16 17:32:07 +00:00
ohif-bot b6b06ed09e chore(version): version.json [skip ci] 2025-05-16 17:32:01 +00:00
Joe Boccanfuso 338bd865c3 feat(viewport): Added getter for presentation id provider. (#5053) 2025-05-16 13:22:09 -04:00
ohif-bot cf1018c779 chore(version): Update package versions [skip ci] 2025-05-15 21:22:31 +00:00
ohif-bot 0f12fa16bc chore(version): version.json [skip ci] 2025-05-15 21:22:25 +00:00
Dan Rukasandsedghi 04ab79f8fb ui(feat): Adds light/dark mode support for viewport overlay text and markers (#5041)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-05-15 17:12:53 -04:00
ohif-bot 1fd39626e7 chore(version): Update package versions [skip ci] 2025-05-15 16:18:22 +00:00
ohif-bot 5e406a8c93 chore(version): version.json [skip ci] 2025-05-15 16:18:15 +00:00
Alireza 7c15bb8901 feat(actions): simplify action corner api through the toolbarService (#5033) 2025-05-15 12:08:12 -04:00
ohif-bot f71b88e639 chore(version): Update package versions [skip ci] 2025-05-13 15:29:21 +00:00
ohif-bot faaaccdfa7 chore(version): version.json [skip ci] 2025-05-13 15:29:14 +00:00
Celian-abd da51e6e3c1 fix: Added missing export for LayoutSelector in ui-next (#5040) 2025-05-13 11:24:25 -04:00
ohif-bot 4a91dfdfa5 chore(version): Update package versions [skip ci] 2025-05-12 13:39:55 +00:00
ohif-bot c2534198ad chore(version): version.json [skip ci] 2025-05-12 13:39:48 +00:00
Dan 950453fd70 fix(NotFoundStudy): Fixed the viewer not-found page when showStudyList: false (#5035) 2025-05-12 09:35:33 -04:00
ohif-bot f4ba9b3cc6 chore(version): Update package versions [skip ci] 2025-05-09 12:24:02 +00:00
ohif-bot 7610b4c6a5 chore(version): version.json [skip ci] 2025-05-09 12:23:55 +00:00
taliabeckie 349306da40 fix(DicomWebProxyDataSource): bug fix to save Segmentation files back to Kheops (#5028) 2025-05-09 08:19:20 -04:00
ohif-bot 66322c68a2 chore(version): Update package versions [skip ci] 2025-05-08 16:56:20 +00:00
ohif-bot 4e03f34fd4 chore(version): version.json [skip ci] 2025-05-08 16:56:14 +00:00
Alireza 1445e12124 feat(app): Decouple colorbar UI from service and enable action menu programatic control (#5018) 2025-05-08 12:51:30 -04:00
ohif-bot f14d9ebdd7 chore(version): Update package versions [skip ci] 2025-05-08 16:49:34 +00:00
ohif-bot a3bf972177 chore(version): version.json [skip ci] 2025-05-08 16:49:26 +00:00
Bill WallaceandMartin Bellehumeur, M. Eng. 578c3939f0 feat(thumbnails): Enhance DICOM Thumbnail Rendering with different strategies (#5004)
Co-authored-by: Martin Bellehumeur, M. Eng. <23396581+mbellehumeur@users.noreply.github.com>
2025-05-08 12:44:56 -04:00
ohif-bot dee6909a99 chore(version): Update package versions [skip ci] 2025-05-07 21:41:38 +00:00
ohif-bot 12094cc77a chore(version): version.json [skip ci] 2025-05-07 21:41:32 +00:00
Alireza a5ea3e15c7 fix(orientationMarker): MPR orientation change should get reflected too (#5020) 2025-05-07 17:37:12 -04:00
ohif-bot f412dc254b chore(version): Update package versions [skip ci] 2025-05-07 20:24:55 +00:00
ohif-bot c0ed128fb7 chore(version): version.json [skip ci] 2025-05-07 20:24:49 +00:00
Rafael Osipov c829270c80 feat: add locale files for Russian language, translated texts in locale json files to Russian language. (#4984) 2025-05-07 16:20:10 -04:00
ohif-bot a16d612a8a chore(version): Update package versions [skip ci] 2025-05-06 15:10:20 +00:00
ohif-bot 5f94ebe81a chore(version): version.json [skip ci] 2025-05-06 15:10:13 +00:00
Ibrahim 8218a9d034 feat(i18n): add Arabic translations (#5013) 2025-05-06 11:05:34 -04:00
ohif-bot 4b94f18f7c chore(version): Update package versions [skip ci] 2025-05-05 20:40:11 +00:00
ohif-bot 8e7e9ca02f chore(version): version.json [skip ci] 2025-05-05 20:40:04 +00:00
Alireza cd4e6408bc feat(data overlay): add foreground background control plus orientation change in the UI and add RTDOSE support (#5007) 2025-05-05 16:35:05 -04:00
ohif-bot c1fced0573 chore(version): Update package versions [skip ci] 2025-05-05 15:32:36 +00:00
ohif-bot e41019f2b3 chore(version): version.json [skip ci] 2025-05-05 15:32:30 +00:00
Alireza 383f45823c refactor(viewport): Remove resize detector and optimize viewport resizing logic (#5006) 2025-05-05 11:27:26 -04:00
ohif-bot 6337d2e9cb chore(version): Update package versions [skip ci] 2025-05-02 18:50:57 +00:00
ohif-bot e987710908 chore(version): version.json [skip ci] 2025-05-02 18:50:50 +00:00
Pedro Köhler 7dbe5e37b0 feat: improve menu modals customizations (#5011) 2025-05-02 14:45:39 -04:00
ohif-bot ff974e2a03 chore(version): Update package versions [skip ci] 2025-05-02 18:10:04 +00:00
ohif-bot cccf74d6ea chore(version): version.json [skip ci] 2025-05-02 18:09:57 +00:00
Alireza 4be8495335 fix/remove legacy ui (#5010) 2025-05-02 14:05:40 -04:00
ohif-bot 1cb8d328a4 chore(version): Update package versions [skip ci] 2025-05-01 22:22:48 +00:00
ohif-bot 2c8dda01ae chore(version): version.json [skip ci] 2025-05-01 22:22:42 +00:00
Alireza 4e185e4b21 docs: add llm txt (#5009) 2025-05-01 18:13:21 -04:00
ohif-bot 4732e8093e chore(version): Update package versions [skip ci] 2025-05-01 18:51:19 +00:00
ohif-bot 984471e972 chore(version): version.json [skip ci] 2025-05-01 18:51:13 +00:00
Julia Young 25cb71b3f6 docs: clarify terminology for study, series, and display sets (#5000) 2025-05-01 14:46:21 -04:00
ohif-bot 0e75f6d62c chore(version): Update package versions [skip ci] 2025-04-30 16:29:06 +00:00
ohif-bot d75b3e25b6 chore(version): version.json [skip ci] 2025-04-30 16:28:59 +00:00
Tang Cheng 0bb9b17636 Fix: issue #4759 Enable proper DICOM image rendering when Rescale parameters are set to null (#5003) 2025-04-30 12:24:06 -04:00
ohif-bot b21ee9bc5b chore(version): Update package versions [skip ci] 2025-04-29 18:58:50 +00:00
ohif-bot 7ed0f6d53b chore(version): version.json [skip ci] 2025-04-29 18:58:44 +00:00
Alireza 98f8187dfe fix(referencelines): and bring back the notification for worker updates but disallow duplication (#5005) 2025-04-29 14:53:37 -04:00
ohif-bot 4643d6dc40 chore(version): Update package versions [skip ci] 2025-04-29 17:02:30 +00:00
ohif-bot 258b353269 chore(version): version.json [skip ci] 2025-04-29 17:02:23 +00:00
devin-ai-integration[bot]andAlireza Sedghi 0f39496290 fix(template): Update mode template to match current implementation (OHI-1833) (#4998)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alireza Sedghi <ar.sedghi@gmail.com>
2025-04-29 12:57:24 -04:00
ohif-bot 325cb3f7d5 chore(version): Update package versions [skip ci] 2025-04-22 17:33:27 +00:00
ohif-bot 088b563bf6 chore(version): version.json [skip ci] 2025-04-22 17:33:21 +00:00
Dan Rukas 09ac43f297 fix(docs): Fix SSR build errors by dynamically importing UI components and resolving other issues (#4991) 2025-04-22 13:28:49 -04:00
ohif-bot d59828ab22 chore(version): Update package versions [skip ci] 2025-04-22 14:50:19 +00:00
ohif-bot 5f04b0f3be chore(version): version.json [skip ci] 2025-04-22 14:50:12 +00:00
Alireza bdb847a6eb fix docs (#4988) 2025-04-22 10:45:14 -04:00
ohif-bot 0052bf1ae3 chore(version): Update package versions [skip ci] 2025-04-22 14:05:34 +00:00
ohif-bot 41815ee2af chore(version): version.json [skip ci] 2025-04-22 14:05:28 +00:00
Alireza 56fdb82812 fix docs (#4986) 2025-04-22 10:00:40 -04:00
ohif-bot fcde5ddbce chore(version): Update package versions [skip ci] 2025-04-22 13:20:21 +00:00
ohif-bot 7818f406d8 chore(version): version.json [skip ci] 2025-04-22 13:20:15 +00:00
Dan Rukas 329d5b6237 docs(components): Adds new components to ui-next documentation (#4974) 2025-04-22 09:15:40 -04:00
Devu-trenser 3b8faa8a76 feat: Improve unsupported displayset messages (#4979) 2025-04-22 09:11:28 -04:00
ohif-bot 59136e5435 chore(version): Update package versions [skip ci] 2025-04-18 15:38:25 +00:00
ohif-bot 88fccda491 chore(version): version.json [skip ci] 2025-04-18 15:38:19 +00:00
Pedro Köhler 5688a2b4b8 fix(dicomWebClient): use public getter for activeDataSourceName instead of accessing private property (#4973) 2025-04-18 11:33:42 -04:00
ohif-bot f02ce22ae3 chore(version): Update package versions [skip ci] 2025-04-17 20:49:39 +00:00
ohif-bot ff5a152270 chore(version): version.json [skip ci] 2025-04-17 20:49:33 +00:00
dependabot[bot] 082014a694 chore(deps): bump estree-util-value-to-estree from 3.2.1 to 3.3.3 in /platform/docs (#4929)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 16:43:55 -04:00
dependabot[bot] 194b4971c2 chore(deps): bump @babel/runtime from 7.26.0 to 7.27.0 in /platform/docs (#4964)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 16:43:48 -04:00
dependabot[bot] d6c7b9c23c chore(deps): bump http-proxy-middleware from 2.0.7 to 2.0.9 (#4963)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 16:43:39 -04:00
dependabot[bot] b82465344c chore(deps): bump @babel/runtime-corejs3 from 7.24.7 to 7.27.0 (#4962)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 16:43:30 -04:00
ohif-bot f8cb810b92 chore(version): Update package versions [skip ci] 2025-04-17 12:36:52 +00:00
ohif-bot dbda78df15 chore(version): version.json [skip ci] 2025-04-17 12:36:45 +00:00
Pedro Köhler 66a16cd22f fix(ExtensionManager): getDataSources method (#4959) 2025-04-17 08:31:12 -04:00
ohif-bot 5a9fcd4bf0 chore(version): Update package versions [skip ci] 2025-04-16 21:40:06 +00:00
ohif-bot 69cddff628 chore(version): version.json [skip ci] 2025-04-16 21:40:00 +00:00
Alireza 08c14e9ba2 fix/runner (#4971) 2025-04-16 17:35:32 -04:00
Alireza 7fd522ab68 fix/runner (#4970) 2025-04-16 16:57:59 -04:00
Alireza df74557866 fix/runner (#4969) 2025-04-16 16:49:36 -04:00
Alireza 69063a41b7 fix/runner (#4968) 2025-04-16 16:41:35 -04:00
Alireza 41fb597085 fix/runner4 (#4967) 2025-04-16 16:31:24 -04:00
ohif-bot a3a35471a9 chore(version): Update package versions [skip ci] 2025-04-16 20:21:17 +00:00
ohif-bot a0bcac15cd chore(version): version.json [skip ci] 2025-04-16 20:21:10 +00:00
Alireza ac7875128c fix/runner (#4966) 2025-04-16 16:16:28 -04:00
Alireza bd02205ef9 fix/runner (#4965) 2025-04-16 16:09:06 -04:00
Alireza 9535422361 fix: github runner (#4961) 2025-04-16 16:02:06 -04:00
ohif-bot a13380407b chore(version): Update package versions [skip ci] 2025-04-16 20:01:50 +00:00
ohif-bot 1a0d7a930c chore(version): version.json [skip ci] 2025-04-16 20:01:43 +00:00
Alireza 91117f40f8 chore: add test coverage (#4960) 2025-04-16 15:56:52 -04:00
ohif-bot a41ed3bade chore(version): Update package versions [skip ci] 2025-04-14 14:05:04 +00:00
ohif-bot f12f2bfec5 chore(version): version.json [skip ci] 2025-04-14 14:04:58 +00:00
Alireza 4a87302f06 fix: making onnxruntime work with rsbuild (#4957) 2025-04-14 09:59:39 -04:00
ohif-bot 5dae147155 chore(version): Update package versions [skip ci] 2025-04-11 19:09:38 +00:00
ohif-bot 4952dab010 chore(version): version.json [skip ci] 2025-04-11 19:09:31 +00:00
Dan Rukas 5425308e55 ui(fix): Study panel scrollbar fix and updates (#4951) 2025-04-11 15:03:56 -04:00
ohif-bot c50298f394 chore(version): Update package versions [skip ci] 2025-04-11 16:46:37 +00:00
ohif-bot a82ebeebb2 chore(version): version.json [skip ci] 2025-04-11 16:46:31 +00:00
Pedro Köhler ed94df0dfe fix: add back study browser scrollbar (#4942) 2025-04-11 12:41:16 -04:00
Pedro Köhler 4926a9532c feat: expose scroll thumbnail into view (#4941) 2025-04-11 12:41:04 -04:00
Pedro Köhler 7a36eba67c fix: enable measurements panel scroll (#4943) 2025-04-11 12:40:35 -04:00
ohif-bot 8a08d26f01 chore(version): Update package versions [skip ci] 2025-04-11 13:47:41 +00:00
ohif-bot de598cdc1f chore(version): version.json [skip ci] 2025-04-11 13:47:35 +00:00
Pedro Köhler a9b180c5d4 fix: make datasource selection work (#4944) 2025-04-11 09:42:54 -04:00
ohif-bot ffc7ab6845 chore(version): Update package versions [skip ci] 2025-04-10 03:41:05 +00:00
ohif-bot 1714aa8ec7 chore(version): version.json [skip ci] 2025-04-10 03:40:59 +00:00
Alireza ce0d152f92 docs: next version (#4940) 2025-04-09 23:36:24 -04:00
ohif-bot 16bcc06f15 chore(version): Update package versions [skip ci] 2025-04-10 03:30:26 +00:00
ohif-bot bb42fd2a8d chore(version): version.json [skip ci] 2025-04-10 03:30:20 +00:00
Alireza e37168094a chore(version): move to the next beta version [BUMP BETA] (#4939) 2025-04-09 23:25:30 -04:00
ohif-bot e1e9b5ccb1 chore(version): Update package versions [skip ci] 2025-04-09 20:54:34 +00:00
ohif-bot 6b7e73b78a chore(version): version.json [skip ci] 2025-04-09 20:54:27 +00:00
AlirezaandJoe Boccanfuso 43bc142439 fix(ui): Enhance UI Components and Update CornerstoneJS Dependencies and resizable panels (#4938)
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
2025-04-09 16:49:55 -04:00
ohif-bot c05ec1909f chore(version): Update package versions [skip ci] 2025-04-09 14:00:54 +00:00
ohif-bot c7529394ad chore(version): version.json [skip ci] 2025-04-09 14:00:48 +00:00
Pedro Köhler f6f60a63d2 fix: x-ray pixel spacing calibration (#4922) 2025-04-09 09:55:51 -04:00
ohif-bot 0d2ccc5830 chore(version): Update package versions [skip ci] 2025-04-09 03:01:36 +00:00
ohif-bot 08be5cc656 chore(version): version.json [skip ci] 2025-04-09 03:01:30 +00:00
Alireza c453c29449 docs: migration guides 3p10 (#4937) 2025-04-08 22:57:07 -04:00
ohif-bot a69dd8b1a0 chore(version): Update package versions [skip ci] 2025-04-08 22:38:59 +00:00
ohif-bot 17c5642a59 chore(version): version.json [skip ci] 2025-04-08 22:38:53 +00:00
Alireza bd2f843469 chore: update screenshopts for test (#4934) 2025-04-08 18:34:45 -04:00
ohif-bot 8b9b02d84c chore(version): Update package versions [skip ci] 2025-04-08 21:25:58 +00:00
ohif-bot c9958bafad chore(version): version.json [skip ci] 2025-04-08 21:25:52 +00:00
Dan Rukas 85f465968b ui(fix): small Create Report dialog fixes (#4935) 2025-04-08 17:21:08 -04:00
ohif-bot 47e491f1c8 chore(version): Update package versions [skip ci] 2025-04-08 16:10:38 +00:00
ohif-bot e56b53e897 chore(version): version.json [skip ci] 2025-04-08 16:10:32 +00:00
AlirezaandDan Rukas 2bdf4afa4d refactor(ui): Migrate components to ui-next (#4930)
Co-authored-by: Dan Rukas <dan.rukas@gmail.com>
2025-04-08 12:06:07 -04:00
Dan Rukas 1b8729dded ui(components): CinePlayer updated for ui-next (#4932) 2025-04-08 12:03:35 -04:00
ohif-bot f71d370969 chore(version): Update package versions [skip ci] 2025-04-08 13:48:32 +00:00
ohif-bot 033831ee72 chore(version): version.json [skip ci] 2025-04-08 13:48:24 +00:00
Dan Rukas 49c08298fc ui(colors): Adds neutral color variable and updates scrollbars (#4933) 2025-04-08 09:43:30 -04:00
elawendeandErnst Lawende cfa202e89a fix(OIDC): Use new access_token after refresh (#4853)
Co-authored-by: Ernst Lawende <ernstl@bastion365.nl>
2025-04-08 09:43:06 -04:00
ohif-bot 391a5f3bdd chore(version): Update package versions [skip ci] 2025-04-07 20:50:11 +00:00
ohif-bot 64d65a6830 chore(version): version.json [skip ci] 2025-04-07 20:50:05 +00:00
Alireza 3653de7487 fix(segmentation): Add segment jump for new segments and make panels scrollable (#4928) 2025-04-07 16:45:29 -04:00
Dan Rukas a8ac297e16 ui(components): Viewport components updated to ui-next with design updates (#4886) 2025-04-07 16:45:05 -04:00
ohif-bot 4e09f85d5d chore(version): Update package versions [skip ci] 2025-04-07 14:09:45 +00:00
ohif-bot d2f187153d chore(version): version.json [skip ci] 2025-04-07 14:09:39 +00:00
Pedro Köhler 62e5a62066 feat: allow saving to same SR series (#4889) 2025-04-07 10:05:22 -04:00
ohif-bot 7b40963997 chore(version): Update package versions [skip ci] 2025-04-04 17:38:08 +00:00
ohif-bot 75493334cf chore(version): version.json [skip ci] 2025-04-04 17:38:00 +00:00
Pedro Köhler 746f2524eb fix(cine): Resolve Cine Player Faults on DisplaySet Update (#4909) 2025-04-04 13:33:36 -04:00
ohif-bot 0eb9ff235c chore(version): Update package versions [skip ci] 2025-04-04 16:16:04 +00:00
ohif-bot e9b95afd4c chore(version): version.json [skip ci] 2025-04-04 16:15:57 +00:00
Alireza fc33bd0d59 feat(image capture): Enhance SEG and RTSS Support with Dependency Updates and Bug Fixes (#4924) 2025-04-04 12:11:29 -04:00
ohif-bot 479e280fdf chore(version): Update package versions [skip ci] 2025-04-04 16:07:02 +00:00
ohif-bot d4f81cd2b7 chore(version): version.json [skip ci] 2025-04-04 16:06:55 +00:00
nithin-trenserandDevu Jayalekshmi 54fded554e feat: Automate tracking prompts for a less disruptive annotation workflow (#4822)
Co-authored-by: Devu Jayalekshmi <devu.jayalekshmi@trenser.com>
2025-04-04 12:02:13 -04:00
ohif-bot c0391cea1b chore(version): Update package versions [skip ci] 2025-04-03 15:45:43 +00:00
ohif-bot a9e69eb36f chore(version): version.json [skip ci] 2025-04-03 15:45:36 +00:00
dependabot[bot] a52be6460b chore(deps): bump @babel/runtime-corejs2 from 7.25.7 to 7.26.10 (#4843)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:33:33 -04:00
dependabot[bot] 587b6423cb chore(deps): bump @babel/helpers from 7.26.0 to 7.26.10 in /platform/docs (#4861)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:33:19 -04:00
dependabot[bot] f52a32d6c5 chore(deps): bump @babel/runtime from 7.24.7 to 7.26.10 (#4860)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:33:09 -04:00
dependabot[bot] 8142c55b6a chore(deps): bump @babel/runtime-corejs3 from 7.26.0 to 7.26.10 in /platform/docs (#4859)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:32:54 -04:00
dependabot[bot] 14afb42e2c chore(deps): bump axios from 0.27.2 to 1.8.4 (#4905)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:32:45 -04:00
dependabot[bot] 4e8e4f1491 chore(deps): bump tar-fs from 2.1.1 to 2.1.2 (#4901)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:32:39 -04:00
dependabot[bot] 814a2c914b chore(deps): bump image-size from 1.2.0 to 1.2.1 in /platform/docs (#4912)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 11:32:31 -04:00
ohif-bot f4fb42adb2 chore(version): Update package versions [skip ci] 2025-04-02 22:23:12 +00:00
ohif-bot 0fee0236c2 chore(version): version.json [skip ci] 2025-04-02 22:23:05 +00:00
Alireza e7fe879318 chore: update dependabot (#4916) 2025-04-02 18:17:05 -04:00
ohif-bot a619634678 chore(version): Update package versions [skip ci] 2025-04-02 22:15:26 +00:00
ohif-bot 651a7dc574 chore(version): version.json [skip ci] 2025-04-02 22:15:20 +00:00
Alireza 8432d5f633 fix(seg): Enhance segmentation tools and UI, refactor code, and update dependencies (#4915) 2025-04-02 18:10:47 -04:00
ohif-bot 1dc00d3030 chore(version): Update package versions [skip ci] 2025-04-01 18:23:53 +00:00
ohif-bot 44d450c5b8 chore(version): version.json [skip ci] 2025-04-01 18:23:46 +00:00
Alireza c75a3f3af5 feat(segmentation): Enhance Segmentation with New AI and Once Click Tools (#4910) 2025-04-01 14:19:03 -04:00
ohif-bot 908482d2e0 chore(version): Update package versions [skip ci] 2025-04-01 13:35:34 +00:00
ohif-bot 6b26db387e chore(version): version.json [skip ci] 2025-04-01 13:35:27 +00:00
Dan Rukasandsedghi b7419fb6a1 ui(components): Adds InputNumber component and 4d panel updates (#4874)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-04-01 09:30:32 -04:00
ohif-bot c4045251fb chore(version): Update package versions [skip ci] 2025-03-31 13:14:52 +00:00
ohif-bot ec4cc64b06 chore(version): version.json [skip ci] 2025-03-31 13:14:46 +00:00
dxlin d9473e8db2 test: update Test/tmtv for v3.10.0-beta.136 (#4893) 2025-03-31 09:10:31 -04:00
ohif-bot 7f3fb9bb61 chore(version): Update package versions [skip ci] 2025-03-28 14:57:45 +00:00
ohif-bot 8cf5b52b84 chore(version): version.json [skip ci] 2025-03-28 14:57:39 +00:00
Alireza d7bd36544a fix: jump to measurement forever (#4867) 2025-03-28 10:53:04 -04:00
Alireza eafa2efda5 Revert "fix(measurement): fix for measurement jump is not switching series in 2DMPR (#4779)" (#4898) 2025-03-28 10:17:33 -04:00
arul-trenser 3f06c966eb fix(measurement): fix for measurement jump is not switching series in 2DMPR (#4779) 2025-03-28 10:14:19 -04:00
ohif-bot 951f95ef0a chore(version): Update package versions [skip ci] 2025-03-27 20:51:50 +00:00
ohif-bot 5737935a96 chore(version): version.json [skip ci] 2025-03-27 20:51:44 +00:00
Bill Wallace 459b0d223a fix: routerBasename setting (#4891) 2025-03-27 16:47:16 -04:00
ohif-bot c368d763b0 chore(version): Update package versions [skip ci] 2025-03-27 19:58:04 +00:00
ohif-bot 6b6f49b867 chore(version): version.json [skip ci] 2025-03-27 19:57:58 +00:00
Igor Octaviano 892d03fc3c fix(seg): multiframe SEG (#4890) 2025-03-27 15:52:22 -04:00
ohif-bot 2acc878f26 chore(version): Update package versions [skip ci] 2025-03-26 18:02:55 +00:00
ohif-bot 1df91fd104 chore(version): version.json [skip ci] 2025-03-26 18:02:48 +00:00
Pedro Köhler 9bde644fce fix: remove duplicated deleteMeasurements code (#4895) 2025-03-26 13:58:15 -04:00
ohif-bot 7f8fa1e1f4 chore(version): Update package versions [skip ci] 2025-03-26 17:44:41 +00:00
ohif-bot dce9c6b7c3 chore(version): version.json [skip ci] 2025-03-26 17:44:35 +00:00
Pedro Köhler 467acbd997 fix: datasource connection error style (#4888) 2025-03-26 13:40:09 -04:00
ohif-bot f90184d9d9 chore(version): Update package versions [skip ci] 2025-03-25 15:04:03 +00:00
ohif-bot cc9720dca2 chore(version): version.json [skip ci] 2025-03-25 15:03:57 +00:00
Alireza 4dd485bd2d fix(seg): orthanc seg (#4883) 2025-03-25 10:59:19 -04:00
ohif-bot 209d81f475 chore(version): Update package versions [skip ci] 2025-03-25 13:37:07 +00:00
ohif-bot 5c319ce4f0 chore(version): version.json [skip ci] 2025-03-25 13:37:00 +00:00
Bill Wallace f6fa509874 fix: Skip showing NaN for average pixel/max value (#4884) 2025-03-25 09:32:36 -04:00
Bill Wallace 8e47112d8e fix: Delete study measurements instead of all measurements (#4882) 2025-03-25 09:32:29 -04:00
Pedro Köhler 165c9dc710 fix: compare series date time (#4887) 2025-03-25 09:31:49 -04:00
ohif-bot 8faa9bf851 chore(version): Update package versions [skip ci] 2025-03-20 19:18:39 +00:00
ohif-bot 246c10da07 chore(version): version.json [skip ci] 2025-03-20 19:18:32 +00:00
Dan Rukas 782a6a0c88 ui(panels): Tool option components and responsive behavior for ROIThreshold (#4876) 2025-03-20 15:13:59 -04:00
ohif-bot 5293253ecd chore(version): Update package versions [skip ci] 2025-03-20 16:10:51 +00:00
ohif-bot 7f86ca1a2b chore(version): version.json [skip ci] 2025-03-20 16:10:45 +00:00
Pedro Köhler 01c3726ced feat: add customization to PanelStudyBrowser dbl click callback (#4871) 2025-03-20 12:06:26 -04:00
ohif-bot f73c485821 chore(version): Update package versions [skip ci] 2025-03-20 13:26:51 +00:00
ohif-bot 30a3965da7 chore(version): version.json [skip ci] 2025-03-20 13:26:45 +00:00
Bill Wallace df8efba82c feat: Group findings table values with custom components/grouping functions (#4712) 2025-03-20 09:22:45 -04:00
ohif-bot 0522d58d9b chore(version): Update package versions [skip ci] 2025-03-19 22:29:06 +00:00
ohif-bot 576ad47ebe chore(version): version.json [skip ci] 2025-03-19 22:29:00 +00:00
Alireza 5f112337b6 feat(segmentation): Enhance Segmentation Tools with Preview and Selection Features (#4870) 2025-03-19 18:24:33 -04:00
ohif-bot 20042f9109 chore(version): Update package versions [skip ci] 2025-03-19 15:57:55 +00:00
ohif-bot d59b9d88fa chore(version): version.json [skip ci] 2025-03-19 15:57:48 +00:00
Sai Shanmukha Narumanchi 7f229d5c23 fix(DicomWebDataSource) : Fix a missing null check in addRetrieveBulkDataNaturalized (#4866) 2025-03-19 11:52:56 -04:00
ohif-bot eac0308275 chore(version): Update package versions [skip ci] 2025-03-18 21:11:23 +00:00
ohif-bot c2f9252aef chore(version): version.json [skip ci] 2025-03-18 21:11:16 +00:00
Pedro Köhler 55d6393a3f feat: overlapping segments (#4849) 2025-03-18 17:07:13 -04:00
ohif-bot 5a6c2aeed9 chore(version): Update package versions [skip ci] 2025-03-18 14:57:07 +00:00
ohif-bot 751919c27b chore(version): version.json [skip ci] 2025-03-18 14:57:00 +00:00
Pedro Köhler fb93ef9219 fix: add back dicom tag browser SQ items (#4869) 2025-03-18 10:52:19 -04:00
ohif-bot a0a3a30361 chore(version): Update package versions [skip ci] 2025-03-18 03:01:26 +00:00
ohif-bot 64b196db20 chore(version): version.json [skip ci] 2025-03-18 03:01:20 +00:00
Dan Rukas c227c5742a ui(panels): PetSUV updates for ui-next and responsive layout (#4864) 2025-03-17 22:57:19 -04:00
ohif-bot 2c75638d1c chore(version): Update package versions [skip ci] 2025-03-18 02:39:10 +00:00
ohif-bot bf27da4174 chore(version): version.json [skip ci] 2025-03-18 02:39:04 +00:00
Alireza ec79b5523e feat(segmentation): segment statistics, labelmap interpolation and segment bidirectional (#4865) 2025-03-17 22:34:34 -04:00
ohif-bot 694f3e9611 chore(version): Update package versions [skip ci] 2025-03-17 15:51:26 +00:00
ohif-bot d33b1ade87 chore(version): version.json [skip ci] 2025-03-17 15:51:19 +00:00
Dan Rukasandsedghi abab3dc7ad ui(components): LayoutSelector recreated for ui-next (#4845)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-03-17 11:47:09 -04:00
Alireza b7fbf04230 fix(metadata): change the default values for cosines (#4863) 2025-03-17 11:44:05 -04:00
ohif-bot ec71721d49 chore(version): Update package versions [skip ci] 2025-03-17 15:09:28 +00:00
ohif-bot a265257569 chore(version): version.json [skip ci] 2025-03-17 15:09:22 +00:00
Dan Rukas 951c21fda8 ui(migrate) Migrate local view to new ui-next components (#4850) 2025-03-17 11:05:11 -04:00
Dan Rukas f916b2f40e ui(components): Adds InputFilter component to ui-next (#4848) 2025-03-17 11:04:42 -04:00
Pedro H. Köhler 841320adfb fix: max call stack exceeded for dicom tag browser (#4855) 2025-03-17 11:03:08 -04:00
ohif-bot 10976c2a48 chore(version): Update package versions [skip ci] 2025-03-17 15:01:31 +00:00
ohif-bot e2ab118217 chore(version): version.json [skip ci] 2025-03-17 15:01:24 +00:00
Alireza 8cd48c7f70 chore: run dependabot (#4862) 2025-03-17 10:56:39 -04:00
ohif-bot fd2f88920b chore(version): Update package versions [skip ci] 2025-03-17 14:25:30 +00:00
ohif-bot fdd33aea0f chore(version): version.json [skip ci] 2025-03-17 14:25:23 +00:00
Alireza ebe6fbaf31 feat: update vtk js (#4858) 2025-03-17 10:21:06 -04:00
ohif-bot bfa76de93b chore(version): Update package versions [skip ci] 2025-03-11 13:58:54 +00:00
ohif-bot 56c7c27ad9 chore(version): version.json [skip ci] 2025-03-11 13:58:47 +00:00
Ibrahim 3f70617c62 feat(viewport-gap): remove viewport gap and update border behavior (#4835) 2025-03-11 09:54:19 -04:00
Ibrahim 1f634bab45 feat(fonts): bundle fonts in OHIF and dont use google cdn (#4821)
[OHI-1681]
2025-03-11 09:50:46 -04:00
ohif-bot f6ad3446ad chore(version): Update package versions [skip ci] 2025-03-11 13:11:42 +00:00
ohif-bot a6059363b1 chore(version): version.json [skip ci] 2025-03-11 13:11:35 +00:00
dependabot[bot] 834be4aaf1 chore(deps): bump prismjs from 1.29.0 to 1.30.0 in /platform/docs (#4838)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 09:07:13 -04:00
ohif-bot f15022c6e9 chore(version): Update package versions [skip ci] 2025-03-10 19:38:15 +00:00
ohif-bot a5fb53fbcf chore(version): version.json [skip ci] 2025-03-10 19:38:09 +00:00
dependabot[bot]andsedghi d9349ead6f chore(deps): bump axios from 0.28.1 to 1.8.2 (#4833)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-03-10 15:34:10 -04:00
ohif-bot 9d7c2abdef chore(version): Update package versions [skip ci] 2025-03-07 19:19:37 +00:00
ohif-bot 18ef2562a1 chore(version): version.json [skip ci] 2025-03-07 19:19:30 +00:00
Celian-abd 17d2889dc5 fix(tmtv tools): add CircleROIStartEndThreshold to supported tools in TMTV extension (#4828) 2025-03-07 14:15:00 -05:00
ohif-bot 2109b2c1e6 chore(version): Update package versions [skip ci] 2025-03-07 03:23:40 +00:00
ohif-bot 19fb355c50 chore(version): version.json [skip ci] 2025-03-07 03:23:34 +00:00
Alireza cc5cdfb081 feat(toolbox): Refactor Toolbar and Toolbox to enable sections (#4825) 2025-03-06 22:19:47 -05:00
ohif-bot 86c12246ac chore(version): Update package versions [skip ci] 2025-03-06 22:13:48 +00:00
ohif-bot 022313302e chore(version): version.json [skip ci] 2025-03-06 22:13:42 +00:00
Pedro H. Köhler 5a7f7841b2 fix: dicom tag browser row height on toggle (#4832) 2025-03-06 17:09:11 -05:00
ohif-bot 9b6af66859 chore(version): Update package versions [skip ci] 2025-02-28 20:22:03 +00:00
ohif-bot cdfe5c7bef chore(version): version.json [skip ci] 2025-02-28 20:21:57 +00:00
Dan Rukasandsedghi a3b51aa8db ui(components): New Dialog and Modal components for ui-next (#4772)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-02-28 15:17:55 -05:00
ohif-bot 62b4fa3e89 chore(version): Update package versions [skip ci] 2025-02-28 19:21:07 +00:00
ohif-bot c757d69671 chore(version): version.json [skip ci] 2025-02-28 19:20:58 +00:00
Bill Wallaceandsedghi 24567c4e92 fix: Cornerstone3D 3.0 (#4816)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-02-28 14:16:39 -05:00
ohif-bot 62abb3ac47 chore(version): Update package versions [skip ci] 2025-02-28 18:56:06 +00:00
ohif-bot f7a0763000 chore(version): version.json [skip ci] 2025-02-28 18:55:59 +00:00
Bill Wallace d25809eed0 fix: Performance of panel study browser (#4819) 2025-02-28 13:51:43 -05:00
ohif-bot 6b0bb9402f chore(version): Update package versions [skip ci] 2025-02-28 17:30:34 +00:00
ohif-bot 9cbf82167e chore(version): version.json [skip ci] 2025-02-28 17:30:27 +00:00
Sofien-Sellami 7f0cc0f60e feat: separate checks for addWindowLevelActionMenu and addSegmentationOverlay (#4813) 2025-02-28 12:25:52 -05:00
ohif-bot 7d67834159 chore(version): Update package versions [skip ci] 2025-02-26 17:19:13 +00:00
ohif-bot 51f9407d93 chore(version): version.json [skip ci] 2025-02-26 17:19:07 +00:00
Sofien-Sellami fdb073c216 fix: broken activateViewportBeforeInteraction behavior (#4810) 2025-02-26 12:14:56 -05:00
ohif-bot d319d20b0d chore(version): Update package versions [skip ci] 2025-02-26 16:28:51 +00:00
ohif-bot 8a977bb70c chore(version): version.json [skip ci] 2025-02-26 16:28:42 +00:00
Alireza 9233143b9d fix(sr): sr hydration and load was not working, Screenshot Comparison, and Testing (#4814) 2025-02-26 11:23:40 -05:00
ohif-bot 1f5c60bbda chore(version): Update package versions [skip ci] 2025-02-25 22:26:27 +00:00
ohif-bot ca22bac851 chore(version): version.json [skip ci] 2025-02-25 22:26:21 +00:00
Alireza 32fc6f0d4b chore: upgrade cornerstone3D version (#4809) 2025-02-25 17:21:57 -05:00
ohif-bot e2491daff7 chore(version): Update package versions [skip ci] 2025-02-25 21:30:04 +00:00
ohif-bot 7dd0260f86 chore(version): version.json [skip ci] 2025-02-25 21:29:58 +00:00
Yiannis Theocharakis 4b63d48518 feat(Segments Looping) : Fixed looping through Segments of SEG (#4793) 2025-02-25 16:25:52 -05:00
ohif-bot 4ecffe89cb chore(version): Update package versions [skip ci] 2025-02-25 21:24:41 +00:00
ohif-bot 9fb3653281 chore(version): version.json [skip ci] 2025-02-25 21:24:35 +00:00
Rafael Osipov 06660be7c4 docs: Fix broken link to viewer internationalization docs (#4808) 2025-02-25 16:20:19 -05:00
ohif-bot 5d5eafb0f5 chore(version): Update package versions [skip ci] 2025-02-25 18:36:49 +00:00
ohif-bot 0abb62167a chore(version): version.json [skip ci] 2025-02-25 18:36:43 +00:00
Alireza 3e6913b097 feat(hotkeys): Migrate hotkeys to customization service and fix issues with overrides (#4777) 2025-02-25 13:32:30 -05:00
ohif-bot 4559d39a91 chore(version): Update package versions [skip ci] 2025-02-25 16:55:42 +00:00
ohif-bot b7ddbccdff chore(version): version.json [skip ci] 2025-02-25 16:55:37 +00:00
Bill Wallace e480e841bb fix: Changes to address hang/crash on jump to instance (#4679) 2025-02-25 11:51:44 -05:00
Ibrahim afd528b8d7 fix(rt): jump to segment discards the configured width (#4799) 2025-02-25 11:49:16 -05:00
ohif-bot 76da2d86a9 chore(version): Update package versions [skip ci] 2025-02-25 14:20:31 +00:00
ohif-bot 5527c0e8ea chore(version): version.json [skip ci] 2025-02-25 14:20:25 +00:00
Bill Wallace bda98b0bee fix: Delay for all series thumbnails on fetching thumbnail (#4802) 2025-02-25 09:15:45 -05:00
ohif-bot 74d96d378d chore(version): Update package versions [skip ci] 2025-02-23 20:49:40 +00:00
ohif-bot 94496f72b9 chore(version): version.json [skip ci] 2025-02-23 20:49:34 +00:00
Dan Rukas 338e386948 ui(icons): Added New Segmentation Tool Art (#4797) 2025-02-23 15:44:53 -05:00
ohif-bot 0531bee83b chore(version): Update package versions [skip ci] 2025-02-20 14:26:22 +00:00
ohif-bot 6411488cd1 chore(version): version.json [skip ci] 2025-02-20 14:26:16 +00:00
Pedro H. Köhler 55f0b54db1 fix: combine frame instance (#4792) 2025-02-20 09:21:44 -05:00
ohif-bot 2e70f0ffa1 chore(version): Update package versions [skip ci] 2025-02-20 14:01:47 +00:00
ohif-bot 0931356f68 chore(version): version.json [skip ci] 2025-02-20 14:01:41 +00:00
Pedro H. Köhler b7cd0c6027 fix: icon is not defined (#4794) 2025-02-20 08:57:29 -05:00
ohif-bot 8d83c117cf chore(version): Update package versions [skip ci] 2025-02-19 14:21:08 +00:00
ohif-bot bd93a6f428 chore(version): version.json [skip ci] 2025-02-19 14:21:01 +00:00
Ceciliadrc 125f11fc73 fix(button): fix for className (#4604) 2025-02-19 09:16:22 -05:00
ohif-bot ce3bc8962d chore(version): Update package versions [skip ci] 2025-02-18 23:24:46 +00:00
ohif-bot 0d8820d941 chore(version): version.json [skip ci] 2025-02-18 23:24:39 +00:00
Yiannis Theocharakis c61dbba8d0 fix(Segments Looping) : Fixed looping through Segments of RTSTRUCT using Left/Right viewport buttons (#4783) 2025-02-18 18:20:26 -05:00
Bill Wallace 2410c6a509 fix: cache thumbnail in display set (#4782) 2025-02-18 18:19:09 -05:00
ohif-bot d26c9551b6 chore(version): Update package versions [skip ci] 2025-02-18 16:41:10 +00:00
ohif-bot b6afba12a5 chore(version): version.json [skip ci] 2025-02-18 16:41:04 +00:00
Pedro H. Köhler 4e16099ad3 fix: lodash dependencies (#4791) 2025-02-18 11:36:26 -05:00
ohif-bot 887a892a5b chore(version): Update package versions [skip ci] 2025-02-18 15:34:40 +00:00
ohif-bot db4d94c3fe chore(version): version.json [skip ci] 2025-02-18 15:34:31 +00:00
Pedro H. Köhler 0b5836ca1a feat: improve dicom tag browser with nested rows (#4451) 2025-02-18 10:29:53 -05:00
ohif-bot 8b969eb1e9 chore(version): Update package versions [skip ci] 2025-02-18 14:12:35 +00:00
ohif-bot ac30be6038 chore(version): version.json [skip ci] 2025-02-18 14:12:28 +00:00
Alireza d8a6e79df0 fix: depandabot (#4786) 2025-02-18 09:08:10 -05:00
Pedro H. Köhler 5712e91ca1 fix: right panel for the create mode cli command (#4788) 2025-02-18 09:07:17 -05:00
Pedro H. Köhler a3b1251386 docs: fix yarn version (#4790) 2025-02-18 09:04:35 -05:00
ohif-bot 2fbaa11cf1 chore(version): Update package versions [skip ci] 2025-02-13 17:31:17 +00:00
ohif-bot 8fe7b78e54 chore(version): version.json [skip ci] 2025-02-13 17:31:11 +00:00
Yiannis Theocharakis d9a3ba7990 fix(Frame View) : Fixed synchronization for Frame View Hanging Protocol (#4780) 2025-02-13 12:27:01 -05:00
ohif-bot 2ca9f2b0cc chore(version): Update package versions [skip ci] 2025-02-11 17:44:43 +00:00
ohif-bot 559f248d1f chore(version): version.json [skip ci] 2025-02-11 17:44:37 +00:00
Pedro H. Köhler 084a10f783 feat: add viewport overlays to microscopy mode (#4776) 2025-02-11 12:39:45 -05:00
ohif-bot 5043ea3260 chore(version): Update package versions [skip ci] 2025-02-04 23:37:42 +00:00
ohif-bot e0ec1011cf chore(version): version.json [skip ci] 2025-02-04 23:37:36 +00:00
devin-ai-integration[bot]andAlireza Sedghi bbf1a19676 fix: add commandsManager to MoreDropdownMenu onClick props (#4765)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alireza Sedghi <ar.sedghi@gmail.com>
2025-02-04 18:33:45 -05:00
ohif-bot 9a3d832cc2 chore(version): Update package versions [skip ci] 2025-02-04 17:29:26 +00:00
ohif-bot e373e22481 chore(version): version.json [skip ci] 2025-02-04 17:29:19 +00:00
Alireza 149d6d049c fix(core): Address 3D reconstruction and Android compatibility issues and clean up 4D data mode (#4762) 2025-02-04 12:25:10 -05:00
ohif-bot 4d06a7d286 chore(version): Update package versions [skip ci] 2025-02-04 14:10:16 +00:00
ohif-bot a7e4204cea chore(version): version.json [skip ci] 2025-02-04 14:10:10 +00:00
Joost van Griethuysen 8996df80e4 fix: changing colormap for second volume in fusion viewport (#4746) 2025-02-04 09:05:55 -05:00
ohif-bot d5dbe20256 chore(version): Update package versions [skip ci] 2025-02-04 13:55:40 +00:00
ohif-bot 105fd7a468 chore(version): version.json [skip ci] 2025-02-04 13:55:34 +00:00
Abhijith Sb 2c183aa4a7 feat(ui): Add support for Custom Modal component in Modal Service (#4752) 2025-02-04 08:51:23 -05:00
ohif-bot 8788dae6a4 chore(version): Update package versions [skip ci] 2025-02-04 13:50:59 +00:00
ohif-bot 6937129991 chore(version): version.json [skip ci] 2025-02-04 13:50:54 +00:00
nithin-trenser 8acbd760d8 feat(ui): customization option for viewport notification (#4638) 2025-02-04 08:46:39 -05:00
ohif-bot c65e7f57cc chore(version): Update package versions [skip ci] 2025-02-04 13:36:09 +00:00
ohif-bot 5e09b405f4 chore(version): version.json [skip ci] 2025-02-04 13:36:04 +00:00
Joe Boccanfuso 12d3db2dbc fix(context-menu): Fixing regression introduced by PR #4727 (#4760) 2025-02-04 08:31:40 -05:00
ohif-bot ae9a238289 chore(version): Update package versions [skip ci] 2025-02-03 15:35:58 +00:00
ohif-bot 691accacd9 chore(version): version.json [skip ci] 2025-02-03 15:35:53 +00:00
arul-trenser e035ef1dcc fix(measurement label auto-completion): Customization of measurement label auto-completion fails for measurements following arrow annotations. (#4739) 2025-02-03 10:31:41 -05:00
ohif-bot 43aa20c372 chore(version): Update package versions [skip ci] 2025-02-03 14:33:26 +00:00
ohif-bot 860f76586a chore(version): version.json [skip ci] 2025-02-03 14:33:20 +00:00
Ibrahim 9b8e5cfd1a fix(store-segmentation): storing segmentations was hitting the wrong command resulting in an undefined datasource (#4755)
[OHI-1445]
2025-02-03 09:28:58 -05:00
ohif-bot 613401e043 chore(version): Update package versions [skip ci] 2025-02-03 14:22:28 +00:00
ohif-bot 47b9a06f74 chore(version): version.json [skip ci] 2025-02-03 14:22:22 +00:00
f15eb44b4c feat: Add customization support for more UI components (#4634)
Co-authored-by: ashikcn <ashik@L1140.trenser.com>
Co-authored-by: Devu Jayalekshmi <devu.jayalekshmi@trenser.com>
Co-authored-by: Arul Mozhi <arul.mozhi@trenser.com>
2025-02-03 09:18:00 -05:00
ohif-bot 8f79ebafd9 chore(version): Update package versions [skip ci] 2025-01-31 15:12:46 +00:00
ohif-bot a3c7c2c3da chore(version): version.json [skip ci] 2025-01-31 15:12:40 +00:00
Celian-abd 32017d15a4 fix: Remove non-functional Tailwind class for SegmentationPanel (#4745) 2025-01-31 10:07:55 -05:00
ohif-bot e3967e62f2 chore(version): Update package versions [skip ci] 2025-01-31 14:47:57 +00:00
ohif-bot 09f9024728 chore(version): version.json [skip ci] 2025-01-31 14:47:51 +00:00
Alireza 0cb6106d0f fix: publish dependency (#4753) 2025-01-31 09:43:35 -05:00
ohif-bot 4dc26ae603 chore(version): Update package versions [skip ci] 2025-01-31 13:58:58 +00:00
ohif-bot 9850f92b8a chore(version): version.json [skip ci] 2025-01-31 13:58:52 +00:00
Gas Giantandscouser f10683c667 fix: typo in pet_series_module (#4748)
Co-authored-by: scouser <sharukh@Sharukhs-MacBook-Pro.local>
2025-01-31 08:54:45 -05:00
ohif-bot 2bfc790870 chore(version): Update package versions [skip ci] 2025-01-29 18:41:36 +00:00
ohif-bot 3f08a76aac chore(version): version.json [skip ci] 2025-01-29 18:41:29 +00:00
Dan Rukasandsedghi a8d84443a9 ui(components): migrates to new toolbar ui components and Numeric for Input InputRange and InputDoubleRange (#4728)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-01-29 13:36:52 -05:00
ohif-bot ac5ae4a29e chore(version): Update package versions [skip ci] 2025-01-29 14:19:36 +00:00
ohif-bot 6d9c701fa9 chore(version): version.json [skip ci] 2025-01-29 14:19:30 +00:00
Jaseel-trenser 054b262e9c feat(customization): enable custom onDropHandler for viewportGrid (#4641) 2025-01-29 09:14:50 -05:00
ohif-bot 3dac0f9e73 chore(version): Update package versions [skip ci] 2025-01-28 20:04:13 +00:00
ohif-bot d62c32c898 chore(version): version.json [skip ci] 2025-01-28 20:04:07 +00:00
Alireza d554f02f7c fix(dependencies): Update dcmjs library and improve documentation links (#4741) 2025-01-28 14:59:59 -05:00
ohif-bot ff6dd3a152 chore(version): Update package versions [skip ci] 2025-01-28 16:38:07 +00:00
ohif-bot a22818c1f4 chore(version): version.json [skip ci] 2025-01-28 16:38:01 +00:00
Joe Boccanfuso 6abb095b8a feat(side-panels): Added resize handle interactive feedback for side panels (#4734) 2025-01-28 11:33:53 -05:00
ohif-bot fe658c6392 chore(version): Update package versions [skip ci] 2025-01-28 13:59:39 +00:00
ohif-bot 70c94e8d5a chore(version): version.json [skip ci] 2025-01-28 13:59:33 +00:00
Devu-trenser 5addf51c45 feat(windowLevelActionMenu) customization support for windowLevelActionMenu (#4725) 2025-01-28 08:54:58 -05:00
ashik-trenserandashikcn 8e3e2085d4 fix: for initialImageIndex mismatch issue for loading SR after disabling prompts (#4732)
Co-authored-by: ashikcn <ashik@L1140.trenser.com>
2025-01-28 08:53:42 -05:00
ohif-bot 078a72996f chore(version): Update package versions [skip ci] 2025-01-27 16:59:04 +00:00
ohif-bot dc14a48fd9 chore(version): version.json [skip ci] 2025-01-27 16:58:57 +00:00
arul-trenser 61699d00b6 fix(context menu): Context menus for edge-proximate measurements are partially obscured. (#4727) 2025-01-27 11:54:29 -05:00
ohif-bot eb854ac2cb chore(version): Update package versions [skip ci] 2025-01-27 16:24:18 +00:00
ohif-bot 6c42f269a7 chore(version): version.json [skip ci] 2025-01-27 16:24:12 +00:00
Ibrahim ac6e674b4d feat(static-wado): add support for case-insensitive searching (#4603)
[OHI-1357]
2025-01-27 11:20:00 -05:00
ohif-bot 316cf0a7bd chore(version): Update package versions [skip ci] 2025-01-27 14:27:48 +00:00
ohif-bot c011236060 chore(version): version.json [skip ci] 2025-01-27 14:27:43 +00:00
dependabot[bot] 2ed7a1adfa chore(deps): bump store2 from 2.14.3 to 2.14.4 (#4737)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 09:23:38 -05:00
ohif-bot 492150478b chore(version): Update package versions [skip ci] 2025-01-24 15:27:16 +00:00
ohif-bot cb03077d37 chore(version): version.json [skip ci] 2025-01-24 15:27:10 +00:00
Alireza 28fb921089 fix(docs): image in customization (#4735) 2025-01-24 10:22:29 -05:00
ohif-bot bc175d68b6 chore(version): Update package versions [skip ci] 2025-01-24 13:46:27 +00:00
ohif-bot 884020f143 chore(version): version.json [skip ci] 2025-01-24 13:46:21 +00:00
Gas Giantandscouser d6f0092a32 feat: delete active annotation using backspace/delete key (#4722)
Co-authored-by: scouser <sharukh@Sharukhs-MacBook-Pro.local>
2025-01-24 08:42:00 -05:00
ohif-bot 01fa5d83a6 chore(version): Update package versions [skip ci] 2025-01-23 19:28:43 +00:00
ohif-bot 625919d4e4 chore(version): version.json [skip ci] 2025-01-23 19:28:36 +00:00
Alireza 55ad8efbab feat(customization): new customization service api (#4688) 2025-01-23 14:24:13 -05:00
ohif-bot fab52808cb chore(version): Update package versions [skip ci] 2025-01-23 19:18:02 +00:00
ohif-bot f5ad0de2d2 chore(version): version.json [skip ci] 2025-01-23 19:17:56 +00:00
Ibrahim d9abc3da8d feat(panels): responsive thumbnails based on panel size (#4723) 2025-01-23 14:13:44 -05:00
ohif-bot 9d07705a1f chore(version): Update package versions [skip ci] 2025-01-22 16:40:54 +00:00
ohif-bot 0966f62310 chore(version): version.json [skip ci] 2025-01-22 16:40:48 +00:00
Alireza f00d18292f fix(seg): sphere scissor on stack and cpu rendering reset properties was broken (#4721) 2025-01-22 11:36:45 -05:00
ohif-bot 3628ad84c8 chore(version): Update package versions [skip ci] 2025-01-21 16:25:19 +00:00
ohif-bot b21287e908 chore(version): version.json [skip ci] 2025-01-21 16:25:13 +00:00
Joe Boccanfuso d90a4cfb16 feat(resizable-side-panels): Make the left and right side panels (optionally) resizable. (#4672) 2025-01-21 11:20:34 -05:00
ohif-bot a518854a4c chore(version): Update package versions [skip ci] 2025-01-21 14:38:46 +00:00
ohif-bot 28f86f3cd6 chore(version): version.json [skip ci] 2025-01-21 14:38:40 +00:00
Alireza cf97fa9b7b fix(ui): Update dependencies and add missing icons (#4699) 2025-01-21 09:34:19 -05:00
ohif-bot ad7ade28ea chore(version): Update package versions [skip ci] 2025-01-21 14:12:03 +00:00
ohif-bot 9aed7b8486 chore(version): version.json [skip ci] 2025-01-21 14:11:57 +00:00
Jaseel-trenser 8aedb2ec54 fix: Inconsistent Handling of Patient Name Tag (#4703) 2025-01-21 09:07:30 -05:00
ohif-bot cbe926f52b chore(version): Update package versions [skip ci] 2025-01-20 14:17:53 +00:00
ohif-bot 855648f41f chore(version): version.json [skip ci] 2025-01-20 14:17:47 +00:00
Bez bf587070cc fix(rotation): support cycling rotateViewportCCW (#4533) 2025-01-20 09:13:43 -05:00
ohif-bot 953f36ab4c chore(version): Update package versions [skip ci] 2025-01-20 14:11:21 +00:00
ohif-bot 0911e3c0d1 chore(version): version.json [skip ci] 2025-01-20 14:11:15 +00:00
Bill Wallace 464148ece6 fix(hp): Display set should allow remembered updates (#4707) 2025-01-20 09:06:28 -05:00
ohif-bot 544dc543d9 chore(version): Update package versions [skip ci] 2025-01-17 21:48:05 +00:00
ohif-bot f5dcf25d98 chore(version): version.json [skip ci] 2025-01-17 21:47:59 +00:00
Bill Wallace 7734296d1d docs: Documentation on how to set default configuration to search for today (#4708) 2025-01-17 16:43:51 -05:00
ohif-bot 9e047784d1 chore(version): Update package versions [skip ci] 2025-01-16 16:47:32 +00:00
ohif-bot df96a4992c chore(version): version.json [skip ci] 2025-01-16 16:47:26 +00:00
Pedro H. Köhler 19931614dc fix: context menu icon (#4696) 2025-01-16 11:42:58 -05:00
ohif-bot ef477c29c5 chore(version): Update package versions [skip ci] 2025-01-16 03:33:26 +00:00
ohif-bot 6c8ebc1d5a chore(version): version.json [skip ci] 2025-01-16 03:33:19 +00:00
ec4b5a6876 fix(multiframe): handling proxies properly (#4693)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
Co-authored-by: Chao Sui <chao.sui@curvebeamai.com>
2025-01-15 22:29:06 -05:00
ohif-bot 9f8df95f3e chore(version): Update package versions [skip ci] 2025-01-15 20:21:31 +00:00
ohif-bot c718b20659 chore(version): version.json [skip ci] 2025-01-15 20:21:25 +00:00
Bill Wallaceandsedghi cded082617 fix: Having sop instance in a per-frame or shared attribute breaks load (#4560)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-01-15 15:16:50 -05:00
ohif-bot 27c040fdda chore(version): Update package versions [skip ci] 2025-01-14 14:07:59 +00:00
ohif-bot e923bf2bc5 chore(version): version.json [skip ci] 2025-01-14 14:07:53 +00:00
Pedro H. Köhler 2d611d06ed fix: cs dicom sr commands module (#4683) 2025-01-14 09:03:04 -05:00
Alireza c901a847af fix: bugs after multimonitor (#4680) 2025-01-13 18:32:54 -05:00
ohif-bot 7662157cbf chore(version): Update package versions [skip ci] 2025-01-13 15:54:04 +00:00
ohif-bot 161c84d875 chore(version): version.json [skip ci] 2025-01-13 15:53:58 +00:00
Bill Wallace 07c628e689 feat(multimonitor): Add simple multi-monitor support to open another study(#4178) 2025-01-13 10:49:08 -05:00
ohif-bot a4a6de07f4 chore(version): Update package versions [skip ci] 2025-01-13 14:40:08 +00:00
ohif-bot daf18f3e6b chore(version): version.json [skip ci] 2025-01-13 14:40:01 +00:00
Devu-trenser 9832dbe653 fix(toolbarService): All header tools are enabled in volume3D viewport (#4677) 2025-01-13 09:35:44 -05:00
ohif-bot f4df631a4a chore(version): Update package versions [skip ci] 2025-01-13 14:04:38 +00:00
ohif-bot bdfaa35f7f chore(version): version.json [skip ci] 2025-01-13 14:04:31 +00:00
Joeycho 9b04020a87 docs: migration docs typo (3.8 -> 3.9, useViewportGridStore()) (#4675) 2025-01-13 09:00:13 -05:00
ohif-bot 7a13c28eb3 chore(version): Update package versions [skip ci] 2025-01-10 20:09:59 +00:00
ohif-bot b9fb0ce96f chore(version): version.json [skip ci] 2025-01-10 20:09:53 +00:00
Alireza d4a4267429 feat(dev): move to rsbuild for dev - faster (#4674) 2025-01-10 15:05:35 -05:00
ohif-bot 847f1da8e0 chore(version): Update package versions [skip ci] 2025-01-10 17:05:53 +00:00
ohif-bot 71ccbe87c1 chore(version): version.json [skip ci] 2025-01-10 17:05:47 +00:00
Ibrahim a2d34c97ed fix(docker): run compression regardless of APP_CONFIG being present ( in cases such as volume mount) (#4673) 2025-01-10 12:01:15 -05:00
ohif-bot ee76912fed chore(version): Update package versions [skip ci] 2025-01-10 15:11:20 +00:00
ohif-bot e94e8439ad chore(version): version.json [skip ci] 2025-01-10 15:11:14 +00:00
Ibrahim 01924b8bf2 fix(icons): icons missing for volume presets and others (#4671) 2025-01-10 10:06:34 -05:00
ohif-bot 7d22480036 chore(version): Update package versions [skip ci] 2025-01-10 04:02:04 +00:00
ohif-bot 4e70ee7894 chore(version): version.json [skip ci] 2025-01-10 04:01:57 +00:00
Joeycho 64a72774a8 chore: delete unused and duplicate function, it exists under /utils (#4657) 2025-01-09 22:57:32 -05:00
ohif-bot 1b56b48d7b chore(version): Update package versions [skip ci] 2025-01-10 03:11:43 +00:00
ohif-bot 41e870b7db chore(version): version.json [skip ci] 2025-01-10 03:11:37 +00:00
Bill Wallace ebbc37d291 fix: orthanc datasource dev (#4663) 2025-01-09 22:07:30 -05:00
ohif-bot 29b9dc58ba chore(version): Update package versions [skip ci] 2025-01-10 03:06:19 +00:00
ohif-bot 409e06d0c6 chore(version): version.json [skip ci] 2025-01-10 03:06:13 +00:00
Bill Wallace 82440e88d5 feat: Start using group filtering to define measurements table layout (#4501) 2025-01-09 22:01:42 -05:00
ohif-bot bc73de9710 chore(version): Update package versions [skip ci] 2025-01-09 16:22:12 +00:00
ohif-bot ba8f8ba2d6 chore(version): version.json [skip ci] 2025-01-09 16:22:04 +00:00
Salim Kanoun 8e2c607904 fix: Execute HP onProtocolEnter callback after HPservice.run( (#4589) 2025-01-09 11:15:57 -05:00
ohif-bot 98f4ac2e75 chore(version): Update package versions [skip ci] 2025-01-09 15:56:12 +00:00
ohif-bot 192d8e69a9 chore(version): version.json [skip ci] 2025-01-09 15:56:05 +00:00
Salim Kanoun aef68d18b8 fix: Make StudyInstanceUID optional to retrieve a Series from DicomMetadataStore (#4644) 2025-01-09 10:51:09 -05:00
ohif-bot 2dd9b893ad chore(version): Update package versions [skip ci] 2025-01-09 14:32:47 +00:00
ohif-bot 2ebd03de07 chore(version): version.json [skip ci] 2025-01-09 14:32:41 +00:00
Bill Wallace e0088ec918 fix: Inconsistencies and update the style setting on load for embedded styles from codingValues (#4599) 2025-01-09 09:28:02 -05:00
ohif-bot 3c848c6d34 chore(version): Update package versions [skip ci] 2025-01-08 20:35:07 +00:00
ohif-bot c931b63d5e chore(version): version.json [skip ci] 2025-01-08 20:35:01 +00:00
Alireza 38edde5e37 fix(circleci): Update workflow dependencies for Docker publishing stages (#4662) 2025-01-08 15:30:24 -05:00
Alireza 66eebbed0f fix(circleci): Update workflow dependencies for Docker publishing stages (#4661) 2025-01-08 15:20:16 -05:00
ohif-bot 8ecbca700c chore(version): Update package versions [skip ci] 2025-01-08 20:02:34 +00:00
ohif-bot 1223dd00e1 chore(version): version.json [skip ci] 2025-01-08 20:02:28 +00:00
Alireza 3c6a5ef69e fix(circleci): Update workflow dependencies for Docker publishing stages (#4660) 2025-01-08 14:57:50 -05:00
ohif-bot dd5251ac95 chore(version): Update package versions [skip ci] 2025-01-08 19:43:13 +00:00
ohif-bot 71c0c18a8a chore(version): version.json [skip ci] 2025-01-08 19:43:07 +00:00
Alireza 5f6f528fbf fix(Dockerfile): Clear bun package manager cache before installation (#4659) 2025-01-08 14:38:39 -05:00
ohif-bot 60547b507f chore(version): Update package versions [skip ci] 2025-01-08 19:28:18 +00:00
ohif-bot f8b7687f94 chore(version): version.json [skip ci] 2025-01-08 19:28:12 +00:00
Dan Rukasandsedghi 230ae9758b ui(components): Viewport components added to ui-next (#4649)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-01-08 14:23:34 -05:00
ohif-bot 47de38f3ff chore(version): Update package versions [skip ci] 2025-01-08 19:18:23 +00:00
ohif-bot 5b454472e4 chore(version): version.json [skip ci] 2025-01-08 19:18:16 +00:00
devin-ai-integration[bot] 2f5076ece8 fix: Convert Rows and Columns to numbers before comparison (#4654) (#4656)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-01-08 14:13:28 -05:00
ohif-bot 401d5dcedd chore(version): Update package versions [skip ci] 2025-01-08 18:15:53 +00:00
ohif-bot 464976f035 chore(version): version.json [skip ci] 2025-01-08 18:15:47 +00:00
Dan Rukasandsedghi b54f2075ec ui(component): Tooltip component ui-next (#4635)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-01-08 13:10:57 -05:00
ohif-bot 03ad79eaed chore(version): Update package versions [skip ci] 2025-01-08 14:46:22 +00:00
ohif-bot e993b7f9e1 chore(version): version.json [skip ci] 2025-01-08 14:46:15 +00:00
Alireza 8e12021939 fix(docker): make multiarch work (#4655) 2025-01-08 09:41:47 -05:00
ohif-bot 8ad5d559bb chore(version): Update package versions [skip ci] 2025-01-08 14:05:29 +00:00
ohif-bot 20a4daa54e chore(version): version.json [skip ci] 2025-01-08 14:05:22 +00:00
Alireza 836e67a6ab fix(docker): publish manifest for multiarch and update cs3d (#4650) 2025-01-08 09:00:22 -05:00
ohif-bot 05e3f221a6 chore(version): Update package versions [skip ci] 2025-01-07 13:50:25 +00:00
ohif-bot b44373915a chore(version): version.json [skip ci] 2025-01-07 13:50:19 +00:00
Joe Boccanfuso 28cf3a17fa fix(toolbars): Fix error when filtering out duplicate buttons for a button section. (#4618) 2025-01-07 08:45:43 -05:00
ohif-bot 754d6b269d chore(version): Update package versions [skip ci] 2025-01-06 15:00:56 +00:00
ohif-bot c2c2911c6e chore(version): version.json [skip ci] 2025-01-06 15:00:50 +00:00
devin-ai-integration[bot] 4a8e8cacf2 fix: year 2025 missing in date picker (#4647)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-01-06 09:56:29 -05:00
ohif-bot a863808947 chore(version): Update package versions [skip ci] 2025-01-03 16:02:36 +00:00
ohif-bot 1935bf8c3c chore(version): version.json [skip ci] 2025-01-03 16:02:29 +00:00
nithin-trenserandIbrahim 55fe185c72 feat: Implemented CSV support for Arrow annotation. (#4623)
Co-authored-by: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com>
2025-01-03 10:57:25 -05:00
arul-trenserandIbrahim e11ceb9d20 fix(context menu): restrict the context menu accessibility for locked and hidden annotations (#4625)
Co-authored-by: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com>
2025-01-03 10:57:17 -05:00
Jaseel-trenserandIbrahim 6b851dfc12 fix(context menu): Implemented closing of context menu on outside click (#4627)
Co-authored-by: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com>
2025-01-03 10:57:05 -05:00
ohif-bot b7fac6df3e chore(version): Update package versions [skip ci] 2025-01-03 15:48:40 +00:00
ohif-bot 63a2d3850a chore(version): version.json [skip ci] 2025-01-03 15:48:33 +00:00
Abhijith Sb 5322064e9e fix(3D rendering): disabled light sliders when shade is off (#4631) 2025-01-03 10:43:49 -05:00
nithin-trenser 860679126a feat/Added translation option for text 'segment' (#4624) 2025-01-03 10:38:34 -05:00
ohif-bot 4ef67c0cf7 chore(version): Update package versions [skip ci] 2025-01-02 19:51:17 +00:00
ohif-bot 286ae4b1f5 chore(version): version.json [skip ci] 2025-01-02 19:51:11 +00:00
Bill Wallaceandsedghi 7e43b2f768 fix: Docker build time was very slow on a tiny change (#4559)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
2025-01-02 14:46:53 -05:00
ohif-bot ae48f50037 chore(version): Update package versions [skip ci] 2024-12-20 18:25:50 +00:00
ohif-bot d6a02a3d4b chore(version): version.json [skip ci] 2024-12-20 18:25:45 +00:00
Ibrahim 1992002d2d fix(tools): enable additional tools in volume viewport (#4620) 2024-12-20 13:19:59 -05:00
ohif-bot ede5724069 chore(version): Update package versions [skip ci] 2024-12-20 15:28:24 +00:00
ohif-bot 1593d9644a chore(version): version.json [skip ci] 2024-12-20 15:28:18 +00:00
Ibrahim 8d0ed80e0c fix(datasource): attach auth headers for delete requests in the dicomweb datasource (#4619) 2024-12-20 10:23:33 -05:00
ohif-bot a3d1844c2a chore(version): Update package versions [skip ci] 2024-12-20 13:17:50 +00:00
ohif-bot 8313952a8e chore(version): version.json [skip ci] 2024-12-20 13:17:44 +00:00
Ibrahim faf5515e4b fix(segmentation): black preview when loading a seg, and crash on opening panel (#4602) 2024-12-20 08:12:58 -05:00
ohif-bot 921e8f93b7 chore(version): Update package versions [skip ci] 2024-12-18 20:10:41 +00:00
ohif-bot 422ff828cd chore(version): version.json [skip ci] 2024-12-18 20:10:35 +00:00
Joe Boccanfuso 2df8e1d5cd fix(SR): Bring back the onModeEnter for the cornerstone-dicom-sr extension that was accidentally removed by PR #4586 (#4616) 2024-12-18 15:06:06 -05:00
ohif-bot 11050441e5 chore(version): Update package versions [skip ci] 2024-12-18 18:29:14 +00:00
ohif-bot 8bd659ba10 chore(version): version.json [skip ci] 2024-12-18 18:29:07 +00:00
Alireza 93d7076901 fix(icons): Add Clipboard icon and update MetadataProvider for null checks (#4615) 2024-12-18 13:24:42 -05:00
ohif-bot 0fc89c3bb6 chore(version): Update package versions [skip ci] 2024-12-18 17:18:57 +00:00
ohif-bot e2903319b7 chore(version): version.json [skip ci] 2024-12-18 17:18:51 +00:00
dependabot[bot]andAlireza 489171a14c chore(deps): bump nanoid from 3.3.7 to 3.3.8 (#4587)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alireza <ar.sedghi@gmail.com>
2024-12-18 12:14:12 -05:00
ohif-bot ddb19ab3da chore(version): Update package versions [skip ci] 2024-12-18 16:38:15 +00:00
ohif-bot e90757081f chore(version): version.json [skip ci] 2024-12-18 16:38:09 +00:00
Joe Boccanfuso 4d3d5e794c feat(measurements): Provide for the Load (SR) measurements button to optionally clear existing measurements prior to loading the SR. (#4586) 2024-12-18 11:33:40 -05:00
ohif-bot 7eec015ff1 chore(version): Update package versions [skip ci] 2024-12-18 14:52:37 +00:00
ohif-bot 0e2077095d chore(version): version.json [skip ci] 2024-12-18 14:52:31 +00:00
Ceciliadrc 52cf9b1e03 fix: ohif icons in Header (#4611) 2024-12-18 09:47:38 -05:00
ohif-bot 541e12a108 chore(version): Update package versions [skip ci] 2024-12-17 18:54:44 +00:00
ohif-bot f8c89dd58a chore(version): version.json [skip ci] 2024-12-17 18:54:37 +00:00
Bill Wallace d0ccdbd68d fix: Documentation and default enabled for bulkdata load (#4607) 2024-12-17 13:49:42 -05:00
ohif-bot edefe8abda chore(version): Update package versions [skip ci] 2024-12-17 18:24:43 +00:00
ohif-bot ce0830812e chore(version): version.json [skip ci] 2024-12-17 18:24:37 +00:00
Alireza 4e2ae32874 feat: migrate icons to ui-next (#4606) 2024-12-17 13:20:19 -05:00
ohif-bot e93a9c70c5 chore(version): Update package versions [skip ci] 2024-12-17 17:39:07 +00:00
ohif-bot 5ffa751cff chore(version): version.json [skip ci] 2024-12-17 17:39:00 +00:00
Alireza 9bf24d6dc5 fix(seg): jump to the first slice in SEG and RT that has data (#4605) 2024-12-17 12:34:13 -05:00
ohif-bot 7586006e7f chore(version): Update package versions [skip ci] 2024-12-13 15:12:39 +00:00
ohif-bot 6e4f7a887a chore(version): version.json [skip ci] 2024-12-13 15:12:34 +00:00
Ibrahim 60fc7d6a11 fix(tag-browser): fix dicom tag browser not loading in segmentation mode in study panel (#4601) 2024-12-13 10:07:59 -05:00
ohif-bot 7ca9df1b2b chore(version): Update package versions [skip ci] 2024-12-11 20:30:55 +00:00
ohif-bot 2a2e96378a chore(version): version.json [skip ci] 2024-12-11 20:30:49 +00:00
Alireza 1f04d6c1be feat(node): move to node 20 (#4594) 2024-12-11 15:26:26 -05:00
ohif-bot ab41183ce5 chore(version): Update package versions [skip ci] 2024-12-11 16:53:58 +00:00
ohif-bot 414b974505 chore(version): version.json [skip ci] 2024-12-11 16:53:49 +00:00
Ibrahim 684267b19b fix(worklist): selected patient changes randomly when clicked. (#4592) 2024-12-11 11:49:15 -05:00
ohif-bot 64a9f3828b chore(version): Update package versions [skip ci] 2024-12-11 02:25:59 +00:00
ohif-bot 0f428db983 chore(version): version.json [skip ci] 2024-12-11 02:25:50 +00:00
Ibrahim 1078df99aa docs(azure): Add azure integration guide and datasource configuration (#4579) 2024-12-10 21:19:58 -05:00
ohif-bot 76fb2f56d4 chore(version): Update package versions [skip ci] 2024-12-06 02:44:11 +00:00
ohif-bot 54edfdcb04 chore(version): version.json [skip ci] 2024-12-06 02:44:03 +00:00
Alireza 6ec04ca65e fix(sr): correct jump to first image via viewRef (#4576) 2024-12-05 21:39:13 -05:00
ohif-bot 6c7f535676 chore(version): Update package versions [skip ci] 2024-12-06 02:02:37 +00:00
ohif-bot 3708917f15 chore(version): version.json [skip ci] 2024-12-06 02:02:28 +00:00
Joe Boccanfuso 6160718fd2 fix(touch): For viewport interactions use onPointerDown. (#4572) 2024-12-05 20:57:34 -05:00
ohif-bot ee9593a7e0 chore(version): Update package versions [skip ci] 2024-12-05 18:35:10 +00:00
ohif-bot 581aab67a6 chore(version): version.json [skip ci] 2024-12-05 18:35:03 +00:00
Leonardo Campos 7cc6c1484a fix(defaultRouteInit): fixes 'madeInClient' parameter when 'makeDisplaySets' is called (#4571) 2024-12-05 13:30:23 -05:00
Leonardo Campos f87c6cd2aa feat(extension): added 'extensionManager' to 'onModeEnter' parameter list (#4569) 2024-12-05 13:29:59 -05:00
ohif-bot 3ee0aafebc chore(version): Update package versions [skip ci] 2024-12-05 16:35:51 +00:00
ohif-bot ced674e48a chore(version): version.json [skip ci] 2024-12-05 16:35:44 +00:00
AlirezaandIbrahim b8e8bbe482 fix(CinePlayer): always show cine player for dynamic data (#4575)
Co-authored-by: Ibrahim <ibrahim.mdev@gmail.com>
2024-12-05 11:30:21 -05:00
ohif-bot 72a35ce905 chore(version): Update package versions [skip ci] 2024-12-03 19:32:07 +00:00
ohif-bot a9e566ffee chore(version): version.json [skip ci] 2024-12-03 19:31:59 +00:00
Leonardo Campos bca2022351 fix(WorkflowSteps): fixed how hooks are invoked + added support for 'onExit' hook (#4568) 2024-12-03 16:26:47 -03:00
ohif-bot e4595fd234 chore(version): Update package versions [skip ci] 2024-12-02 13:59:08 +00:00
ohif-bot 0ea2c7fdde chore(version): version.json [skip ci] 2024-12-02 13:59:00 +00:00
Salim Kanoun 878a1f8af8 fix : Resize was broken if 3d viewport displayed in HP (#4561) 2024-12-02 08:53:46 -05:00
2822 changed files with 166158 additions and 56462 deletions

No files matched your search

+181 -24
View File
@@ -2,11 +2,11 @@ version: 2.1
orbs:
codecov: codecov/codecov@1.0.5
cypress: cypress-io/cypress@3.3.1
cypress: cypress-io/cypress@3.4.2
defaults: &defaults
docker:
- image: cimg/node:18.18
- image: cimg/node:20.18.1
environment:
TERM: xterm
QUICK_BUILD: true
@@ -208,7 +208,7 @@ jobs:
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Build and push Docker image from the release branch
name: Build Docker image for amd64
command: |
# This file will exist if a new version was published by
# our command in the previous job.
@@ -222,12 +222,50 @@ jobs:
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
# Build our image, auth, and push
docker build --tag ohif/app:$IMAGE_VERSION_FULL --tag ohif/app:latest .
# Build our amd64 image, auth, and push
docker build --platform linux/amd64 --tag ohif/app:$IMAGE_VERSION_FULL-amd64 --tag ohif/app:latest-amd64 .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/app:$IMAGE_VERSION_FULL
docker push ohif/app:latest
docker push ohif/app:$IMAGE_VERSION_FULL-amd64
docker push ohif/app:latest-amd64
fi
- persist_to_workspace:
root: ~/repo
paths:
- .
DOCKER_RELEASE_PUBLISH_ARM:
<<: *defaults
resource_class: arm.large
steps:
- attach_workspace:
at: ~/repo
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Build Docker image for arm64 (Release)
command: |
# This file will exist if a new version was published by
# our command in the previous job.
if [[ ! -e version.txt ]]; then
exit 0
else
# Remove npm config
rm -f ./.npmrc
# Set our version number using vars
export IMAGE_VERSION=$(cat version.txt)
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
# Build our arm64 image, auth, and push
docker build --platform linux/arm64 --tag ohif/app:$IMAGE_VERSION_FULL-arm64 --tag ohif/app:latest-arm64 .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/app:$IMAGE_VERSION_FULL-arm64
docker push ohif/app:latest-arm64
fi
- persist_to_workspace:
root: ~/repo
paths:
- .
DOCKER_BETA_PUBLISH:
<<: *defaults
@@ -238,7 +276,7 @@ jobs:
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Build and push Docker image from the master branch (beta releases)
name: Build Docker image for amd64 (Beta)
command: |
echo $(ls -l)
@@ -250,19 +288,50 @@ jobs:
else
echo "Building and pushing Docker image from the master branch (beta releases)"
rm -f ./.npmrc
# Set our version number using vars
export IMAGE_VERSION=$(cat version.txt)
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
# Build our image, auth, and push
echo "starting docker build"
docker build --tag ohif/app:$IMAGE_VERSION_FULL .
# Build our amd64 image, auth, and push
docker build --platform linux/amd64 --tag ohif/app:$IMAGE_VERSION_FULL-amd64 --tag ohif/app:latest-beta-amd64 .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/app:$IMAGE_VERSION_FULL-amd64
docker push ohif/app:latest-beta-amd64
fi
echo "starting docker push"
docker push ohif/app:$IMAGE_VERSION_FULL
DOCKER_BETA_PUBLISH_ARM:
<<: *defaults
resource_class: arm.large
steps:
- attach_workspace:
at: ~/repo
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Build Docker image for arm64 (Beta)
command: |
echo $(ls -l)
# This file will exist if a new version was published by
# our command in the previous job.
if [[ ! -e version.txt ]]; then
echo "don't have version txt"
exit 0
else
echo "Building and pushing ARM64 Docker image from the master branch (beta releases)"
rm -f ./.npmrc
# Set our version number using vars
export IMAGE_VERSION=$(cat version.txt)
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
# Build our arm64 image, auth, and push
docker build --platform linux/arm64 --tag ohif/app:$IMAGE_VERSION_FULL-arm64 --tag ohif/app:latest-beta-arm64 .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/app:$IMAGE_VERSION_FULL-arm64
docker push ohif/app:latest-beta-arm64
fi
CYPRESS:
@@ -270,10 +339,11 @@ jobs:
resource_class: large
parallelism: 8
steps:
- install_bun
- run:
name: Install Xvfb
command: sudo apt-get update && sudo apt-get install -y xvfb
name: Install System Dependencies
command: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6
- run:
name: Start Xvfb
command: Xvfb :99 -screen 0 1920x1080x24 &
@@ -282,14 +352,89 @@ jobs:
name: Export Display Variable
command: export DISPLAY=:99
- cypress/install:
install-browsers: true
install-command: bun install --no-save
package-manager: yarn
install-command: yarn install --no-save
- cypress/run-tests:
cypress-command:
npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run --record
--browser chrome --parallel
start-command: bun run test:data && bun run test:e2e:serve
cypress-command: |
npx wait-on@latest http://localhost:3000 && cd platform/app && npx cypress run --record --parallel
start-command: yarn run test:data && yarn run test:e2e:serve
DOCKER_MULTIARCH_MANIFEST:
<<: *defaults
resource_class: large
steps:
- attach_workspace:
at: ~/repo
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Create and push multi-architecture manifest (Release)
command: |
# This file will exist if a new version was published by
# our command in the previous job.
if [[ ! -e version.txt ]]; then
exit 0
else
echo "Building and pushing multi-architecture manifest from the master branch (release releases)"
rm -f ./.npmrc
# Set our version number using vars
export IMAGE_VERSION=$(cat version.txt)
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
# Create and push manifest for specific version
docker manifest create ohif/app:$IMAGE_VERSION_FULL \
--amend ohif/app:$IMAGE_VERSION_FULL-amd64 \
--amend ohif/app:$IMAGE_VERSION_FULL-arm64
docker manifest push ohif/app:$IMAGE_VERSION_FULL
# Create and push manifest for "latest" tag
docker manifest create ohif/app:latest \
--amend ohif/app:latest-amd64 \
--amend ohif/app:latest-arm64
docker manifest push ohif/app:latest
fi
DOCKER_BETA_MULTIARCH_MANIFEST:
<<: *defaults
resource_class: large
steps:
- attach_workspace:
at: ~/repo
- setup_remote_docker:
docker_layer_caching: false
- run:
name: Create and push multi-architecture manifest (Beta)
command: |
echo $(ls -l)
# This file will exist if a new version was published by
# our command in the previous job.
if [[ ! -e version.txt ]]; then
exit 0
else
echo "Building and pushing multi-architecture manifest from the master branch (beta releases)"
rm -f ./.npmrc
# Set our version number using vars
export IMAGE_VERSION=$(cat version.txt)
export IMAGE_VERSION_FULL=v$IMAGE_VERSION
echo $IMAGE_VERSION
echo $IMAGE_VERSION_FULL
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
# Create and push manifest for specific beta version
docker manifest create ohif/app:$IMAGE_VERSION_FULL \
--amend ohif/app:$IMAGE_VERSION_FULL-amd64 \
--amend ohif/app:$IMAGE_VERSION_FULL-arm64
docker manifest push ohif/app:$IMAGE_VERSION_FULL
# Create and push manifest for "latest-beta" tag
docker manifest create ohif/app:latest-beta \
--amend ohif/app:latest-beta-amd64 \
--amend ohif/app:latest-beta-arm64
docker manifest push ohif/app:latest-beta
fi
workflows:
PR_CHECKS:
@@ -316,6 +461,12 @@ workflows:
- DOCKER_BETA_PUBLISH:
requires:
- NPM_PUBLISH
- DOCKER_BETA_PUBLISH_ARM:
requires:
- DOCKER_BETA_PUBLISH
- DOCKER_BETA_MULTIARCH_MANIFEST:
requires:
- DOCKER_BETA_PUBLISH_ARM
# viewer.ohif.org
DEPLOY_RELEASE:
@@ -334,3 +485,9 @@ workflows:
- DOCKER_RELEASE_PUBLISH:
requires:
- NPM_PUBLISH
- DOCKER_RELEASE_PUBLISH_ARM:
requires:
- DOCKER_RELEASE_PUBLISH
- DOCKER_MULTIARCH_MANIFEST:
requires:
- DOCKER_RELEASE_PUBLISH_ARM
+4 -1
View File
@@ -1,10 +1,13 @@
server {
gzip_static always;
gzip_proxied expired no-cache no-store private auth;
gunzip on;
listen ${PORT} default_server;
listen [::]:${PORT} default_server;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
try_files $uri $uri/ ${PUBLIC_URL}index.html;
add_header Cross-Origin-Resource-Policy same-origin;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
+24 -6
View File
@@ -2,16 +2,34 @@
if [ -n "$SSL_PORT" ]
then
envsubst '${SSL_PORT}:${PORT}' < /usr/src/default.ssl.conf.template > /etc/nginx/conf.d/default.conf
envsubst '${SSL_PORT}:${PORT}' < /usr/src/default.ssl.conf.template | envsubst '${PUBLIC_URL}' > /etc/nginx/conf.d/default.conf
else
envsubst '${PORT}' < /usr/src/default.conf.template > /etc/nginx/conf.d/default.conf
envsubst '${PORT}:${PUBLIC_URL}' < /usr/src/default.conf.template > /etc/nginx/conf.d/default.conf
fi
if [ -n "$APP_CONFIG" ]
then
echo "$APP_CONFIG" > /usr/share/nginx/html/app-config.js
if [ -n "$APP_CONFIG" ]; then
echo "$APP_CONFIG" > /usr/share/nginx/html${PUBLIC_URL}app-config.js
echo "Using custom APP_CONFIG environment variable"
else
echo "Not using custom APP_CONFIG"
fi
if [ -f /usr/share/nginx/html${PUBLIC_URL}app-config.js ]; then
if [ -s /usr/share/nginx/html${PUBLIC_URL}app-config.js ]; then
echo "Detected non-empty app-config.js. Ensuring .gz file is updated..."
rm -f /usr/share/nginx/html${PUBLIC_URL}app-config.js.gz
gzip /usr/share/nginx/html${PUBLIC_URL}app-config.js
touch /usr/share/nginx/html${PUBLIC_URL}app-config.js
echo "Compressed app-config.js to app-config.js.gz"
else
echo "app-config.js is empty. Skipping compression."
fi
else
echo "No app-config.js file found. Skipping compression."
fi
if [ -n "$CLIENT_ID" ] || [ -n "$HEALTHCARE_API_ENDPOINT" ]
then
# If CLIENT_ID is specified, use the google.js configuration with the modified ID
@@ -40,6 +58,6 @@ if [ -n "$CLIENT_ID" ] || [ -n "$HEALTHCARE_API_ENDPOINT" ]
cp /usr/share/nginx/html/google.js /usr/share/nginx/html/app-config.js
fi
echo "Starting Nginx to serve the OHIF Viewer..."
echo "Starting Nginx to serve the OHIF Viewer on ${PUBLIC_URL}"
exec "$@"
+4
View File
@@ -0,0 +1,4 @@
find platform/app/dist -name "*.js" -exec gzip -9 "{}" \; -exec touch "{}" \;
find platform/app/dist -name "*.map" -exec gzip -9 "{}" \; -exec touch "{}" \;
find platform/app/dist -name "*.css" -exec gzip -9 "{}" \; -exec touch "{}" \;
find platform/app/dist -name "*.svg" -exec gzip -9 "{}" \; -exec touch "{}" \;
+4 -4
View File
@@ -8,11 +8,11 @@
# have this file as their .dockerignore.
# Output
dist/
build/
**/dist/
**/build/
# Dependencies
node_modules/
**/node_modules/
# Root
README.md
@@ -33,5 +33,5 @@ dockerfile
.scripts/
.vscode/
coverage/
docs/
platform/docs/
testdata/
+2 -1
View File
@@ -18,7 +18,8 @@
},
"rules": {
// Enforce consistent brace style for all control statements for readability
"curly": "error"
"curly": "error",
"import/no-anonymous-default-export": "off"
},
"globals": {
"cy": true,
+19
View File
@@ -0,0 +1,19 @@
version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: 'bun'
directory: '/'
schedule:
interval: 'daily'
labels: ['dependencies']
commit-message:
prefix: 'chore'
include: 'scope'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
labels: ['dependencies']
commit-message:
prefix: 'chore'
include: 'scope'
+1 -1
View File
@@ -64,7 +64,7 @@ body:
attributes:
label: 'Node version'
description: 'Your Node.js version.'
placeholder: 'e.g., 18.16.1'
placeholder: 'e.g., 20.18.1'
validations:
required: true
- type: input
+108
View File
@@ -0,0 +1,108 @@
name: Build and Deploy Docs
on:
push:
branches: [master]
env:
ACTIONS_STEP_DEBUG: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy-docs:
timeout-minutes: 60
runs-on: ubuntu-latest
# Need permissions to read actions and pull requests
permissions:
actions: read
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 20 # Or your desired Node version
- name: Install root dependencies
run: bun install --frozen-lockfile
# Removed Playwright tests and coverage generation steps
- name: Find PR and associated workflow run
id: find_pr_run
env:
GH_TOKEN: ${{ github.token }}
MERGE_COMMIT_SHA: ${{ github.sha }}
run: |
# Find the PR associated with the merge commit SHA
# Note: This relies on the merge commit being directly pushed to main
PR_DATA=$(gh pr list --state merged --search "$MERGE_COMMIT_SHA" --json number,headRefOid --jq '.[0]')
if [ -z "$PR_DATA" ]; then
echo "Could not find merged PR for commit $MERGE_COMMIT_SHA."
# Decide how to handle - fail, or maybe generate coverage now?
# For now, let's fail.
exit 1
fi
PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
PR_NUMBER=$(echo "$PR_DATA" | jq -r '.number')
echo "Found PR Number: $PR_NUMBER"
echo "Found PR Head SHA: $PR_HEAD_SHA"
# Find the latest workflow run ID for the playwright workflow on the PR head commit
# Uses the workflow file name 'playwright.yml'
# Remove the --status success flag to find any run
RUN_ID=$(gh run list --workflow playwright.yml --commit "$PR_HEAD_SHA" --event pull_request --json databaseId --jq '.[0].databaseId')
if [ -z "$RUN_ID" ]; then
echo "Could not find any 'playwright.yml' run for PR $PR_NUMBER (Head SHA: $PR_HEAD_SHA)."
# Decide how to handle - maybe try finding the artifact from the merge commit run if that exists?
# For now, let's fail.
exit 1
fi
echo "Found Run ID: $RUN_ID"
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
- name: Download coverage artifact from PR run
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p ./coverage-artifact
gh run download ${{ steps.find_pr_run.outputs.run_id }} -n coverage-report-pr --dir ./coverage-artifact
# Check if download was successful (e.g., check if files exist)
if [ ! -f ./coverage-artifact/base.css ]; then
echo "Failed to download or find expected files in artifact 'coverage-report-pr' from run ${{ steps.find_pr_run.outputs.run_id }}."
exit 1
fi
echo "Artifact downloaded successfully."
- name: Install docs dependencies
run: cd platform/docs && bun install
- name: Copy coverage to docs static directory
run: |
# Copy files from the downloaded artifact directory
mkdir -p platform/docs/static/coverage
cp -r ./coverage-artifact/* platform/docs/static/coverage/
# Copy specific asset files from the downloaded artifact root to static root
cp ./coverage-artifact/base.css platform/docs/static/
cp ./coverage-artifact/block-navigation.js platform/docs/static/
cp ./coverage-artifact/prettify.css platform/docs/static/
cp ./coverage-artifact/prettify.js platform/docs/static/
cp ./coverage-artifact/favicon.png platform/docs/static/
cp ./coverage-artifact/sort-arrow-sprite.png platform/docs/static/
cp ./coverage-artifact/sorter.js platform/docs/static/
- name: Build docs
run: cd platform/docs && bun run build
- name: Deploy to Netlify
run: |
cd platform/docs
npx netlify-cli deploy --dir=./build --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
+98
View File
@@ -0,0 +1,98 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
pull_request:
branches: [ "main" ]
schedule:
- cron: '15 1 * * 5'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
+32 -54
View File
@@ -1,76 +1,54 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
playwright-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.49.0-noble
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shardTotal: [10]
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install unzip
run: apt-get update && apt-get install -y unzip
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Set up Git safe directory
run: git config --global --add safe.directory /__w/Viewers/Viewers
- name: Install Playwright browsers
run: npx playwright install
- name: Run Playwright tests
run:
export NODE_OPTIONS="--max_old_space_size=8192" && bun x playwright test --shard=${{
matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload blob report to GitHub Actions Artifacts
run: |
export NODE_OPTIONS="--max_old_space_size=10192"
bun run test:e2e:coverage
- name: Create directory of test results
if: ${{ !cancelled() }}
run: |
mkdir -p packaged-test-results
cp -r ./tests/test-results packaged-test-results/ || true
cp ./tests/playwright-report.json packaged-test-results/ || true
- name: Upload directory of test results artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
merge-reports:
if: ${{ !cancelled() }}
needs: [playwright-tests]
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.1-focal
steps:
- name: Install unzip
run: apt-get update && apt-get install -y unzip
- uses: oven-sh/setup-bun@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Set up Git safe directory
run: git config --global --add safe.directory /__w/Viewers/Viewers
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: bun x playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
name: playwright-results
path: packaged-test-results/
retention-days: 5
- name: create the coverage report
run: |
bun nyc report --reporter=lcov --reporter=text
- name: Upload the coverage report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
name: coverage-report-pr
path: coverage
retention-days: 3
+8 -1
View File
@@ -1,6 +1,7 @@
# Packages
node_modules
.cursor/
.nyc_output/
# Output
build
dist
@@ -12,6 +13,7 @@ coverage/
.yarn/
.nx/
addOns/yarn.lock
playwright-report/
# YALC (for Erik)
.yalc
@@ -56,3 +58,8 @@ tests/test-results/
tests/playwright-report/
/blob-report/
/playwright/.cache/
**/.claude/settings.local.json
# Backup files
*~
+1 -1
View File
@@ -1 +1 @@
18.16.1
20.9.0
+24
View File
@@ -0,0 +1,24 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"instrument": true,
"sourceMap": true,
"cache": false,
"all": true,
"include": [
"platform/*/src/**/*.ts",
"platform/*/src/**/*.js",
"extensions/*/src/**/*.ts",
"extensions/*/src/**/*.js",
"modes/*/src/**/*.ts",
"modes/*/src/**/*.js"
],
"exclude": [
"**/*.spec.ts",
"**/*.test.ts",
"**/test/**",
"**/tests/**",
"**/examples/**",
"**/stories/**",
"platform/docs/**"
]
}
+4 -1
View File
@@ -82,6 +82,7 @@
"Reslices",
"roadmap",
"ROADMAPS",
"rtstruct",
"Segmentations",
"semibold",
"sitk",
@@ -109,6 +110,8 @@
"wado",
"wadors",
"wadouri",
"workerpool"
"workerpool",
"Colorbar",
"Colorbars"
]
}
+30 -8
View File
@@ -26,6 +26,7 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'
const NODE_ENV = process.env.NODE_ENV;
const QUICK_BUILD = process.env.QUICK_BUILD;
const BUILD_NUM = process.env.CIRCLE_BUILD_NUM || '0';
const IS_COVERAGE = process.env.COVERAGE === 'true';
// read from ../version.txt
const VERSION_NUMBER = fs.readFileSync(path.join(__dirname, '../version.txt'), 'utf8') || '';
@@ -49,6 +50,7 @@ const defineValues = {
'process.env.LOCIZE_PROJECTID': JSON.stringify(process.env.LOCIZE_PROJECTID || ''),
'process.env.LOCIZE_API_KEY': JSON.stringify(process.env.LOCIZE_API_KEY || ''),
'process.env.REACT_APP_I18N_DEBUG': JSON.stringify(process.env.REACT_APP_I18N_DEBUG || ''),
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV || ''),
};
// Only redefine updated values. This avoids warning messages in the logs
@@ -99,14 +101,30 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
...(isProdBuild
? []
: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
plugins: isProdBuild ? [] : ['react-refresh/babel'],
},
},
...(IS_COVERAGE
? [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-typescript', '@babel/preset-react'],
plugins: ['istanbul'],
},
},
},
]
: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
plugins: isProdBuild ? [] : ['react-refresh/babel'],
},
},
]),
]),
{
test: /\.svg?$/,
@@ -168,6 +186,10 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
},
],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
], //.concat(vtkRules),
},
resolve: {
+2781
View File
File diff suppressed because it is too large. Load diff
+56 -31
View File
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1.7-labs
# This dockerfile is used to publish the `ohif/app` image on dockerhub.
#
# It's a good example of how to build our static application and package it
@@ -19,61 +20,85 @@
#
# syntax=docker/dockerfile:1.7-labs
# This dockerfile is used to publish the `ohif/app` image on dockerhub.
#
# It's a good example of how to build our static application and package it
# with a web server capable of hosting it as static content.
#
# docker build
# --------------
# If you would like to use this dockerfile to build and tag an image, make sure
# you set the context to the project's root directory:
# https://docs.docker.com/engine/reference/commandline/build/
#
#
# SUMMARY
# --------------
# This dockerfile is used as an input for a second stage to make things run faster.
#
# Stage 1: Build the application
# docker build -t ohif/viewer:latest .
FROM node:18.16.1-slim as json-copier
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY ["package.json", "yarn.lock", "preinstall.js", "./"]
COPY extensions /usr/src/app/extensions
COPY modes /usr/src/app/modes
COPY platform /usr/src/app/platform
# Find and remove non-package.json files
#RUN find extensions \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
#RUN find modes \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
#RUN find platform \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
# Copy Files
FROM node:18.16.1-slim as builder
FROM node:20.18.1-slim as builder
RUN apt-get update && apt-get install -y build-essential python3
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
RUN npm install -g bun
# RUN npm install -g lerna@7.4.2
ENV PATH=/usr/src/app/node_modules/.bin:$PATH
COPY --from=json-copier /usr/src/app .
# Do an initial install and then a final install
COPY package.json yarn.lock preinstall.js lerna.json ./
COPY --parents ./addOns/package.json ./addOns/*/*/package.json ./extensions/*/package.json ./modes/*/package.json ./platform/*/package.json ./
# Run the install before copying the rest of the files
RUN yarn config set workspaces-experimental true
RUN yarn install --frozen-lockfile --verbose
COPY . .
RUN bun pm cache rm
RUN bun install
# Copy the local directory
COPY --link --exclude=yarn.lock --exclude=package.json --exclude=Dockerfile . .
# To restore workspaces symlinks
RUN yarn install --frozen-lockfile --verbose
ENV PATH /usr/src/app/node_modules/.bin:$PATH
# Build here
# After install it should hopefully be stable until the local directory changes
ENV QUICK_BUILD true
# ENV GENERATE_SOURCEMAP=false
# ENV REACT_APP_CONFIG=config/default.js
ARG APP_CONFIG=config/default.js
ARG PUBLIC_URL=/
ENV PUBLIC_URL=${PUBLIC_URL}
RUN yarn run build
RUN bun run show:config
RUN bun run build
# Precompress files
RUN chmod u+x .docker/compressDist.sh
RUN ./.docker/compressDist.sh
# Stage 3: Bundle the built application into a Docker container
# which runs Nginx using Alpine Linux
FROM nginxinc/nginx-unprivileged:1.25-alpine as final
FROM nginxinc/nginx-unprivileged:1.27-alpine as final
#RUN apk add --no-cache bash
ENV PORT=80
ARG PUBLIC_URL=/
ENV PUBLIC_URL=${PUBLIC_URL}
ARG PORT=80
ENV PORT=${PORT}
RUN rm /etc/nginx/conf.d/default.conf
USER nginx
COPY --chown=nginx:nginx .docker/Viewer-v3.x /usr/src
RUN chmod 777 /usr/src/entrypoint.sh
COPY --from=builder /usr/src/app/platform/app/dist /usr/share/nginx/html
COPY --from=builder /usr/src/app/platform/app/dist /usr/share/nginx/html${PUBLIC_URL}
# Copy paths that are renamed/redirected generally
# Microscopy libraries depend on root level include, so must be copied
COPY --from=builder /usr/src/app/platform/app/dist/dicom-microscopy-viewer /usr/share/nginx/html/dicom-microscopy-viewer
# In entrypoint.sh, app-config.js might be overwritten, so chmod it to be writeable.
# The nginx user cannot chmod it, so change to root.
USER root
RUN chmod 666 /usr/share/nginx/html/app-config.js
RUN chown -R nginx:nginx /usr/share/nginx/html
USER nginx
ENTRYPOINT ["/usr/src/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
+3 -3
View File
@@ -1,5 +1,4 @@
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<div align="center">
<h1>OHIF Medical Imaging Viewer</h1>
<p><strong>The OHIF Viewer</strong> is a zero-footprint medical image viewer
@@ -135,7 +134,7 @@ Here is a schematic representation of our development workflow:
### Requirements
- [Yarn 1.17.3+](https://yarnpkg.com/en/docs/install)
- [Yarn 1.20.0+](https://yarnpkg.com/en/docs/install)
- [Node 18+](https://nodejs.org/en/)
- Yarn Workspaces should be enabled on your machine:
- `yarn config set workspaces-experimental true`
@@ -171,7 +170,8 @@ also supports a number of commands that can be found in their respective
| Yarn Commands | Description |
| ---------------------------- | ------------------------------------------------------------- |
| **Develop** | |
| `dev` or `start` | Default development experience for Viewer |
| `dev` | Default development experience for Viewer |
| `dev:fast` | Our experimental fast dev mode that uses rsbuild instead of webpack |
| `test:unit` | Jest multi-project test runner; overall coverage |
| **Deploy** | |
| `build`\* | Builds production output for our PWA Viewer | |
File diff suppressed because it is too large. Load diff
+16 -15
View File
@@ -1,7 +1,7 @@
{
"name": "@externals/devDependencies",
"description": "External dev dependencies - put dev build dependencies here",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"license": "MIT",
"private": true,
"engines": {
@@ -10,23 +10,27 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@kitware/vtk.js": "32.1.1",
"@kitware/vtk.js": "32.12.0",
"clsx": "^2.1.1",
"core-js": "^3.2.1",
"moment": "^2.9.4"
"moment": "^2.30.1"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@babel/eslint-parser": "7.28.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@rsbuild/core": "^1.3.16",
"@rsbuild/plugin-node-polyfill": "^1.3.0",
"@rsbuild/plugin-react": "^1.3.1",
"@svgr/webpack": "^8.1.0",
"@swc/helpers": "^0.5.15",
"@types/jest": "^27.5.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"autoprefixer": "^10.4.4",
"babel-eslint": "9.x",
"babel-loader": "^8.2.4",
"babel-plugin-module-resolver": "^5.0.0",
"clean-webpack-plugin": "^3.0.0",
@@ -35,14 +39,14 @@
"css-loader": "^6.8.1",
"dotenv": "^8.1.0",
"eslint": "^8.39.0",
"eslint-config-prettier": "^7.2.0",
"eslint-config-prettier": "7.2.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-flowtype": "^7.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier": "5.5.1",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
@@ -64,25 +68,22 @@
"postcss-import": "^14.0.2",
"postcss-loader": "^6.1.1",
"postcss-preset-env": "^7.4.3",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.4",
"prettier": "3.6.2",
"prettier-plugin-tailwindcss": "0.6.9",
"react-refresh": "^0.14.2",
"semver": "^7.5.1",
"serve": "^14.2.0",
"serve": "^14.2.4",
"shader-loader": "^1.3.1",
"shx": "^0.3.3",
"source-map-loader": "^4.0.1",
"start-server-and-test": "^1.10.0",
"style-loader": "^1.0.0",
"stylus": "^0.59.0",
"stylus-loader": "^7.1.3",
"terser-webpack-plugin": "^5.1.4",
"typescript": "5.5.4",
"unused-webpack-plugin": "2.4.0",
"webpack": "5.94.0",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "4.7.3",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "5.2.2",
"webpack-hot-middleware": "^2.25.0",
"webpack-merge": "^5.7.3",
"workbox-webpack-plugin": "^6.1.5",
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@externals/dicom-microscopy-viewer",
"description": "External reference to dicom-microscopy-viewer",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"license": "MIT",
"dependencies": {
"dicom-microscopy-viewer": "^0.46.1"
+11 -11
View File
@@ -21,24 +21,24 @@
"preinstall": "cd .. && node preinstall.js"
},
"devDependencies": {
"@babel/core": "7.24.7",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/core": "7.28.0",
"@babel/plugin-transform-class-properties": "^7.27.1",
"@babel/plugin-transform-object-rest-spread": "^7.28.0",
"@babel/plugin-transform-private-methods": "^7.27.1",
"@babel/plugin-transform-private-property-in-object": "^7.27.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-arrow-functions": "^7.16.7",
"@babel/plugin-transform-regenerator": "^7.16.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/plugin-transform-typescript": "^7.13.0",
"@babel/preset-env": "7.24.7",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.13.0"
"@babel/plugin-transform-runtime": "7.28.0",
"@babel/plugin-transform-typescript": "^7.28.0",
"@babel/preset-env": "7.28.0",
"@babel/preset-react": "^7.27.1",
"@babel/preset-typescript": "^7.27.1"
},
"resolutions": {
"**/@babel/runtime": "^7.20.13",
"commander": "8.3.0",
"dcmjs": ">=0.33.0",
"dcmjs": "0.43.1",
"dicomweb-client": ">=0.10.4",
"nth-check": "^2.1.1",
"trim-newlines": "^5.0.0",
+8 -7
View File
@@ -1,14 +1,12 @@
// https://babeljs.io/docs/en/options#babelrcroots
const { extendDefaultPlugins } = require('svgo');
module.exports = {
babelrcRoots: ['./platform/*', './extensions/*', './modes/*'],
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
plugins: [
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
'@babel/plugin-transform-typescript',
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
'@babel/plugin-transform-class-static-block',
],
env: {
@@ -20,19 +18,23 @@ module.exports = {
{
modules: 'commonjs',
debug: false,
targets: { node: 'current' },
bugfixes: true,
},
],
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'babel-plugin-istanbul',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator',
'@babel/transform-destructuring',
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-typescript',
'@babel/plugin-transform-class-static-block',
'@babel/plugin-transform-for-of',
],
},
production: {
@@ -51,7 +53,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
+8173
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +1 @@
085590a4ca64bebad9ef60503411e1a6dd4d93f9
9d94e26d5d15ccd19f12020dbc5438364d88d253
+118
View File
@@ -0,0 +1,118 @@
diff --git a/extensions/cornerstone/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx b/extensions/cornerstone/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx
index 6c1e4f8f6..56dac15b5 100644
--- a/extensions/cornerstone/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx
+++ b/extensions/cornerstone/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx
@@ -156,65 +156,65 @@ function ViewportOrientationMenu({
>
<Button
variant="ghost"
- className="flex h-[28px] flex-shrink-0 items-center justify-start self-stretch"
+ className="flex h-7 w-full flex-shrink-0 items-center justify-start self-stretch px-1 py-0"
onClick={() => handleOrientationChange('axial')}
>
- <span className="mr-0 flex w-4 items-center justify-center">
+ <div className="mr-1 flex w-6 items-center justify-start">
{currentOrientation === 'axial' ? (
- <Icons.Checked className="text-primary h-5 w-5" />
+ <Icons.Checked className="text-primary h-6 w-6" />
) : null}
- </span>
- <span className="flex-1 text-left">Axial</span>
+ </div>
+ <div className="flex-1 text-left">Axial</div>
</Button>
<Button
variant="ghost"
- className="flex h-[28px] flex-shrink-0 items-center justify-start self-stretch"
+ className="flex h-7 w-full flex-shrink-0 items-center justify-start self-stretch px-1 py-0"
onClick={() => handleOrientationChange('sagittal')}
>
- <span className="mr-0 flex w-4 items-center justify-center">
+ <div className="mr-1 flex w-6 items-center justify-start">
{currentOrientation === 'sagittal' ? (
- <Icons.Checked className="text-primary h-5 w-5" />
+ <Icons.Checked className="text-primary h-6 w-6" />
) : null}
- </span>
- <span className="flex-1 text-left">Sagittal</span>
+ </div>
+ <div className="flex-1 text-left">Sagittal</div>
</Button>
<Button
variant="ghost"
- className="flex h-[28px] flex-shrink-0 items-center justify-start self-stretch"
+ className="flex h-7 w-full flex-shrink-0 items-center justify-start self-stretch px-1 py-0"
onClick={() => handleOrientationChange('coronal')}
>
- <span className="mr-0 flex w-4 items-center justify-center">
+ <div className="mr-1 flex w-6 items-center justify-start">
{currentOrientation === 'coronal' ? (
- <Icons.Checked className="text-primary h-5 w-5" />
+ <Icons.Checked className="text-primary h-6 w-6" />
) : null}
- </span>
- <span className="flex-1 text-left">Coronal</span>
+ </div>
+ <div className="flex-1 text-left">Coronal</div>
</Button>
<Button
variant="ghost"
- className="flex h-[28px] flex-shrink-0 items-center justify-start self-stretch"
+ className="flex h-7 w-full flex-shrink-0 items-center justify-start self-stretch px-1 py-0"
onClick={() => handleOrientationChange('acquisition')}
>
- <span className="mr-0 flex w-4 items-center justify-center">
+ <div className="mr-1 flex w-6 items-center justify-start">
{currentOrientation === 'acquisition' ? (
- <Icons.Checked className="text-primary h-5 w-5" />
+ <Icons.Checked className="text-primary h-6 w-6" />
) : null}
- </span>
- <span className="flex-1 text-left">Acquisition</span>
+ </div>
+ <div className="flex-1 text-left">Acquisition</div>
</Button>
{/* Divider */}
- <div className="my-2 border-t border-white/20" />
+ <div className="mx-1 my-2 border-t border-white/20" />
<Button
variant="ghost"
- className="flex h-[28px] flex-shrink-0 items-center justify-start self-stretch"
+ className="flex h-7 w-full flex-shrink-0 items-center justify-start self-stretch px-1 py-0"
onClick={() => handleOrientationChange('reformat')}
>
- <span className="mr-0 flex w-4 items-center justify-center">
+ <div className="mr-1 flex w-6 items-center justify-start">
{currentOrientation === 'reformat' ? (
- <Icons.Checked className="text-primary h-5 w-5" />
+ <Icons.Checked className="text-primary h-6 w-6" />
) : null}
- </span>
- <span className="flex-1 text-left">Reformat</span>
+ </div>
+ <div className="flex-1 text-left">Reformat</div>
</Button>
</PopoverContent>
</Popover>
diff --git a/platform/ui-next/src/components/Icons/Sources/Checked.tsx b/platform/ui-next/src/components/Icons/Sources/Checked.tsx
index 83c8fc57e..c88b75e0d 100644
--- a/platform/ui-next/src/components/Icons/Sources/Checked.tsx
+++ b/platform/ui-next/src/components/Icons/Sources/Checked.tsx
@@ -4,14 +4,14 @@ import type { IconProps } from '../types';
export const Checked = (props: IconProps) => (
<svg
{...props}
- width="24"
+ width="20"
height="24"
- viewBox="0 0 24 24"
+ viewBox="0 0 20 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
- d="M16 9L11.3333 15L8 12.4737"
+ d="M14 9L9.3333 15L6 12.4737"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,5 @@
module.exports = {
plugins: ['@babel/plugin-proposal-class-properties'],
plugins: ['@babel/plugin-transform-class-properties'],
env: {
test: {
presets: [
@@ -15,7 +15,7 @@ module.exports = {
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator',
'@babel/plugin-transform-runtime',
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-pmap",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "DICOM Parametric Map read workflow",
"author": "OHIF",
"license": "MIT",
@@ -33,10 +33,10 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "3.10.0-beta.12",
"@ohif/extension-cornerstone": "3.10.0-beta.12",
"@ohif/extension-default": "3.10.0-beta.12",
"@ohif/i18n": "3.10.0-beta.12",
"@ohif/core": "3.11.0",
"@ohif/extension-cornerstone": "3.11.0",
"@ohif/extension-default": "3.11.0",
"@ohif/i18n": "3.11.0",
"prop-types": "^15.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^2.2.20",
"@cornerstonejs/core": "^2.2.20",
"@kitware/vtk.js": "32.1.1",
"@cornerstonejs/adapters": "^3.32.5",
"@cornerstonejs/core": "^3.32.5",
"@kitware/vtk.js": "32.12.0",
"react-color": "^2.19.3"
}
}
@@ -1,10 +1,9 @@
import { utils } from '@ohif/core';
import { utils, Types as OhifTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import { metaData, cache, utilities as csUtils, volumeLoader } from '@cornerstonejs/core';
import { adaptersPMAP } from '@cornerstonejs/adapters';
import { SOPClassHandlerId } from './id';
import { dicomLoaderService } from '@ohif/extension-cornerstone';
const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
import { dicomLoaderService, VOLUME_LOADER_SCHEME } from '@ohif/extension-cornerstone';
const sopClassUids = ['1.2.840.10008.5.1.4.1.1.30'];
function _getDisplaySetsFromSeries(
@@ -57,7 +56,8 @@ function _getDisplaySetsFromSeries(
wadoRoot,
wadoUriRoot,
wadoUri,
isOverlayDisplaySet: true,
supportsWindowLevel: true,
label: SeriesDescription || `${i18n.t('Series')} ${SeriesNumber} - ${i18n.t('PMAP')}`,
};
const referencedSeriesSequence = instance.ReferencedSeriesSequence;
@@ -227,7 +227,8 @@ async function _loadParametricMap({ displaySet, headers }: withAppTypes) {
return derivedVolume;
}
function getSopClassHandlerModule({ servicesManager, extensionManager }) {
function getSopClassHandlerModule(params: OhifTypes.Extensions.ExtensionParams) {
const { servicesManager, extensionManager } = params;
const getDisplaySetsFromSeries = instances => {
return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
};
@@ -1,18 +1,12 @@
import PropTypes from 'prop-types';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useViewportGrid, LoadingIndicatorTotalPercent } from '@ohif/ui';
import { useViewportGrid } from '@ohif/ui-next';
import { OHIFCornerstoneViewport } from '@ohif/extension-cornerstone';
function OHIFCornerstonePMAPViewport(props: withAppTypes) {
const {
displaySets,
children,
viewportOptions,
displaySetOptions,
servicesManager,
extensionManager,
} = props;
const { displaySets, children, viewportOptions, displaySetOptions, servicesManager } = props;
const viewportId = viewportOptions.viewportId;
const { displaySetService, segmentationService, uiNotificationService } =
const { displaySetService, segmentationService, uiNotificationService, customizationService } =
servicesManager.services;
// PMAP viewport will always have a single display set
@@ -20,6 +14,10 @@ function OHIFCornerstonePMAPViewport(props: withAppTypes) {
throw new Error('PMAP viewport must have a single display set');
}
const LoadingIndicatorTotalPercent = customizationService.getCustomization(
'ui.loadingIndicatorTotalPercent'
);
const pmapDisplaySet = displaySets[0];
const [viewportGrid, viewportGridService] = useViewportGrid();
const referencedDisplaySetRef = useRef(null);
@@ -55,9 +53,6 @@ function OHIFCornerstonePMAPViewport(props: withAppTypes) {
const getCornerstoneViewport = useCallback(() => {
const { displaySet: referencedDisplaySet } = referencedDisplaySetRef.current;
const { component: Component } = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.viewportModule.cornerstone'
);
displaySetOptions.unshift({});
const [pmapDisplaySetOptions] = displaySetOptions;
@@ -89,7 +84,7 @@ function OHIFCornerstonePMAPViewport(props: withAppTypes) {
});
return (
<Component
<OHIFCornerstoneViewport
{...props}
// Referenced + PMAP displaySets must be passed as parameter in this order
displaySets={[referencedDisplaySet, pmapDisplaySet]}
@@ -97,17 +92,19 @@ function OHIFCornerstonePMAPViewport(props: withAppTypes) {
viewportType: 'volume',
orientation: viewportOptions.orientation,
viewportId: viewportOptions.viewportId,
presentationIds: viewportOptions.presentationIds,
}}
displaySetOptions={[{}, pmapDisplaySetOptions]}
></Component>
/>
);
}, [
extensionManager,
displaySetOptions,
props,
pmapDisplaySet,
viewportOptions.orientation,
viewportOptions.viewportId,
viewportOptions.presentationIds,
uiNotificationService,
]);
// Cleanup the PMAP viewport when the viewport is destroyed
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,5 @@
module.exports = {
plugins: ['@babel/plugin-proposal-class-properties'],
plugins: ['@babel/plugin-transform-class-properties'],
env: {
test: {
presets: [
@@ -15,7 +15,7 @@ module.exports = {
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator',
'@babel/plugin-transform-runtime',
@@ -37,7 +37,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-rt",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "DICOM RT read workflow",
"author": "OHIF",
"license": "MIT",
@@ -33,10 +33,10 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "3.10.0-beta.12",
"@ohif/extension-cornerstone": "3.10.0-beta.12",
"@ohif/extension-default": "3.10.0-beta.12",
"@ohif/i18n": "3.10.0-beta.12",
"@ohif/core": "3.11.0",
"@ohif/extension-cornerstone": "3.11.0",
"@ohif/extension-default": "3.11.0",
"@ohif/i18n": "3.11.0",
"prop-types": "^15.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -27,7 +27,7 @@ const commandsModule = ({ commandsManager, servicesManager }: withAppTypes) => {
// it will be in the correct position zoom and pan
commandsManager.runCommand('updateStoredPositionPresentation', {
viewportId,
displaySetInstanceUID: referencedDisplaySet.displaySetInstanceUID,
displaySetInstanceUIDs: [referencedDisplaySet.displaySetInstanceUID],
});
viewportGridService.setDisplaySetsForViewport({
@@ -1,4 +1,5 @@
import { utils } from '@ohif/core';
import { utils, Types as OhifTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import { SOPClassHandlerId } from './id';
import loadRTStruct from './loadRTStruct';
@@ -30,7 +31,7 @@ function _getDisplaySetsFromSeries(
const displaySet = {
Modality: 'RTSTRUCT',
loading: false,
isReconstructable: false, // by default for now since it is a volumetric SEG currently
isReconstructable: false,
displaySetInstanceUID: utils.guid(),
SeriesDescription,
SeriesNumber,
@@ -53,6 +54,7 @@ function _getDisplaySetsFromSeries(
wadoUriRoot,
wadoUri,
isOverlayDisplaySet: true,
label: SeriesDescription || `${i18n.t('Series')} ${SeriesNumber} - ${i18n.t('RTSTRUCT')}`,
};
let referencedSeriesSequence = instance.ReferencedSeriesSequence;
@@ -85,6 +87,7 @@ function _getDisplaySetsFromSeries(
const addedDisplaySet = displaySetsAdded[0];
if (addedDisplaySet.SeriesInstanceUID === displaySet.referencedSeriesInstanceUID) {
displaySet.referencedDisplaySetInstanceUID = addedDisplaySet.displaySetInstanceUID;
displaySet.isReconstructable = addedDisplaySet.isReconstructable;
unsubscribe();
}
}
@@ -92,14 +95,22 @@ function _getDisplaySetsFromSeries(
} else {
const referencedDisplaySet = referencedDisplaySets[0];
displaySet.referencedDisplaySetInstanceUID = referencedDisplaySet.displaySetInstanceUID;
displaySet.isReconstructable = referencedDisplaySet.isReconstructable;
}
displaySet.load = ({ headers }) => _load(displaySet, servicesManager, extensionManager, headers);
displaySet.load = ({ headers, createSegmentation = true }) =>
_load(displaySet, servicesManager, extensionManager, headers, createSegmentation);
return [displaySet];
}
function _load(rtDisplaySet, servicesManager: AppTypes.ServicesManager, extensionManager, headers) {
function _load(
rtDisplaySet,
servicesManager: AppTypes.ServicesManager,
extensionManager,
headers,
createSegmentation = true
) {
const { SOPInstanceUID } = rtDisplaySet;
const { segmentationService } = servicesManager.services;
if (
@@ -121,16 +132,21 @@ function _load(rtDisplaySet, servicesManager: AppTypes.ServicesManager, extensio
rtDisplaySet.structureSet = structureSet;
}
segmentationService
.createSegmentationForRTDisplaySet(rtDisplaySet)
.then(() => {
rtDisplaySet.loading = false;
resolve();
})
.catch(error => {
rtDisplaySet.loading = false;
reject(error);
});
if (createSegmentation) {
segmentationService
.createSegmentationForRTDisplaySet(rtDisplaySet)
.then(() => {
rtDisplaySet.loading = false;
resolve();
})
.catch(error => {
rtDisplaySet.loading = false;
reject(error);
});
} else {
rtDisplaySet.loading = false;
resolve();
}
});
return loadPromises[SOPInstanceUID];
@@ -171,20 +187,14 @@ function _deriveReferencedSeriesSequenceFromFrameOfReferenceSequence(
return ReferencedSeriesSequence;
}
function _segmentationExistsInCache(
rtDisplaySet,
segmentationService: AppTypes.SegmentationService
) {
function _segmentationExistsInCache() {
// Todo: fix this
return false;
// This should be abstracted with the CornerstoneCacheService
const rtContourId = rtDisplaySet.displaySetInstanceUID;
const contour = segmentationService.getContour(rtContourId);
return contour !== undefined;
}
function getSopClassHandlerModule({ servicesManager, extensionManager }) {
function getSopClassHandlerModule(params: OhifTypes.Extensions.ExtensionParams) {
const { servicesManager, extensionManager } = params;
return [
{
name: 'dicom-rt',
@@ -126,6 +126,7 @@ export default async function loadRTStruct(extensionManager, rtStructDisplaySet,
SeriesInstanceUID: instance.SeriesInstanceUID,
ROIContours: [],
visible: true,
ReferencedSOPInstanceUIDsSet: new Set(),
};
for (let i = 0; i < ROIContourSequence.length; i++) {
@@ -142,7 +143,8 @@ export default async function loadRTStruct(extensionManager, rtStructDisplaySet,
const contourPoints = [];
for (let c = 0; c < ContourSequenceArray.length; c++) {
const { ContourData, NumberOfContourPoints, ContourGeometricType } = ContourSequenceArray[c];
const { ContourData, NumberOfContourPoints, ContourGeometricType, ContourImageSequence } =
ContourSequenceArray[c];
let isSupported = false;
@@ -172,6 +174,12 @@ export default async function loadRTStruct(extensionManager, rtStructDisplaySet,
type: ContourGeometricType,
isSupported,
});
if (ContourImageSequence?.ReferencedSOPInstanceUID) {
structureSet.ReferencedSOPInstanceUIDsSet.add(
ContourImageSequence?.ReferencedSOPInstanceUID
);
}
}
_setROIContourMetadata(
@@ -1,5 +1,5 @@
function createRTToolGroupAndAddTools(ToolGroupService, customizationService, toolGroupId) {
const { tools } = customizationService.get('cornerstone.overlayViewportTools') ?? {};
const tools = customizationService.getCustomization('cornerstone.overlayViewportTools');
return ToolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}
@@ -1,10 +1,4 @@
import { ButtonEnums } from '@ohif/ui';
const RESPONSE = {
NO_NEVER: -1,
CANCEL: 0,
HYDRATE_SEG: 5,
};
import { utils, Types } from '@ohif/extension-cornerstone';
function promptHydrateRT({
servicesManager,
@@ -12,70 +6,20 @@ function promptHydrateRT({
viewportId,
preHydrateCallbacks,
hydrateRTDisplaySet,
}: withAppTypes) {
const { uiViewportDialogService } = servicesManager.services;
const extensionManager = servicesManager._extensionManager;
const appConfig = extensionManager._appConfig;
return new Promise(async function (resolve, reject) {
const promptResult = appConfig?.disableConfirmationPrompts
? RESPONSE.HYDRATE_SEG
: await _askHydrate(uiViewportDialogService, viewportId);
if (promptResult === RESPONSE.HYDRATE_SEG) {
preHydrateCallbacks?.forEach(callback => {
callback();
});
const isHydrated = await hydrateRTDisplaySet({
rtDisplaySet,
viewportId,
servicesManager,
});
resolve(isHydrated);
}
});
}
function _askHydrate(uiViewportDialogService: AppTypes.UIViewportDialogService, viewportId) {
return new Promise(function (resolve, reject) {
const message = 'Do you want to open this Segmentation?';
const actions = [
{
id: 'no-hydrate',
type: ButtonEnums.type.secondary,
text: 'No',
value: RESPONSE.CANCEL,
},
{
id: 'yes-hydrate',
type: ButtonEnums.type.primary,
text: 'Yes',
value: RESPONSE.HYDRATE_SEG,
},
];
const onSubmit = result => {
uiViewportDialogService.hide();
resolve(result);
};
uiViewportDialogService.show({
id: 'promptHydrateRT',
viewportId,
type: 'info',
message,
actions,
onSubmit,
onOutsideClick: () => {
uiViewportDialogService.hide();
resolve(RESPONSE.CANCEL);
},
onKeyPress: event => {
if (event.key === 'Enter') {
onSubmit(RESPONSE.HYDRATE_SEG);
}
},
});
}: {
servicesManager: AppTypes.ServicesManager;
rtDisplaySet: AppTypes.DisplaySet;
viewportId: string;
preHydrateCallbacks?: Types.HydrationCallback[];
hydrateRTDisplaySet: Types.HydrationCallback;
}) {
return utils.promptHydrationDialog({
servicesManager,
viewportId,
displaySet: rtDisplaySet,
preHydrateCallbacks,
hydrateCallback: hydrateRTDisplaySet,
type: 'RTSTRUCT',
});
}
@@ -1,33 +1,27 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import React, { Component, useCallback, useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { useViewportGrid, LoadingIndicatorTotalPercent, ViewportActionArrows } from '@ohif/ui';
import { useViewportGrid } from '@ohif/ui-next';
import {
utils,
usePositionPresentationStore,
OHIFCornerstoneViewport,
} from '@ohif/extension-cornerstone';
import promptHydrateRT from '../utils/promptHydrateRT';
import _getStatusComponent from './_getStatusComponent';
import createRTToolGroupAndAddTools from '../utils/initRTToolGroup';
import { SegmentationRepresentations } from '@cornerstonejs/tools/enums';
import { useSystem } from '@ohif/core/src';
const RT_TOOLGROUP_BASE_NAME = 'RTToolGroup';
function OHIFCornerstoneRTViewport(props: withAppTypes) {
const {
children,
displaySets,
viewportOptions,
servicesManager,
extensionManager,
commandsManager,
} = props;
const { servicesManager, commandsManager } = useSystem();
const { children, displaySets, viewportOptions } = props as {
children: React.ReactNode;
displaySets: AppTypes.DisplaySet[];
viewportOptions: AppTypes.ViewportOptions;
};
const {
displaySetService,
toolGroupService,
segmentationService,
uiNotificationService,
customizationService,
viewportActionCornersService,
} = servicesManager.services;
const { displaySetService, toolGroupService, segmentationService, customizationService } =
servicesManager.services;
const viewportId = viewportOptions.viewportId;
@@ -38,33 +32,40 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
throw new Error('RT viewport should only have a single display set');
}
const LoadingIndicatorTotalPercent = customizationService.getCustomization(
'ui.loadingIndicatorTotalPercent'
);
const rtDisplaySet = displaySets[0];
const [viewportGrid, viewportGridService] = useViewportGrid();
const [{ viewports, activeViewportId }, viewportGridService] = useViewportGrid();
// States
const [isToolGroupCreated, setToolGroupCreated] = useState(false);
const [selectedSegment, setSelectedSegment] = useState(1);
// Hydration means that the RT is opened and segments are loaded into the
// segmentation panel, and RT is also rendered on any viewport that is in the
// same frameOfReferenceUID as the referencedSeriesUID of the RT. However,
// loading basically means RT loading over network and bit unpacking of the
// RT data.
const [isHydrated, setIsHydrated] = useState(rtDisplaySet.isHydrated);
const { setPositionPresentation } = usePositionPresentationStore();
const [rtIsLoading, setRtIsLoading] = useState(!rtDisplaySet.isLoaded);
const [element, setElement] = useState(null);
const [processingProgress, setProcessingProgress] = useState({
percentComplete: null,
totalSegments: null,
});
// refs
const referencedDisplaySetRef = useRef(null);
const { viewports, activeViewportId } = viewportGrid;
const referencedDisplaySetInstanceUID = rtDisplaySet.referencedDisplaySetInstanceUID;
// If the referencedDisplaySetInstanceUID is not found, it means the RTStruct series is being
// launched without its corresponding referenced display set (e.g., the RTStruct series is launched using
// series launch /mode?StudyInstanceUIDs=&SeriesInstanceUID).
// In such cases, we attempt to handle this scenario gracefully by
// invoking a custom handler. Ideally, if a user tries to launch a series that isn't viewable,
// (eg.: we can prompt them with an explanation and provide a link to the full study).
if (!referencedDisplaySetInstanceUID) {
const missingReferenceDisplaySetHandler = customizationService.getCustomization(
'missingReferenceDisplaySetHandler'
);
const { handled } = missingReferenceDisplaySetHandler();
if (handled) {
return;
}
}
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
referencedDisplaySetInstanceUID
);
@@ -74,110 +75,31 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
displaySet: referencedDisplaySet,
metadata: referencedDisplaySetMetadata,
};
/**
* OnElementEnabled callback which is called after the cornerstoneExtension
* has enabled the element. Note: we delegate all the image rendering to
* cornerstoneExtension, so we don't need to do anything here regarding
* the image rendering, element enabling etc.
*/
const onElementEnabled = evt => {
setElement(evt.detail.element);
};
const onElementDisabled = () => {
setElement(null);
};
const storePresentationState = useCallback(() => {
viewportGrid?.viewports.forEach(({ viewportId }) => {
commandsManager.runCommand('storePresentation', {
viewportId,
});
});
}, [viewportGrid]);
const hydrateRTDisplaySet = useCallback(
({ rtDisplaySet, viewportId }) => {
commandsManager.runCommand('hydrateRTSDisplaySet', {
displaySet: rtDisplaySet,
viewportId,
});
},
[commandsManager]
);
const getCornerstoneViewport = useCallback(() => {
const { component: Component } = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.viewportModule.cornerstone'
);
const { displaySet: referencedDisplaySet } = referencedDisplaySetRef.current;
// Todo: jump to the center of the first segment
return (
<Component
{...props}
displaySets={[referencedDisplaySet, rtDisplaySet]}
viewportOptions={{
viewportType: 'stack',
toolGroupId: toolGroupId,
orientation: viewportOptions.orientation,
viewportId: viewportOptions.viewportId,
}}
onElementEnabled={evt => {
props.onElementEnabled?.(evt);
onElementEnabled(evt);
}}
onElementDisabled={onElementDisabled}
></Component>
);
}, [viewportId, rtDisplaySet, toolGroupId]);
const onSegmentChange = useCallback(
direction => {
const segmentationId = rtDisplaySet.displaySetInstanceUID;
const segmentation = segmentationService.getSegmentation(segmentationId);
const { segments } = segmentation;
const numberOfSegments = Object.keys(segments).length;
let newSelectedSegmentIndex = selectedSegment + direction;
// Segment 0 is always background
if (newSelectedSegmentIndex >= numberOfSegments - 1) {
newSelectedSegmentIndex = 1;
} else if (newSelectedSegmentIndex === 0) {
newSelectedSegmentIndex = numberOfSegments - 1;
}
segmentationService.jumpToSegmentCenter(segmentationId, newSelectedSegmentIndex, viewportId);
setSelectedSegment(newSelectedSegmentIndex);
},
[selectedSegment, segmentationService]
);
useEffect(() => {
if (rtIsLoading) {
return;
}
// if not active viewport, return
if (viewportId !== activeViewportId) {
return;
}
promptHydrateRT({
servicesManager,
viewportId,
rtDisplaySet,
preHydrateCallbacks: [storePresentationState],
hydrateRTDisplaySet,
}).then(isHydrated => {
if (isHydrated) {
setIsHydrated(true);
}
hydrateRTDisplaySet: async () => {
return commandsManager.runCommand('hydrateSecondaryDisplaySet', {
displaySet: rtDisplaySet,
viewportId,
});
},
});
}, [servicesManager, viewportId, rtDisplaySet, rtIsLoading]);
}, [servicesManager, viewportId, rtDisplaySet, rtIsLoading, commandsManager, activeViewportId]);
useEffect(() => {
// I'm not sure what is this, since in RT we support Overlapping segments
// via contours
const { unsubscribe } = segmentationService.subscribe(
segmentationService.EVENTS.SEGMENTATION_LOADING_COMPLETE,
evt => {
@@ -185,11 +107,16 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
setRtIsLoading(false);
}
if (evt.overlappingSegments) {
uiNotificationService.show({
title: 'Overlapping Segments',
message: 'Overlapping segments detected which is not currently supported',
type: 'warning',
if (rtDisplaySet?.firstSegmentedSliceImageId && viewportOptions?.presentationIds) {
const { firstSegmentedSliceImageId } = rtDisplaySet;
const { presentationIds } = viewportOptions;
setPositionPresentation(presentationIds.positionPresentationId, {
viewportType: 'stack',
viewReference: {
referencedImageId: firstSegmentedSliceImageId,
},
viewPresentation: {},
});
}
}
@@ -201,7 +128,7 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
}, [rtDisplaySet]);
useEffect(() => {
const { unsubscribe } = segmentationService.subscribe(
const segmentLoadingSubscription = segmentationService.subscribe(
segmentationService.EVENTS.SEGMENT_LOADING_COMPLETE,
({ percentComplete, numSegments }) => {
setProcessingProgress({
@@ -211,16 +138,7 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
}
);
return () => {
unsubscribe();
};
}, [rtDisplaySet]);
/**
Cleanup the SEG viewport when the viewport is destroyed
*/
useEffect(() => {
const onDisplaySetsRemovedSubscription = displaySetService.subscribe(
const displaySetsRemovedSubscription = displaySetService.subscribe(
displaySetService.EVENTS.DISPLAY_SETS_REMOVED,
({ displaySetInstanceUIDs }) => {
const activeViewport = viewports.get(activeViewportId);
@@ -234,9 +152,10 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
);
return () => {
onDisplaySetsRemovedSubscription.unsubscribe();
segmentLoadingSubscription.unsubscribe();
displaySetsRemovedSubscription.unsubscribe();
};
}, []);
}, [rtDisplaySet, displaySetService, viewports, activeViewportId, viewportGridService]);
useEffect(() => {
let toolGroup = toolGroupService.getToolGroup(toolGroupId);
@@ -247,43 +166,36 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
toolGroup = createRTToolGroupAndAddTools(toolGroupService, customizationService, toolGroupId);
setToolGroupCreated(true);
return () => {
// remove the segmentation representations if seg displayset changed
segmentationService.removeSegmentationRepresentations(viewportId);
toolGroupService.destroyToolGroup(toolGroupId);
};
}, []);
useEffect(() => {
setIsHydrated(rtDisplaySet.isHydrated);
return () => {
// remove the segmentation representations if seg displayset changed
segmentationService.removeSegmentationRepresentations(viewportId);
referencedDisplaySetRef.current = null;
toolGroupService.destroyToolGroup(toolGroupId);
};
}, [rtDisplaySet]);
}, []);
const onStatusClick = useCallback(async () => {
// Before hydrating a RT and make it added to all viewports in the grid
// that share the same frameOfReferenceUID, we need to store the viewport grid
// presentation state, so that we can restore it after hydrating the RT. This is
// required if the user has changed the viewport (other viewport than RT viewport)
// presentation state (w/l and invert) and then opens the RT. If we don't store
// the presentation state, the viewport will be reset to the default presentation
storePresentationState();
const isHydrated = await hydrateRTDisplaySet({
rtDisplaySet,
viewportId,
});
const getCornerstoneViewport = useCallback(() => {
const { displaySet: referencedDisplaySet } = referencedDisplaySetRef.current;
setIsHydrated(isHydrated);
}, [hydrateRTDisplaySet, rtDisplaySet, storePresentationState, viewportId]);
// Todo: jump to the center of the first segment
return (
<OHIFCornerstoneViewport
{...props}
displaySets={[referencedDisplaySet, rtDisplaySet]}
viewportOptions={{
viewportType: viewportOptions.viewportType,
toolGroupId: toolGroupId,
orientation: viewportOptions.orientation,
viewportId: viewportOptions.viewportId,
presentationIds: viewportOptions.presentationIds,
}}
onElementEnabled={evt => {
props.onElementEnabled?.(evt);
}}
/>
);
}, [viewportId, rtDisplaySet, toolGroupId]);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let childrenWithProps = null;
if (
@@ -306,43 +218,6 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
});
}
useEffect(() => {
viewportActionCornersService.addComponents([
{
viewportId,
id: 'viewportStatusComponent',
component: _getStatusComponent({
isHydrated,
onStatusClick,
}),
indexPriority: -100,
location: viewportActionCornersService.LOCATIONS.topLeft,
},
{
viewportId,
id: 'viewportActionArrowsComponent',
component: (
<ViewportActionArrows
key="actionArrows"
onArrowsClick={onSegmentChange}
className={
viewportId === activeViewportId ? 'visible' : 'invisible group-hover/pane:visible'
}
></ViewportActionArrows>
),
indexPriority: 0,
location: viewportActionCornersService.LOCATIONS.topRight,
},
]);
}, [
activeViewportId,
isHydrated,
onSegmentChange,
onStatusClick,
viewportActionCornersService,
viewportId,
]);
return (
<>
<div className="relative flex h-full w-full flex-row overflow-hidden">
@@ -1,62 +0,0 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Tooltip } from '@ohif/ui';
export default function _getStatusComponent({ isHydrated, onStatusClick }) {
let ToolTipMessage = null;
let StatusIcon = null;
switch (isHydrated) {
case true:
StatusIcon = () => <Icon name="status-alert" />;
ToolTipMessage = () => <div>This Segmentation is loaded in the segmentation panel</div>;
break;
case false:
StatusIcon = () => (
<Icon
className="text-aqua-pale"
name="status-untracked"
/>
);
ToolTipMessage = () => <div>Click LOAD to load RTSTRUCT.</div>;
}
const StatusArea = () => {
const { t } = useTranslation('Common');
const loadStr = t('LOAD');
return (
<div className="flex h-6 cursor-default text-sm leading-6 text-white">
<div className="bg-customgray-100 flex min-w-[45px] items-center rounded-l-xl rounded-r p-1">
<StatusIcon />
<span className="ml-1">RTSTRUCT</span>
</div>
{!isHydrated && (
<div
className="bg-primary-main hover:bg-primary-light ml-1 cursor-pointer rounded px-1.5 hover:text-black"
// Using onMouseUp here because onClick is not working when the viewport is not active and is styled with pointer-events:none
onMouseUp={onStatusClick}
>
{loadStr}
</div>
)}
</div>
);
};
return (
<>
{ToolTipMessage && (
<Tooltip
content={<ToolTipMessage />}
position="bottom-left"
>
<StatusArea />
</Tooltip>
)}
{!ToolTipMessage && <StatusArea />}
</>
);
}
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,5 @@
module.exports = {
plugins: ['@babel/plugin-proposal-class-properties'],
plugins: ['@babel/plugin-transform-class-properties'],
env: {
test: {
presets: [
@@ -15,7 +15,7 @@ module.exports = {
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator',
'@babel/plugin-transform-runtime',
@@ -37,7 +37,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-seg",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "DICOM SEG read workflow",
"author": "OHIF",
"license": "MIT",
@@ -33,10 +33,10 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@ohif/core": "3.10.0-beta.12",
"@ohif/extension-cornerstone": "3.10.0-beta.12",
"@ohif/extension-default": "3.10.0-beta.12",
"@ohif/i18n": "3.10.0-beta.12",
"@ohif/core": "3.11.0",
"@ohif/extension-cornerstone": "3.11.0",
"@ohif/extension-default": "3.11.0",
"@ohif/i18n": "3.11.0",
"prop-types": "^15.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^2.2.20",
"@cornerstonejs/core": "^2.2.20",
"@kitware/vtk.js": "32.1.1",
"@cornerstonejs/adapters": "^3.32.5",
"@cornerstonejs/core": "^3.32.5",
"@kitware/vtk.js": "32.12.0",
"react-color": "^2.19.3"
}
}
@@ -1,20 +1,12 @@
import dcmjs from 'dcmjs';
import { createReportDialogPrompt } from '@ohif/extension-default';
import { Types } from '@ohif/core';
import { classes, Types } from '@ohif/core';
import { cache, metaData } from '@cornerstonejs/core';
import {
segmentation as cornerstoneToolsSegmentation,
Enums as cornerstoneToolsEnums,
utilities,
} from '@cornerstonejs/tools';
import { segmentation as cornerstoneToolsSegmentation } from '@cornerstonejs/tools';
import { adaptersRT, helpers, adaptersSEG } from '@cornerstonejs/adapters';
import { classes, DicomMetadataStore } from '@ohif/core';
import { createReportDialogPrompt } from '@ohif/extension-default';
import { DicomMetadataStore } from '@ohif/core';
import vtkImageMarchingSquares from '@kitware/vtk.js/Filters/General/ImageMarchingSquares';
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
const { segmentation: segmentationUtils } = utilities;
import PROMPT_RESPONSES from '../../default/src/utils/_shared/PROMPT_RESPONSES';
const { datasetToBlob } = dcmjs.data;
@@ -45,13 +37,8 @@ const commandsModule = ({
servicesManager,
extensionManager,
}: Types.Extensions.ExtensionParams): Types.Extensions.CommandsModule => {
const {
segmentationService,
uiDialogService,
displaySetService,
viewportGridService,
toolGroupService,
} = servicesManager.services as AppTypes.Services;
const { segmentationService, displaySetService, viewportGridService, toolGroupService } =
servicesManager.services as AppTypes.Services;
const actions = {
/**
@@ -226,14 +213,6 @@ const commandsModule = ({
* otherwise throws an error.
*/
storeSegmentation: async ({ segmentationId, dataSource }) => {
const promptResult = await createReportDialogPrompt(uiDialogService, {
extensionManager,
});
if (promptResult.action !== 1 && !promptResult.value) {
return;
}
const segmentation = segmentationService.getSegmentation(segmentationId);
if (!segmentation) {
@@ -241,33 +220,55 @@ const commandsModule = ({
}
const { label } = segmentation;
const SeriesDescription = promptResult.value || label || 'Research Derived Series';
const defaultDataSource = dataSource ?? extensionManager.getActiveDataSource()[0];
const generatedData = actions.generateSegmentation({
segmentationId,
options: {
SeriesDescription,
},
const {
value: reportName,
dataSourceName: selectedDataSource,
action,
} = await createReportDialogPrompt({
servicesManager,
extensionManager,
title: 'Store Segmentation',
});
if (!generatedData || !generatedData.dataset) {
throw new Error('Error during segmentation generation');
if (action === PROMPT_RESPONSES.CREATE_REPORT) {
try {
const selectedDataSourceConfig = selectedDataSource
? extensionManager.getDataSources(selectedDataSource)[0]
: defaultDataSource;
const generatedData = actions.generateSegmentation({
segmentationId,
options: {
SeriesDescription: reportName || label || 'Research Derived Series',
},
});
if (!generatedData || !generatedData.dataset) {
throw new Error('Error during segmentation generation');
}
const { dataset: naturalizedReport } = generatedData;
// DCMJS assigns a dummy study id during creation, and this can cause problems, so clearing it out
if (naturalizedReport.StudyID === 'No Study ID') {
naturalizedReport.StudyID = '';
}
await selectedDataSourceConfig.store.dicom(naturalizedReport);
// add the information for where we stored it to the instance as well
naturalizedReport.wadoRoot = selectedDataSourceConfig.getConfig().wadoRoot;
DicomMetadataStore.addInstances([naturalizedReport], true);
return naturalizedReport;
} catch (error) {
console.debug('Error storing segmentation:', error);
throw error;
}
}
const { dataset: naturalizedReport } = generatedData;
await dataSource.store.dicom(naturalizedReport);
// The "Mode" route listens for DicomMetadataStore changes
// When a new instance is added, it listens and
// automatically calls makeDisplaySets
// add the information for where we stored it to the instance as well
naturalizedReport.wadoRoot = dataSource.getConfig().wadoRoot;
DicomMetadataStore.addInstances([naturalizedReport], true);
return naturalizedReport;
},
/**
* Converts segmentations into RTSS for download.
@@ -276,21 +277,24 @@ const commandsModule = ({
* converts dataset to downloadable blob.
*
*/
downloadRTSS: ({ segmentationId }) => {
downloadRTSS: async ({ segmentationId }) => {
const segmentations = segmentationService.getSegmentation(segmentationId);
const vtkUtils = {
vtkImageMarchingSquares,
vtkDataArray,
vtkImageData,
};
const RTSS = generateRTSSFromSegmentations(
// inject colors to the segmentIndex
const firstRepresentation =
segmentationService.getRepresentationsForSegmentation(segmentationId)[0];
Object.entries(segmentations.segments).forEach(([segmentIndex, segment]) => {
segment.color = segmentationService.getSegmentColor(
firstRepresentation.viewportId,
segmentationId,
segmentIndex
);
});
const RTSS = await generateRTSSFromSegmentations(
segmentations,
classes.MetadataProvider,
DicomMetadataStore,
cache,
cornerstoneToolsEnums,
vtkUtils
DicomMetadataStore
);
try {
@@ -303,48 +307,9 @@ const commandsModule = ({
console.warn(e);
}
},
setBrushSize: ({ value, toolNames }) => {
const brushSize = Number(value);
toolGroupService.getToolGroupIds()?.forEach(toolGroupId => {
if (toolNames?.length === 0) {
segmentationUtils.setBrushSizeForToolGroup(toolGroupId, brushSize);
} else {
toolNames?.forEach(toolName => {
segmentationUtils.setBrushSizeForToolGroup(toolGroupId, brushSize, toolName);
});
}
});
},
setThresholdRange: ({
value,
toolNames = ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
}) => {
toolGroupService.getToolGroupIds()?.forEach(toolGroupId => {
const toolGroup = toolGroupService.getToolGroup(toolGroupId);
toolNames?.forEach(toolName => {
toolGroup.setToolConfiguration(toolName, {
strategySpecificConfiguration: {
THRESHOLD: {
threshold: value,
},
},
});
});
});
},
};
const definitions = {
/**
* Obsolete?
*/
loadSegmentationDisplaySetsForViewport: {
commandFn: actions.loadSegmentationDisplaySetsForViewport,
},
/**
* Obsolete?
*/
loadSegmentationsForViewport: {
commandFn: actions.loadSegmentationsForViewport,
},
@@ -361,12 +326,6 @@ const commandsModule = ({
downloadRTSS: {
commandFn: actions.downloadRTSS,
},
setBrushSize: {
commandFn: actions.setBrushSize,
},
setThresholdRange: {
commandFn: actions.setThresholdRange,
},
};
return {
@@ -1,12 +1,13 @@
import { utils } from '@ohif/core';
import { metaData, triggerEvent, eventTarget } from '@cornerstonejs/core';
import { utils, Types as OhifTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import { metaData, eventTarget } from '@cornerstonejs/core';
import { CONSTANTS, segmentation as cstSegmentation } from '@cornerstonejs/tools';
import { adaptersSEG, Enums } from '@cornerstonejs/adapters';
import { SOPClassHandlerId } from './id';
import { dicomlabToRGB } from './utils/dicomlabToRGB';
const sopClassUids = ['1.2.840.10008.5.1.4.1.1.66.4'];
const sopClassUids = ['1.2.840.10008.5.1.4.1.1.66.4', '1.2.840.10008.5.1.4.1.1.66.7'];
const loadPromises = {};
@@ -33,7 +34,7 @@ function _getDisplaySetsFromSeries(
const displaySet = {
Modality: 'SEG',
loading: false,
isReconstructable: true, // by default for now since it is a volumetric SEG currently
isReconstructable: false,
displaySetInstanceUID: utils.guid(),
SeriesDescription,
SeriesNumber,
@@ -57,6 +58,7 @@ function _getDisplaySetsFromSeries(
wadoUriRoot,
wadoUri,
isOverlayDisplaySet: true,
label: SeriesDescription || `${i18n.t('Series')} ${SeriesNumber} - ${i18n.t('SEG')}`,
};
const referencedSeriesSequence = instance.ReferencedSeriesSequence;
@@ -89,12 +91,14 @@ function _getDisplaySetsFromSeries(
const addedDisplaySet = displaySetsAdded[0];
if (addedDisplaySet.SeriesInstanceUID === displaySet.referencedSeriesInstanceUID) {
displaySet.referencedDisplaySetInstanceUID = addedDisplaySet.displaySetInstanceUID;
displaySet.isReconstructable = addedDisplaySet.isReconstructable;
unsubscribe();
}
}
);
} else {
displaySet.referencedDisplaySetInstanceUID = referencedDisplaySet.displaySetInstanceUID;
displaySet.isReconstructable = referencedDisplaySet.isReconstructable;
}
displaySet.load = async ({ headers }) =>
@@ -177,12 +181,16 @@ async function _loadSegments({
throw new Error('referencedDisplaySet is missing for SEG');
}
const { instances: images } = referencedDisplaySet;
const imageIds = images.map(({ imageId }) => imageId);
let { imageIds } = referencedDisplaySet;
if (!imageIds) {
// try images
const { images } = referencedDisplaySet;
imageIds = images.map(image => image.imageId);
}
// Todo: what should be defaults here
const tolerance = 0.001;
const skipOverlapping = true;
eventTarget.addEventListener(Enums.Events.SEGMENTATION_LOAD_PROGRESS, evt => {
const { percentComplete } = evt.detail;
segmentationService._broadcastEvent(segmentationService.EVENTS.SEGMENT_LOADING_COMPLETE, {
@@ -190,11 +198,10 @@ async function _loadSegments({
});
});
const results = await adaptersSEG.Cornerstone3D.Segmentation.generateToolState(
const results = await adaptersSEG.Cornerstone3D.Segmentation.createFromDICOMSegBuffer(
imageIds,
arrayBuffer,
metaData,
{ skipOverlapping, tolerance, eventTarget, triggerEvent }
{ metadataProvider: metaData, tolerance }
);
let usedRecommendedDisplayCIELabValue = true;
@@ -211,15 +218,6 @@ async function _loadSegments({
}
});
if (results.overlappingSegments) {
uiNotificationService.show({
title: 'Overlapping Segments',
message:
'Unsupported overlapping segments detected, segmentation rendering results may be incorrect.',
type: 'warning',
});
}
if (!usedRecommendedDisplayCIELabValue) {
// Display a notification about the non-utilization of RecommendedDisplayCIELabValue
uiNotificationService.show({
@@ -238,7 +236,8 @@ function _segmentationExists(segDisplaySet) {
return cstSegmentation.state.getSegmentation(segDisplaySet.displaySetInstanceUID);
}
function getSopClassHandlerModule({ servicesManager, extensionManager }) {
function getSopClassHandlerModule(params: OhifTypes.Extensions.ExtensionParams) {
const { servicesManager, extensionManager } = params;
const getDisplaySetsFromSeries = instances => {
return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
};
@@ -1,6 +1,15 @@
export function getToolbarModule({ servicesManager }: withAppTypes) {
const { segmentationService, toolbarService, toolGroupService } = servicesManager.services;
return [
{
name: 'evaluate.cornerstone.hasSegmentation',
evaluate: ({ viewportId }) => {
const segmentations = segmentationService.getSegmentationRepresentations(viewportId);
return {
disabled: !segmentations?.length,
};
},
},
{
name: 'evaluate.cornerstone.segmentation',
evaluate: ({ viewportId, button, toolNames, disabledText }) => {
@@ -12,27 +21,39 @@ export function getToolbarModule({ servicesManager }: withAppTypes) {
if (!segmentations?.length) {
return {
disabled: true,
className: '!text-common-bright !bg-black opacity-50',
disabledText: disabledText ?? 'No segmentations available',
};
}
const activeSegmentation = segmentationService.getActiveSegmentation(viewportId);
if (!Object.keys(activeSegmentation.segments).length) {
return {
disabled: true,
disabledText: 'Add segment to enable this tool',
};
}
const toolGroup = toolGroupService.getToolGroupForViewport(viewportId);
if (!toolGroup) {
return {
disabled: true,
className: '!text-common-bright ohif-disabled',
disabledText: disabledText ?? 'Not available on the current viewport',
};
}
if (!toolNames) {
return {
disabled: false,
// isActive: false,
};
}
const toolName = toolbarService.getToolNameForButton(button);
if (!toolGroup.hasTool(toolName) && !toolNames) {
return {
disabled: true,
className: '!text-common-bright ohif-disabled',
disabledText: disabledText ?? 'Not available on the current viewport',
};
}
@@ -43,12 +64,6 @@ export function getToolbarModule({ servicesManager }: withAppTypes) {
return {
disabled: false,
className: isPrimaryActive
? '!text-black !bg-primary-light hover:bg-primary-light hover-text-black hover:cursor-pointer'
: '!text-common-bright !bg-black hover:bg-primary-light hover:cursor-pointer hover:text-black',
// Todo: isActive right now is used for nested buttons where the primary
// button needs to be fully rounded (vs partial rounded) when active
// otherwise it does not have any other use
isActive: isPrimaryActive,
};
},
@@ -1,7 +1,14 @@
function createSEGToolGroupAndAddTools(ToolGroupService, customizationService, toolGroupId) {
const { tools } = customizationService.get('cornerstone.overlayViewportTools') ?? {};
function createSEGToolGroupAndAddTools({
commandsManager,
toolGroupService,
customizationService,
toolGroupId,
}) {
const tools = customizationService.getCustomization('cornerstone.overlayViewportTools');
return ToolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
const updatedTools = commandsManager.run('initializeSegmentLabelTool', { tools });
return toolGroupService.createToolGroupAndAddTools(toolGroupId, updatedTools);
}
export default createSEGToolGroupAndAddTools;
@@ -1,10 +1,4 @@
import { ButtonEnums } from '@ohif/ui';
const RESPONSE = {
NO_NEVER: -1,
CANCEL: 0,
HYDRATE_SEG: 5,
};
import { utils, Types } from '@ohif/extension-cornerstone';
function promptHydrateSEG({
servicesManager,
@@ -12,71 +6,20 @@ function promptHydrateSEG({
viewportId,
preHydrateCallbacks,
hydrateCallback,
}: withAppTypes) {
const { uiViewportDialogService } = servicesManager.services;
const extensionManager = servicesManager._extensionManager;
const appConfig = extensionManager._appConfig;
return new Promise(async function (resolve, reject) {
const promptResult = appConfig?.disableConfirmationPrompts
? RESPONSE.HYDRATE_SEG
: await _askHydrate(uiViewportDialogService, viewportId);
if (promptResult === RESPONSE.HYDRATE_SEG) {
preHydrateCallbacks?.forEach(callback => {
callback();
});
window.setTimeout(async () => {
const isHydrated = await hydrateCallback({
segDisplaySet,
viewportId,
});
resolve(isHydrated);
}, 0);
}
});
}
function _askHydrate(uiViewportDialogService, viewportId) {
return new Promise(function (resolve, reject) {
const message = 'Do you want to open this Segmentation?';
const actions = [
{
id: 'no-hydrate',
type: ButtonEnums.type.secondary,
text: 'No',
value: RESPONSE.CANCEL,
},
{
id: 'yes-hydrate',
type: ButtonEnums.type.primary,
text: 'Yes',
value: RESPONSE.HYDRATE_SEG,
},
];
const onSubmit = result => {
uiViewportDialogService.hide();
resolve(result);
};
uiViewportDialogService.show({
viewportId,
type: 'info',
message,
actions,
onSubmit,
onOutsideClick: () => {
uiViewportDialogService.hide();
resolve(RESPONSE.CANCEL);
},
onKeyPress: event => {
if (event.key === 'Enter') {
onSubmit(RESPONSE.HYDRATE_SEG);
}
},
});
}: {
servicesManager: AppTypes.ServicesManager;
segDisplaySet: AppTypes.DisplaySet;
viewportId: string;
preHydrateCallbacks?: Types.HydrationCallback[];
hydrateCallback: Types.HydrationCallback;
}) {
return utils.promptHydrationDialog({
servicesManager,
viewportId,
displaySet: segDisplaySet as AppTypes.DisplaySet,
preHydrateCallbacks,
hydrateCallback,
type: 'SEG',
});
}
@@ -1,33 +1,28 @@
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { LoadingIndicatorTotalPercent, useViewportGrid, ViewportActionArrows } from '@ohif/ui';
import { useViewportGrid } from '@ohif/ui-next';
import createSEGToolGroupAndAddTools from '../utils/initSEGToolGroup';
import promptHydrateSEG from '../utils/promptHydrateSEG';
import _getStatusComponent from './_getStatusComponent';
import { usePositionPresentationStore, OHIFCornerstoneViewport } from '@ohif/extension-cornerstone';
import { SegmentationRepresentations } from '@cornerstonejs/tools/enums';
import { useSystem } from '@ohif/core/src/contextProviders/SystemProvider';
const SEG_TOOLGROUP_BASE_NAME = 'SEGToolGroup';
function OHIFCornerstoneSEGViewport(props: withAppTypes) {
const {
children,
displaySets,
viewportOptions,
servicesManager,
extensionManager,
commandsManager,
} = props;
const { t } = useTranslation('SEGViewport');
const { servicesManager, commandsManager } = useSystem();
const { children, displaySets, viewportOptions } = props as {
children: React.ReactNode;
displaySets: AppTypes.DisplaySet[];
viewportOptions: AppTypes.ViewportOptions;
};
const viewportId = viewportOptions.viewportId;
const {
displaySetService,
toolGroupService,
segmentationService,
customizationService,
viewportActionCornersService,
} = servicesManager.services;
const { displaySetService, toolGroupService, segmentationService, customizationService } =
servicesManager.services;
const LoadingIndicatorTotalPercent = customizationService.getCustomization(
'ui.loadingIndicatorTotalPercent'
);
const toolGroupId = `${SEG_TOOLGROUP_BASE_NAME}-${viewportId}`;
@@ -40,16 +35,14 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
const [viewportGrid, viewportGridService] = useViewportGrid();
// States
const [selectedSegment, setSelectedSegment] = useState(1);
const { setPositionPresentation } = usePositionPresentationStore();
// Hydration means that the SEG is opened and segments are loaded into the
// segmentation panel, and SEG is also rendered on any viewport that is in the
// same frameOfReferenceUID as the referencedSeriesUID of the SEG. However,
// loading basically means SEG loading over network and bit unpacking of the
// SEG data.
const [isHydrated, setIsHydrated] = useState(segDisplaySet.isHydrated);
const [segIsLoading, setSegIsLoading] = useState(!segDisplaySet.isLoaded);
const [element, setElement] = useState(null);
const [processingProgress, setProcessingProgress] = useState({
percentComplete: null,
totalSegments: null,
@@ -61,6 +54,21 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
const { viewports, activeViewportId } = viewportGrid;
const referencedDisplaySetInstanceUID = segDisplaySet.referencedDisplaySetInstanceUID;
// If the referencedDisplaySetInstanceUID is not found, it means the SEG series is being
// launched without its corresponding referenced display set (e.g., the SEG series is launched using
// series launch /mode?StudyInstanceUIDs=&SeriesInstanceUID).
// In such cases, we attempt to handle this scenario gracefully by
// invoking a custom handler. Ideally, if a user tries to launch a series that isn't viewable,
// (eg.: we can prompt them with an explanation and provide a link to the full study).
if (!referencedDisplaySetInstanceUID) {
const missingReferenceDisplaySetHandler = customizationService.getCustomization(
'missingReferenceDisplaySetHandler'
);
const { handled } = missingReferenceDisplaySetHandler();
if (handled) {
return;
}
}
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
referencedDisplaySetInstanceUID
);
@@ -74,36 +82,10 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
displaySet: referencedDisplaySet,
metadata: referencedDisplaySetMetadata,
};
/**
* OnElementEnabled callback which is called after the cornerstoneExtension
* has enabled the element. Note: we delegate all the image rendering to
* cornerstoneExtension, so we don't need to do anything here regarding
* the image rendering, element enabling etc.
*/
const onElementEnabled = evt => {
setElement(evt.detail.element);
};
const onElementDisabled = () => {
setElement(null);
};
const storePresentationState = useCallback(() => {
viewportGrid?.viewports.forEach(({ viewportId }) => {
commandsManager.runCommand('storePresentation', {
viewportId,
});
});
}, [viewportGrid]);
const getCornerstoneViewport = useCallback(() => {
const { component: Component } = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.viewportModule.cornerstone'
);
// Todo: jump to the center of the first segment
return (
<Component
<OHIFCornerstoneViewport
{...props}
displaySets={[segDisplaySet]}
viewportOptions={{
@@ -115,78 +97,35 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
}}
onElementEnabled={evt => {
props.onElementEnabled?.(evt);
onElementEnabled(evt);
}}
onElementDisabled={onElementDisabled}
></Component>
/>
);
}, [viewportId, segDisplaySet, toolGroupId]);
const onSegmentChange = useCallback(
direction => {
const segmentationId = segDisplaySet.displaySetInstanceUID;
const segmentation = segmentationService.getSegmentation(segmentationId);
const { segments } = segmentation;
const numberOfSegments = Object.keys(segments).length;
let newSelectedSegmentIndex = selectedSegment + direction;
// Segment 0 is always background
if (newSelectedSegmentIndex > numberOfSegments - 1) {
newSelectedSegmentIndex = 1;
} else if (newSelectedSegmentIndex === 0) {
newSelectedSegmentIndex = numberOfSegments - 1;
}
segmentationService.jumpToSegmentCenter(segmentationId, newSelectedSegmentIndex, viewportId);
setSelectedSegment(newSelectedSegmentIndex);
},
[selectedSegment]
);
const hydrateSEG = useCallback(() => {
// update the previously stored segmentationPresentation with the new viewportId
// presentation so that when we put the referencedDisplaySet back in the viewport
// it will have the correct segmentation representation hydrated
commandsManager.runCommand('updateStoredSegmentationPresentation', {
displaySet: segDisplaySet,
type: SegmentationRepresentations.Labelmap,
});
// update the previously stored positionPresentation with the new viewportId
// presentation so that when we put the referencedDisplaySet back in the viewport
// it will be in the correct position zoom and pan
commandsManager.runCommand('updateStoredPositionPresentation', {
viewportId,
displaySetInstanceUID: referencedDisplaySet.displaySetInstanceUID,
});
viewportGridService.setDisplaySetsForViewport({
viewportId,
displaySetInstanceUIDs: [referencedDisplaySet.displaySetInstanceUID],
});
}, [commandsManager, viewportId, referencedDisplaySet, segDisplaySet]);
}, [viewportId, segDisplaySet, toolGroupId, props, viewportOptions]);
useEffect(() => {
if (segIsLoading) {
return;
}
// if not active viewport, return
if (viewportId !== activeViewportId) {
return;
}
promptHydrateSEG({
servicesManager,
viewportId,
segDisplaySet,
preHydrateCallbacks: [storePresentationState],
hydrateCallback: hydrateSEG,
}).then(isHydrated => {
if (isHydrated) {
setIsHydrated(true);
}
hydrateCallback: async () => {
await commandsManager.runCommand('hydrateSecondaryDisplaySet', {
displaySet: segDisplaySet,
viewportId,
});
return true;
},
});
}, [servicesManager, viewportId, segDisplaySet, segIsLoading, hydrateSEG]);
}, [servicesManager, viewportId, segDisplaySet, segIsLoading, commandsManager, activeViewportId]);
useEffect(() => {
// on new seg display set, remove all segmentations from all viewports
@@ -198,6 +137,17 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
if (evt.segDisplaySet.displaySetInstanceUID === segDisplaySet.displaySetInstanceUID) {
setSegIsLoading(false);
}
if (segDisplaySet?.firstSegmentedSliceImageId && viewportOptions?.presentationIds) {
const { firstSegmentedSliceImageId } = segDisplaySet;
const { presentationIds } = viewportOptions;
setPositionPresentation(presentationIds.positionPresentationId, {
viewReference: {
referencedImageId: firstSegmentedSliceImageId,
},
});
}
}
);
@@ -264,7 +214,12 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
// This creates a custom tool group which has the lifetime of this view
// only, and does NOT interfere with currently displayed segmentations.
toolGroup = createSEGToolGroupAndAddTools(toolGroupService, customizationService, toolGroupId);
toolGroup = createSEGToolGroupAndAddTools({
commandsManager,
toolGroupService,
customizationService,
toolGroupId,
});
return () => {
// remove the segmentation representations if seg displayset changed
@@ -276,54 +231,6 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
};
}, []);
const onStatusClick = useCallback(async () => {
// Before hydrating a SEG and make it added to all viewports in the grid
// that share the same frameOfReferenceUID, we need to store the viewport grid
// presentation state, so that we can restore it after hydrating the SEG. This is
// required if the user has changed the viewport (other viewport than SEG viewport)
// presentation state (w/l and invert) and then opens the SEG. If we don't store
// the presentation state, the viewport will be reset to the default presentation
storePresentationState();
hydrateSEG();
}, [storePresentationState, hydrateSEG]);
useEffect(() => {
viewportActionCornersService.addComponents([
{
viewportId,
id: 'viewportStatusComponent',
component: _getStatusComponent({
isHydrated,
onStatusClick,
}),
indexPriority: -100,
location: viewportActionCornersService.LOCATIONS.topLeft,
},
{
viewportId,
id: 'viewportActionArrowsComponent',
component: (
<ViewportActionArrows
key="actionArrows"
onArrowsClick={onSegmentChange}
className={
viewportId === activeViewportId ? 'visible' : 'invisible group-hover/pane:visible'
}
></ViewportActionArrows>
),
indexPriority: 0,
location: viewportActionCornersService.LOCATIONS.topRight,
},
]);
}, [
activeViewportId,
isHydrated,
onSegmentChange,
onStatusClick,
viewportActionCornersService,
viewportId,
]);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let childrenWithProps = null;
@@ -1,62 +0,0 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Tooltip } from '@ohif/ui';
export default function _getStatusComponent({ isHydrated, onStatusClick }) {
let ToolTipMessage = null;
let StatusIcon = null;
switch (isHydrated) {
case true:
StatusIcon = () => <Icon name="status-alert" />;
ToolTipMessage = () => <div>This Segmentation is loaded in the segmentation panel</div>;
break;
case false:
StatusIcon = () => (
<Icon
className="text-aqua-pale"
name="status-untracked"
/>
);
ToolTipMessage = () => <div>Click LOAD to load segmentation.</div>;
}
const StatusArea = () => {
const { t } = useTranslation('Common');
const loadStr = t('LOAD');
return (
<div className="flex h-6 cursor-default text-sm leading-6 text-white">
<div className="bg-customgray-100 flex min-w-[45px] items-center rounded-l-xl rounded-r p-1">
<StatusIcon />
<span className="ml-1">SEG</span>
</div>
{!isHydrated && (
<div
className="bg-primary-main hover:bg-primary-light ml-1 cursor-pointer rounded px-1.5 hover:text-black"
// Using onMouseUp here because onClick is not working when the viewport is not active and is styled with pointer-events:none
onMouseUp={onStatusClick}
>
{loadStr}
</div>
)}
</div>
);
};
return (
<>
{ToolTipMessage && (
<Tooltip
content={<ToolTipMessage />}
position="bottom-left"
>
<StatusArea />
</Tooltip>
)}
{!ToolTipMessage && <StatusArea />}
</>
);
}
File diff suppressed because it is too large. Load diff
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dicom-sr",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "OHIF extension for an SR Cornerstone Viewport",
"author": "OHIF",
"license": "MIT",
@@ -34,11 +34,11 @@
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
},
"peerDependencies": {
"@ohif/core": "3.10.0-beta.12",
"@ohif/extension-cornerstone": "3.10.0-beta.12",
"@ohif/extension-measurement-tracking": "3.10.0-beta.12",
"@ohif/ui": "3.10.0-beta.12",
"dcmjs": "*",
"@ohif/core": "3.11.0",
"@ohif/extension-cornerstone": "3.11.0",
"@ohif/extension-measurement-tracking": "3.11.0",
"@ohif/ui": "3.11.0",
"dcmjs": "0.43.1",
"dicom-parser": "^1.8.9",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
@@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^2.2.20",
"@cornerstonejs/core": "^2.2.20",
"@cornerstonejs/tools": "^2.2.20",
"@cornerstonejs/adapters": "^3.32.5",
"@cornerstonejs/core": "^3.32.5",
"@cornerstonejs/tools": "^3.32.5",
"classnames": "^2.3.2"
}
}
@@ -5,30 +5,34 @@ import dcmjs from 'dcmjs';
import { adaptersSR } from '@cornerstonejs/adapters';
import getFilteredCornerstoneToolState from './utils/getFilteredCornerstoneToolState';
import hydrateStructuredReport from './utils/hydrateStructuredReport';
const { MeasurementReport } = adaptersSR.Cornerstone3D;
const { log } = OHIF;
interface Options {
SeriesDescription?: string;
SeriesInstanceUID?: string;
SeriesNumber?: number;
InstanceNumber?: number;
SeriesDate?: string;
SeriesTime?: string;
}
/**
*
* @param measurementData An array of measurements from the measurements service
* that you wish to serialize.
* @param additionalFindingTypes toolTypes that should be stored with labels as Findings
* @param options Naturalized DICOM JSON headers to merge into the displaySet.
*
*/
const _generateReport = (measurementData, additionalFindingTypes, options = {}) => {
const _generateReport = (measurementData, additionalFindingTypes, options: Options = {}) => {
const filteredToolState = getFilteredCornerstoneToolState(
measurementData,
additionalFindingTypes
);
const report = MeasurementReport.generateReport(
filteredToolState,
metaData,
utilities.worldToImageCoords,
options
);
const report = MeasurementReport.generateReport(filteredToolState, metaData, options);
const { dataset } = report;
@@ -37,13 +41,37 @@ const _generateReport = (measurementData, additionalFindingTypes, options = {})
if (typeof dataset.SpecificCharacterSet === 'undefined') {
dataset.SpecificCharacterSet = 'ISO_IR 192';
}
dataset.InstanceNumber = options.InstanceNumber ?? 1;
return dataset;
};
const commandsModule = (props: withAppTypes) => {
const { servicesManager } = props;
const { servicesManager, extensionManager, commandsManager } = props;
const { customizationService } = servicesManager.services;
const actions = {
changeColorMeasurement: ({ uid }) => {
// When this gets supported, it probably belongs in cornerstone, not sr
throw new Error('Unsupported operation: changeColorMeasurement');
// const { color } = measurementService.getMeasurement(uid);
// const rgbaColor = {
// r: color[0],
// g: color[1],
// b: color[2],
// a: color[3] / 255.0,
// };
// colorPickerDialog(uiDialogService, rgbaColor, (newRgbaColor, actionId) => {
// if (actionId === 'cancel') {
// return;
// }
// const color = [newRgbaColor.r, newRgbaColor.g, newRgbaColor.b, newRgbaColor.a * 255.0];
// segmentationService.setSegmentColor(viewportId, segmentationId, segmentIndex, color);
// });
},
/**
*
* @param measurementData An array of measurements from the measurements service
@@ -53,7 +81,7 @@ const commandsModule = (props: withAppTypes) => {
* that you wish to serialize.
*/
downloadReport: ({ measurementData, additionalFindingTypes, options = {} }) => {
const srDataset = actions.generateReport(measurementData, additionalFindingTypes, options);
const srDataset = _generateReport(measurementData, additionalFindingTypes, options);
const reportBlob = dcmjs.data.datasetToBlob(srDataset);
//Create a URL for the binary.
@@ -96,13 +124,15 @@ const commandsModule = (props: withAppTypes) => {
console.log('naturalizedReport missing imaging content', naturalizedReport);
throw new Error('Invalid report, no content');
}
if (!naturalizedReport.SOPClassUID) {
throw new Error('No sop class uid');
}
const onBeforeDicomStore =
customizationService.getModeCustomization('onBeforeDicomStore')?.value;
const onBeforeDicomStore = customizationService.getCustomization('onBeforeDicomStore');
let dicomDict;
if (typeof onBeforeDicomStore === 'function') {
dicomDict = onBeforeDicomStore({ measurementData, naturalizedReport });
dicomDict = onBeforeDicomStore({ dicomDict, measurementData, naturalizedReport });
}
await dataSource.store.dicom(naturalizedReport, null, dicomDict);
@@ -123,15 +153,23 @@ const commandsModule = (props: withAppTypes) => {
throw new Error(error.message || 'Error while saving the measurements.');
}
},
/**
* Loads measurements by hydrating and loading the SR for the given display set instance UID
* and displays it in the active viewport.
*/
hydrateStructuredReport: ({ displaySetInstanceUID }) => {
return hydrateStructuredReport(
{ servicesManager, extensionManager, commandsManager },
displaySetInstanceUID
);
},
};
const definitions = {
downloadReport: {
commandFn: actions.downloadReport,
},
storeMeasurements: {
commandFn: actions.storeMeasurements,
},
downloadReport: actions.downloadReport,
storeMeasurements: actions.storeMeasurements,
hydrateStructuredReport: actions.hydrateStructuredReport,
};
return {
@@ -1,38 +1,24 @@
import PropTypes from 'prop-types';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ExtensionManager } from '@ohif/core';
import React, { useCallback, useEffect, useState } from 'react';
import { setTrackingUniqueIdentifiersForElement } from '../tools/modules/dicomSRModule';
import { Icon, Tooltip, useViewportGrid, ViewportActionArrows } from '@ohif/ui';
import hydrateStructuredReport from '../utils/hydrateStructuredReport';
import { useAppConfig } from '@state';
import createReferencedImageDisplaySet from '../utils/createReferencedImageDisplaySet';
const MEASUREMENT_TRACKING_EXTENSION_ID = '@ohif/extension-measurement-tracking';
import { usePositionPresentationStore, OHIFCornerstoneViewport } from '@ohif/extension-cornerstone';
import { useViewportGrid } from '@ohif/ui-next';
import { useSystem } from '@ohif/core/src/contextProviders/SystemProvider';
const SR_TOOLGROUP_BASE_NAME = 'SRToolGroup';
function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
const {
commandsManager,
children,
dataSource,
displaySets,
viewportOptions,
servicesManager,
extensionManager,
} = props;
function OHIFCornerstoneSRMeasurementViewport(props) {
const { servicesManager } = useSystem();
const { children, dataSource, displaySets, viewportOptions } = props as {
children: React.ReactNode;
dataSource: unknown;
displaySets: AppTypes.DisplaySet[];
viewportOptions: AppTypes.ViewportOptions;
};
const [appConfig] = useAppConfig();
const {
displaySetService,
cornerstoneViewportService,
measurementService,
viewportActionCornersService,
} = servicesManager.services;
const { displaySetService } = servicesManager.services;
const viewportId = viewportOptions.viewportId;
@@ -43,66 +29,15 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
const srDisplaySet = displaySets[0];
const { setPositionPresentation } = usePositionPresentationStore();
const [viewportGrid, viewportGridService] = useViewportGrid();
const [measurementSelected, setMeasurementSelected] = useState(0);
const [measurementCount, setMeasurementCount] = useState(1);
const [activeImageDisplaySetData, setActiveImageDisplaySetData] = useState(null);
const [referencedDisplaySetMetadata, setReferencedDisplaySetMetadata] = useState(null);
const [element, setElement] = useState(null);
const { viewports, activeViewportId } = viewportGrid;
const { t } = useTranslation('Common');
// Optional hook into tracking extension, if present.
let trackedMeasurements;
let sendTrackedMeasurementsEvent;
const hasMeasurementTrackingExtension = extensionManager.registeredExtensionIds.includes(
MEASUREMENT_TRACKING_EXTENSION_ID
);
if (hasMeasurementTrackingExtension) {
const contextModule = extensionManager.getModuleEntry(
'@ohif/extension-measurement-tracking.contextModule.TrackedMeasurementsContext'
);
const tracked = useContext(contextModule.context);
trackedMeasurements = tracked?.[0];
sendTrackedMeasurementsEvent = tracked?.[1];
}
if (!sendTrackedMeasurementsEvent) {
// if no panels from measurement-tracking extension is used, this code will run
trackedMeasurements = null;
sendTrackedMeasurementsEvent = (eventName, { displaySetInstanceUID }) => {
measurementService.clearMeasurements();
const { SeriesInstanceUIDs } = hydrateStructuredReport(
{ servicesManager, extensionManager, appConfig },
displaySetInstanceUID
);
const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUIDs[0]);
if (displaySets.length) {
viewportGridService.setDisplaySetsForViewports([
{
viewportId: activeViewportId,
displaySetInstanceUIDs: [displaySets[0].displaySetInstanceUID],
},
]);
}
};
}
/**
* Todo: what is this, not sure what it does regarding the react aspect,
* it is updating a local variable? which is not state.
*/
const [isLocked, setIsLocked] = useState(trackedMeasurements?.context?.trackedSeries?.length > 0);
/**
* Store the tracking identifiers per viewport in order to be able to
* show the SR measurements on the referenced image on the correct viewport,
* when multiple viewports are used.
*/
const setTrackingIdentifiers = useCallback(
measurementSelected => {
const { measurements } = srDisplaySet;
@@ -128,22 +63,12 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
const updateViewport = useCallback(
newMeasurementSelected => {
const { StudyInstanceUID, displaySetInstanceUID, sopClassUids } = srDisplaySet;
const { StudyInstanceUID, displaySetInstanceUID } = srDisplaySet;
if (!StudyInstanceUID || !displaySetInstanceUID) {
return;
}
if (sopClassUids && sopClassUids.length > 1) {
// Todo: what happens if there are multiple SOP Classes? Why we are
// not throwing an error?
console.warn('More than one SOPClassUID in the same series is not yet supported.');
}
// if (!srDisplaySet.measurements || !srDisplaySet.measurements.length) {
// return;
// }
_getViewportReferencedDisplaySetData(
srDisplaySet,
newMeasurementSelected,
@@ -154,33 +79,17 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
}
setMeasurementSelected(newMeasurementSelected);
setActiveImageDisplaySetData(referencedDisplaySet);
setReferencedDisplaySetMetadata(referencedDisplaySetMetadata);
if (
referencedDisplaySet.displaySetInstanceUID ===
activeImageDisplaySetData?.displaySetInstanceUID
) {
const { measurements } = srDisplaySet;
// it means that we have a new referenced display set, and the
// imageIdIndex will handle it by updating the viewport, but if they
// are the same we just need to use measurementService to jump to the
// new measurement
const csViewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
if (!csViewport) {
return;
}
const imageIds = csViewport.getImageIds();
const imageIdIndex = imageIds.indexOf(measurements[newMeasurementSelected].imageId);
if (imageIdIndex !== -1) {
csViewport.setImageIdIndex(imageIdIndex);
}
}
const { presentationIds } = viewportOptions;
const measurement = srDisplaySet.measurements[newMeasurementSelected];
setPositionPresentation(presentationIds.positionPresentationId, {
viewReference: {
referencedImageId: measurement.imageId,
},
});
});
},
[dataSource, srDisplaySet, activeImageDisplaySetData, viewportId]
@@ -191,10 +100,6 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
return null;
}
const { component: Component } = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.viewportModule.cornerstone'
);
const { measurements } = srDisplaySet;
const measurement = measurements[measurementSelected];
@@ -202,12 +107,8 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
return null;
}
const initialImageIndex = activeImageDisplaySetData.images.findIndex(
image => image.imageId === measurement.imageId
);
return (
<Component
<OHIFCornerstoneViewport
{...props}
// should be passed second since we don't want SR displaySet to
// override the activeImageDisplaySetData
@@ -230,29 +131,11 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
props.onElementEnabled?.(evt);
onElementEnabled(evt);
}}
initialImageIndex={initialImageIndex}
isJumpToMeasurementDisabled={true}
></Component>
/>
);
}, [activeImageDisplaySetData, viewportId, measurementSelected]);
const onMeasurementChange = useCallback(
direction => {
let newMeasurementSelected = measurementSelected;
newMeasurementSelected += direction;
if (newMeasurementSelected >= measurementCount) {
newMeasurementSelected = 0;
} else if (newMeasurementSelected < 0) {
newMeasurementSelected = measurementCount - 1;
}
setTrackingIdentifiers(newMeasurementSelected);
updateViewport(newMeasurementSelected);
},
[measurementSelected, measurementCount, updateViewport, setTrackingIdentifiers]
);
/**
Cleanup the SR viewport when the viewport is destroyed
*/
@@ -287,8 +170,6 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
if (!srDisplaySet.isLoaded) {
await srDisplaySet.load();
}
const numMeasurements = srDisplaySet.measurements.length;
setMeasurementCount(numMeasurements);
updateViewport(measurementSelected);
};
loadSR();
@@ -311,50 +192,6 @@ function OHIFCornerstoneSRMeasurementViewport(props: withAppTypes) {
updateSR();
}, [measurementSelected, element, setTrackingIdentifiers, srDisplaySet]);
useEffect(() => {
setIsLocked(trackedMeasurements?.context?.trackedSeries?.length > 0);
}, [trackedMeasurements]);
useEffect(() => {
viewportActionCornersService.addComponents([
{
viewportId,
id: 'viewportStatusComponent',
component: _getStatusComponent({
srDisplaySet,
viewportId,
isRehydratable: srDisplaySet.isRehydratable,
isLocked,
sendTrackedMeasurementsEvent,
t,
}),
indexPriority: -100,
location: viewportActionCornersService.LOCATIONS.topLeft,
},
{
viewportId,
id: 'viewportActionArrowsComponent',
index: 0,
component: (
<ViewportActionArrows
key="actionArrows"
onArrowsClick={onMeasurementChange}
></ViewportActionArrows>
),
indexPriority: 0,
location: viewportActionCornersService.LOCATIONS.topRight,
},
]);
}, [
isLocked,
onMeasurementChange,
sendTrackedMeasurementsEvent,
srDisplaySet,
t,
viewportActionCornersService,
viewportId,
]);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let childrenWithProps = null;
@@ -391,8 +228,6 @@ OHIFCornerstoneSRMeasurementViewport.propTypes = {
children: PropTypes.node,
viewportLabel: PropTypes.string,
viewportOptions: PropTypes.object,
servicesManager: PropTypes.object.isRequired,
extensionManager: PropTypes.instanceOf(ExtensionManager).isRequired,
};
async function _getViewportReferencedDisplaySetData(
@@ -417,6 +252,9 @@ async function _getViewportReferencedDisplaySetData(
}
const referencedDisplaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
if (!referencedDisplaySet?.images) {
return { referencedDisplaySetMetadata: null, referencedDisplaySet: null };
}
const image0 = referencedDisplaySet.images[0];
const referencedDisplaySetMetadata = {
@@ -436,97 +274,4 @@ async function _getViewportReferencedDisplaySetData(
return { referencedDisplaySetMetadata, referencedDisplaySet };
}
function _getStatusComponent({
srDisplaySet,
viewportId,
isRehydratable,
isLocked,
sendTrackedMeasurementsEvent,
t,
}) {
const handleMouseUp = () => {
sendTrackedMeasurementsEvent('HYDRATE_SR', {
displaySetInstanceUID: srDisplaySet.displaySetInstanceUID,
viewportId,
});
};
const loadStr = t('LOAD');
// 1 - Incompatible
// 2 - Locked
// 3 - Rehydratable / Open
const state = isRehydratable && !isLocked ? 3 : isRehydratable && isLocked ? 2 : 1;
let ToolTipMessage = null;
let StatusIcon = null;
switch (state) {
case 1:
StatusIcon = () => <Icon name="status-alert" />;
ToolTipMessage = () => (
<div>
This structured report is not compatible
<br />
with this application.
</div>
);
break;
case 2:
StatusIcon = () => <Icon name="status-locked" />;
ToolTipMessage = () => (
<div>
This structured report is currently read-only
<br />
because you are tracking measurements in
<br />
another viewport.
</div>
);
break;
case 3:
StatusIcon = () => (
<Icon
className="text-aqua-pale"
name="status-untracked"
/>
);
ToolTipMessage = () => <div>{`Click ${loadStr} to restore measurements.`}</div>;
}
const StatusArea = () => (
<div className="flex h-6 cursor-default text-sm leading-6 text-white">
<div className="bg-customgray-100 flex min-w-[45px] items-center rounded-l-xl rounded-r p-1">
<StatusIcon />
<span className="ml-1">SR</span>
</div>
{state === 3 && (
<div
className="bg-primary-main hover:bg-primary-light ml-1 cursor-pointer rounded px-1.5 hover:text-black"
// Using onMouseUp here because onClick is not working when the viewport is not active and is styled with pointer-events:none
onMouseUp={handleMouseUp}
>
{loadStr}
</div>
)}
</div>
);
return (
<>
{ToolTipMessage && (
<Tooltip
content={<ToolTipMessage />}
position="bottom-left"
>
<StatusArea />
</Tooltip>
)}
{!ToolTipMessage && <StatusArea />}
</>
);
}
export default OHIFCornerstoneSRMeasurementViewport;
@@ -1,4 +1,5 @@
import { utils, classes, DisplaySetService, Types } from '@ohif/core';
import { utils, classes, DisplaySetService, Types as OhifTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import { Enums as CSExtensionEnums } from '@ohif/extension-cornerstone';
import { adaptersSR } from '@cornerstonejs/adapters';
@@ -14,8 +15,12 @@ import { CodeNameCodeSequenceValues, CodingSchemeDesignators } from './enums';
const { sopClassDictionary } = utils;
const { CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION } = CSExtensionEnums;
const { ImageSet, MetadataProvider: metadataProvider } = classes;
const { CodeScheme: Cornerstone3DCodeScheme } = adaptersSR.Cornerstone3D;
const { MetadataProvider: metadataProvider } = classes;
const {
TEXT_ANNOTATION_POSITION,
COMMENT_CODE,
CodeScheme: Cornerstone3DCodeScheme,
} = adaptersSR.Cornerstone3D;
type InstanceMetadata = Types.InstanceMetadata;
@@ -90,6 +95,7 @@ function _getDisplaySetsFromSeries(
SeriesDescription,
SeriesNumber,
SeriesDate,
SeriesTime,
ConceptNameCodeSequence,
SOPClassUID,
} = instance;
@@ -106,6 +112,7 @@ function _getDisplaySetsFromSeries(
SeriesDescription,
SeriesNumber,
SeriesDate,
SeriesTime,
SOPInstanceUID,
SeriesInstanceUID,
StudyInstanceUID,
@@ -120,6 +127,7 @@ function _getDisplaySetsFromSeries(
sopClassUids,
instance,
addInstances,
label: SeriesDescription || `${i18n.t('Series')} ${SeriesNumber} - ${i18n.t('SR')}`,
};
displaySet.load = () => _load(displaySet, servicesManager, extensionManager);
@@ -212,6 +220,12 @@ async function _load(
});
}
function _measurementBelongsToDisplaySet({ measurement, displaySet }) {
return (
measurement.coords[0].ReferencedFrameOfReferenceSequence === displaySet.FrameOfReferenceUID
);
}
/**
* Checks if measurements can be added to a display set.
*
@@ -232,18 +246,10 @@ function _checkIfCanAddMeasurementsToDisplaySet(
measurement => measurement.loaded === false
);
if (
unloadedMeasurements.length === 0 ||
!(newDisplaySet instanceof ImageSet) ||
newDisplaySet.unsupported
) {
if (!unloadedMeasurements.length || newDisplaySet.unsupported) {
return;
}
// const { sopClassUids } = newDisplaySet;
// Create a Set for faster lookups
// const sopClassUidSet = new Set(sopClassUids);
// Create a Map to efficiently look up ImageIds by SOPInstanceUID and frame number
const imageIdMap = new Map<string, string>();
const imageIds = dataSource.getImageIdsForDisplaySet(newDisplaySet);
@@ -262,10 +268,11 @@ function _checkIfCanAddMeasurementsToDisplaySet(
for (let j = unloadedMeasurements.length - 1; j >= 0; j--) {
let measurement = unloadedMeasurements[j];
const is3DMeasurement = measurement.coords?.[0]?.ValueType === 'SCOORD3D';
const onBeforeSRAddMeasurement = customizationService.getModeCustomization(
const onBeforeSRAddMeasurement = customizationService.getCustomization(
'onBeforeSRAddMeasurement'
)?.value;
);
if (typeof onBeforeSRAddMeasurement === 'function') {
measurement = onBeforeSRAddMeasurement({
@@ -276,9 +283,15 @@ function _checkIfCanAddMeasurementsToDisplaySet(
}
// if it is 3d SR we can just add the SR annotation
if (is3DSR) {
if (
is3DSR &&
is3DMeasurement &&
_measurementBelongsToDisplaySet({ measurement, displaySet: newDisplaySet })
) {
addSRAnnotation(measurement, null, null);
measurement.loaded = true;
measurement.displaySetInstanceUID = newDisplaySet.displaySetInstanceUID;
unloadedMeasurements.splice(j, 1);
continue;
}
@@ -352,7 +365,8 @@ function _measurementReferencesSOPInstanceUID(measurement, SOPInstanceUID, frame
* @param {Object} options.extensionManager - The extension manager.
* @returns {Array} An array containing the SOP class handler module.
*/
function getSopClassHandlerModule({ servicesManager, extensionManager }) {
function getSopClassHandlerModule(params: OhifTypes.Extensions.ExtensionParams) {
const { servicesManager, extensionManager } = params;
const getDisplaySetsFromSeries = instances => {
return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
};
@@ -464,11 +478,7 @@ function _getMergedContentSequencesByTrackingUniqueIdentifiers(MeasurementGroups
* @returns {any} - The processed measurement result.
*/
function _processMeasurement(mergedContentSequence) {
if (
mergedContentSequence.some(
group => group.ValueType === 'SCOORD' || group.ValueType === 'SCOORD3D'
)
) {
if (mergedContentSequence.some(group => isScoordOr3d(group) && !isTextPosition(group))) {
return _processTID1410Measurement(mergedContentSequence);
}
@@ -506,12 +516,25 @@ function _processTID1410Measurement(mergedContentSequence) {
const NUMContentItems = mergedContentSequence.filter(group => group.ValueType === 'NUM');
const { ConceptNameCodeSequence: conceptNameItem } = graphicItem;
const { CodeValue: graphicValue, CodingSchemeDesignator: graphicDesignator } = conceptNameItem;
const graphicCode = `${graphicDesignator}:${graphicValue}`;
const pointDataItem = _getCoordsFromSCOORDOrSCOORD3D(graphicItem);
const is3DMeasurement = pointDataItem.ValueType === 'SCOORD3D';
const pointLength = is3DMeasurement ? 3 : 2;
const pointsLength = pointDataItem.GraphicData.length / pointLength;
const measurement = {
loaded: false,
labels: [],
coords: [_getCoordsFromSCOORDOrSCOORD3D(graphicItem)],
coords: [pointDataItem],
TrackingUniqueIdentifier: UIDREFContentItem.UID,
TrackingIdentifier: TrackingIdentifierContentItem.TextValue,
graphicCode,
is3DMeasurement,
pointsLength,
graphicType: pointDataItem.GraphicType,
};
NUMContentItems.forEach(item => {
@@ -562,6 +585,12 @@ function _processNonGeometricallyDefinedMeasurement(mergedContentSequence) {
item.ConceptNameCodeSequence.CodeValue === CodeNameCodeSequenceValues.FindingSite
);
const commentSites = mergedContentSequence.filter(
item =>
item.ConceptNameCodeSequence.CodingSchemeDesignator === COMMENT_CODE.schemeDesignator &&
item.ConceptNameCodeSequence.CodeValue === COMMENT_CODE.value
);
const measurement = {
loaded: false,
labels: [],
@@ -570,6 +599,14 @@ function _processNonGeometricallyDefinedMeasurement(mergedContentSequence) {
TrackingIdentifier: TrackingIdentifierContentItem.TextValue,
};
if (commentSites) {
for (const group of commentSites) {
if (group.TextValue) {
measurement.labels.push({ label: group.TextValue, value: '' });
}
}
}
if (
finding &&
CodingSchemeDesignators.CornerstoneCodeSchemes.includes(
@@ -721,4 +758,17 @@ function _getSequenceAsArray(sequence) {
return Array.isArray(sequence) ? sequence : [sequence];
}
function isScoordOr3d(group) {
return group.ValueType === 'SCOORD' || group.ValueType === 'SCOORD3D';
}
function isTextPosition(group) {
const concept = group.ConceptNameCodeSequence[0];
return (
concept &&
concept.CodeValue === TEXT_ANNOTATION_POSITION.value &&
concept.CodingSchemeDesignator === TEXT_ANNOTATION_POSITION.schemeDesignator
);
}
export default getSopClassHandlerModule;
@@ -30,6 +30,7 @@ const dicomSRExtension = {
* Only required property. Should be a unique value across all extensions.
*/
id,
onModeEnter,
preRegistration,
+1 -26
View File
@@ -12,7 +12,6 @@ import {
utilities as csToolsUtils,
} from '@cornerstonejs/tools';
import { Types, MeasurementService } from '@ohif/core';
import { StackViewport, utilities as csUtils } from '@cornerstonejs/core';
import { Enums as CSExtensionEnums } from '@ohif/extension-cornerstone';
import DICOMSRDisplayTool from './tools/DICOMSRDisplayTool';
import SCOORD3DPointTool from './tools/SCOORD3DPointTool';
@@ -57,7 +56,7 @@ export default function init({
'SRSCOORD3DPoint',
POINT,
SRSCOOR3DProbeMapper.toAnnotation,
SRSCOOR3DProbeMapper.toMeasurement
SRSCOOR3DProbeMapper.toMeasurement.bind(null, { servicesManager })
);
// Modify annotation tools to use dashed lines on SR
@@ -77,28 +76,4 @@ export default function init({
SRRectangleROI: dashedLine,
global: {},
});
measurementService.subscribe(
MeasurementService.EVENTS.JUMP_TO_MEASUREMENT_LAYOUT,
({ viewportId, measurement, isConsumed }) => {
if (isConsumed) {
return;
}
try {
const currentViewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
const { viewPlaneNormal } = currentViewport.getCamera();
const referencedImageId = csToolsUtils.getClosestImageIdForStackViewport(
currentViewport as StackViewport,
measurement.points[0],
viewPlaneNormal
);
const imageIndex = (currentViewport as StackViewport)
.getImageIds()
.indexOf(referencedImageId);
csUtils.jumpToSlice(currentViewport.element, { imageIndex });
} catch (error) {
console.warn('Unable to jump to image based on measurement coordinate', error);
}
}
);
}
@@ -1,4 +1,4 @@
import { Types, metaData, utilities as csUtils } from '@cornerstonejs/core';
import { type Types } from '@cornerstonejs/core';
import {
annotation,
drawing,
@@ -7,13 +7,8 @@ const SRSCOOR3DProbe = {
* @param {Object} cornerstone Cornerstone event data
* @return {Measurement} Measurement instance
*/
toMeasurement: (
csToolsEventDetail,
displaySetService,
CornerstoneViewportService,
getValueTypeFromToolType,
customizationService
) => {
toMeasurement: ({ servicesManager, getValueTypeFromToolType }, csToolsEventDetail) => {
const { displaySetService } = servicesManager.services;
const { annotation } = csToolsEventDetail;
const { metadata, data, annotationUID } = annotation;
@@ -22,14 +17,25 @@ const SRSCOOR3DProbe = {
return null;
}
const { toolName } = metadata;
const { toolName, FrameOfReferenceUID } = metadata;
const { points } = data.handles;
const displaySets = displaySetService
.getActiveDisplaySets()
.filter(ds => ds.FrameOfReferenceUID === FrameOfReferenceUID);
const displaySet = displaySets.filter(ds => ds.isReconstructable)[0] || displaySets[0];
const { StudyInstanceUID: referenceStudyUID, SeriesInstanceUID: referenceSeriesUID } =
displaySets[0] || {};
const displayText = getDisplayText(annotation);
return {
uid: annotationUID,
points,
metadata,
referenceStudyUID,
referenceSeriesUID,
displaySetInstanceUID: displaySet?.displaySetInstanceUID,
toolName: metadata.toolName,
label: data.label,
displayText: displayText,
@@ -56,7 +62,10 @@ function getDisplayText(annotation) {
}
}
return displayText;
return {
primary: displayText,
secondary: [],
};
}
export default SRSCOOR3DProbe;
@@ -1,9 +1,12 @@
import { Types, annotation } from '@cornerstonejs/tools';
import { metaData } from '@cornerstonejs/core';
import { adaptersSR } from '@cornerstonejs/adapters';
import getRenderableData from './getRenderableData';
import toolNames from '../tools/toolNames';
const { MeasurementReport } = adaptersSR.Cornerstone3D;
export default function addSRAnnotation(measurement, imageId, frameNumber) {
let toolName = toolNames.DICOMSRDisplay;
const renderableData = measurement.coords.reduce((acc, coordProps) => {
@@ -25,7 +28,12 @@ export default function addSRAnnotation(measurement, imageId, frameNumber) {
}
if (valueType === 'SCOORD3D') {
toolName = toolNames.SRSCOORD3DPoint;
const adapter = MeasurementReport.getAdapterForTrackingIdentifier(
measurement.TrackingIdentifier
);
if (!adapter) {
toolName = toolNames.SRSCOORD3DPoint;
}
// get the ReferencedFrameOfReferenceUID from the measurement
frameOfReferenceUID = measurement.coords[0].ReferencedFrameOfReferenceSequence;
@@ -63,5 +71,4 @@ export default function addSRAnnotation(measurement, imageId, frameNumber) {
* was not triggering annotation_added events.
*/
annotation.state.addAnnotation(SRAnnotation);
console.debug('Adding SR annotation:', SRAnnotation);
}
@@ -25,7 +25,7 @@ const contentItemFormatters = {
return `${NumericValue} ${CodeValue}`;
},
PNAME: contentItem => {
const personName = contentItem.PersonName?.[0]?.Alphabetic;
const personName = contentItem.PersonName?.[0];
return personName ? utils.formatPN(personName) : undefined;
},
DATE: contentItem => {
@@ -1,17 +1,11 @@
import OHIF from '@ohif/core';
import { annotation } from '@cornerstonejs/tools';
const { log } = OHIF;
import { NO_IMAGE_ID } from '@cornerstonejs/adapters';
function getFilteredCornerstoneToolState(measurementData, additionalFindingTypes) {
const filteredToolState = {};
function addToFilteredToolState(annotation, toolType) {
if (!annotation.metadata?.referencedImageId) {
log.warn(`[DICOMSR] No referencedImageId found for ${toolType} ${annotation.id}`);
return;
}
const imageId = annotation.metadata.referencedImageId;
const imageId = annotation.metadata?.referencedImageId ?? NO_IMAGE_ID;
if (!filteredToolState[imageId]) {
filteredToolState[imageId] = {};
@@ -11,7 +11,11 @@ const { CodeScheme: Cornerstone3DCodeScheme } = adaptersSR.Cornerstone3D;
* @returns {string} The extracted label.
*/
export default function getLabelFromDCMJSImportedToolData(toolData) {
const { findingSites = [], finding } = toolData;
const { findingSites = [], finding, annotation } = toolData;
if (annotation.data.label) {
return annotation.data.label;
}
let freeTextLabel = findingSites.find(
fs => fs.CodeValue === Cornerstone3DCodeScheme.codeValues.CORNERSTONEFREETEXT
@@ -36,6 +36,14 @@ function getRenderableData({ GraphicType, GraphicData, ValueType, imageId }) {
ValueType,
imageId,
});
if (!imageId) {
// without the image id it's not possible to perform the calculations below
// these calculations also do not seem to be needed, since everything works
// just fine when we skip them. At least for SCOORD3D annotations.
return pointsWorld;
}
// We do not have an explicit draw circle svg helper in Cornerstone3D at
// this time, but we can use the ellipse svg helper to draw a circle, so
// here we reshape the data for that purpose.
@@ -90,6 +98,13 @@ function getRenderableData({ GraphicType, GraphicData, ValueType, imageId }) {
imageId,
});
if (!imageId) {
// without the image id it's not possible to perform the calculations below
// these calculations also do not seem to be needed, since everything works
// just fine when we skip them. At least for SCOORD3D annotations.
return pointsWorld;
}
const majorAxisStart = vec3.fromValues(...pointsWorld[0]);
const majorAxisEnd = vec3.fromValues(...pointsWorld[1]);
const minorAxisStart = vec3.fromValues(...pointsWorld[2]);
@@ -1,15 +1,16 @@
import { utilities, metaData } from '@cornerstonejs/core';
import { utilities, metaData, type Types } from '@cornerstonejs/core';
import OHIF, { DicomMetadataStore } from '@ohif/core';
import { vec3 } from 'gl-matrix';
import getLabelFromDCMJSImportedToolData from './getLabelFromDCMJSImportedToolData';
import { adaptersSR } from '@cornerstonejs/adapters';
import { annotation as CsAnnotation } from '@cornerstonejs/tools';
import { annotation as CsAnnotation, type Types as ToolTypes } from '@cornerstonejs/tools';
import { Enums as CSExtensionEnums } from '@ohif/extension-cornerstone';
const { locking } = CsAnnotation;
const { guid } = OHIF.utils;
const { MeasurementReport, CORNERSTONE_3D_TAG } = adaptersSR.Cornerstone3D;
const { MeasurementReport } = adaptersSR.Cornerstone3D;
const { CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION } = CSExtensionEnums;
const supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0'];
const convertCode = (codingValues, code) => {
if (!code || code.CodingSchemeDesignator === 'CORNERSTONEJS') {
@@ -37,26 +38,20 @@ const convertSites = (codingValues, sites) => {
};
/**
* Hydrates a structured report, for default viewports.
*
* Hydrates a structured report
* Handles 2d and 3d hydration from SCOORD and SCOORD3D points
* For 3D hydration, chooses a volume display set to display with
* FOr 2D hydration, chooses the (first) display set containing the referenced image.
*/
export default function hydrateStructuredReport(
{ servicesManager, extensionManager, appConfig }: withAppTypes,
{ servicesManager, extensionManager, commandsManager }: withAppTypes,
displaySetInstanceUID
) {
const annotationManager = CsAnnotation.state.getAnnotationManager();
const dataSource = extensionManager.getActiveDataSource()[0];
const { measurementService, displaySetService, customizationService } = servicesManager.services;
const codingValues = customizationService.getCustomization('codingValues', {});
const { disableEditing } = customizationService.getCustomization(
'PanelMeasurement.disableEditing',
{
id: 'default.disableEditing',
disableEditing: false,
}
);
const codingValues = customizationService.getCustomization('codingValues');
const disableEditing = customizationService.getCustomization('panelMeasurement.disableEditing');
const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID);
@@ -93,9 +88,10 @@ export default function hydrateStructuredReport(
}
});
const datasetToUse = _mapLegacyDataSet(instance);
// Mapping of legacy datasets is now directly handled by adapters module
const datasetToUse = instance;
// Use dcmjs to generate toolState.
// Use CS3D adapters to generate toolState.
let storedMeasurementByAnnotationType = MeasurementReport.generateToolState(
datasetToUse,
// NOTE: we need to pass in the imageIds to dcmjs since the we use them
@@ -103,12 +99,10 @@ export default function hydrateStructuredReport(
// that measurements were added to the display set are the same order as
// the measurementGroups in the instance.
sopInstanceUIDToImageId,
utilities.imageToWorldCoords,
metaData
);
const onBeforeSRHydration =
customizationService.getModeCustomization('onBeforeSRHydration')?.value;
const onBeforeSRHydration = customizationService.getCustomization('onBeforeSRHydration')?.value;
if (typeof onBeforeSRHydration === 'function') {
storedMeasurementByAnnotationType = onBeforeSRHydration({
@@ -155,6 +149,9 @@ export default function hydrateStructuredReport(
for (let i = 0; i < imageIds.length; i++) {
const imageId = imageIds[i];
if (!imageId) {
continue;
}
const { SeriesInstanceUID, StudyInstanceUID } = metaData.get('instance', imageId);
if (!SeriesInstanceUIDs.includes(SeriesInstanceUID)) {
@@ -168,38 +165,55 @@ export default function hydrateStructuredReport(
}
}
/**
* Gets reference data for what frame of reference and the referenced
* image id, or for 3d measurements, the volumeId to apply this annotation to.
*/
function getReferenceData(toolData): ToolTypes.AnnotationMetadata {
// Add the measurement to toolState
// dcmjs and Cornerstone3D has structural defect in supporting multi-frame
// files, and looking up the imageId from sopInstanceUIDToImageId results
// in the wrong value.
const frameNumber = (toolData.annotation.data && toolData.annotation.data.frameNumber) || 1;
const imageId =
imageIdsForToolState[toolData.sopInstanceUid][frameNumber] ||
sopInstanceUIDToImageId[toolData.sopInstanceUid];
if (!imageId) {
return getReferenceData3D(toolData, servicesManager);
}
const instance = metaData.get('instance', imageId);
const {
FrameOfReferenceUID,
// SOPInstanceUID,
// SeriesInstanceUID,
// StudyInstanceUID,
} = instance;
return {
referencedImageId: imageId,
FrameOfReferenceUID,
};
}
Object.keys(hydratableMeasurementsInSR).forEach(annotationType => {
const toolDataForAnnotationType = hydratableMeasurementsInSR[annotationType];
toolDataForAnnotationType.forEach(toolData => {
// Add the measurement to toolState
// dcmjs and Cornerstone3D has structural defect in supporting multi-frame
// files, and looking up the imageId from sopInstanceUIDToImageId results
// in the wrong value.
const frameNumber = (toolData.annotation.data && toolData.annotation.data.frameNumber) || 1;
const imageId =
imageIdsForToolState[toolData.sopInstanceUid][frameNumber] ||
sopInstanceUIDToImageId[toolData.sopInstanceUid];
toolData.uid = guid();
const instance = metaData.get('instance', imageId);
const {
FrameOfReferenceUID,
// SOPInstanceUID,
// SeriesInstanceUID,
// StudyInstanceUID,
} = instance;
const referenceData = getReferenceData(toolData);
const { imageId } = referenceData;
const annotation = {
annotationUID: toolData.annotation.annotationUID,
data: toolData.annotation.data,
metadata: {
...referenceData,
toolName: annotationType,
referencedImageId: imageId,
FrameOfReferenceUID,
},
};
utilities.updatePlaneRestriction(annotation.data.handles.points, annotation.metadata);
const source = measurementService.getSource(
CORNERSTONE_3D_TOOLS_SOURCE_NAME,
@@ -208,7 +222,11 @@ export default function hydrateStructuredReport(
annotation.data.label = getLabelFromDCMJSImportedToolData(toolData);
annotation.data.finding = convertCode(codingValues, toolData.finding?.[0]);
annotation.data.findingSites = convertSites(codingValues, toolData.findingSites);
annotation.data.site = annotation.data.findingSites?.[0];
annotation.data.findingSites?.forEach(site => {
if (site.type) {
annotation.data[site.type] = site;
}
});
const matchingMapping = mappings.find(m => m.annotationType === annotationType);
@@ -220,12 +238,16 @@ export default function hydrateStructuredReport(
dataSource
);
commandsManager.runCommand('updateMeasurement', {
uid: newAnnotationUID,
code: annotation.data.finding,
});
if (disableEditing) {
const addedAnnotation = annotationManager.getAnnotation(newAnnotationUID);
locking.setAnnotationLocked(addedAnnotation, true);
locking.setAnnotationLocked(newAnnotationUID, true);
}
if (!imageIds.includes(imageId)) {
if (imageId && !imageIds.includes(imageId)) {
imageIds.push(imageId);
}
});
@@ -239,61 +261,91 @@ export default function hydrateStructuredReport(
};
}
function _mapLegacyDataSet(dataset) {
const REPORT = 'Imaging Measurements';
const GROUP = 'Measurement Group';
const TRACKING_IDENTIFIER = 'Tracking Identifier';
// Identify the Imaging Measurements
const imagingMeasurementContent = toArray(dataset.ContentSequence).find(
codeMeaningEquals(REPORT)
);
// Retrieve the Measurements themselves
const measurementGroups = toArray(imagingMeasurementContent.ContentSequence).filter(
codeMeaningEquals(GROUP)
);
// For each of the supported measurement types, compute the measurement data
const measurementData = {};
const cornerstoneToolClasses = MeasurementReport.CORNERSTONE_TOOL_CLASSES_BY_UTILITY_TYPE;
const registeredToolClasses = [];
Object.keys(cornerstoneToolClasses).forEach(key => {
registeredToolClasses.push(cornerstoneToolClasses[key]);
measurementData[key] = [];
});
measurementGroups.forEach((measurementGroup, index) => {
const measurementGroupContentSequence = toArray(measurementGroup.ContentSequence);
const TrackingIdentifierGroup = measurementGroupContentSequence.find(
contentItem => contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER
);
const TrackingIdentifier = TrackingIdentifierGroup.TextValue;
let [cornerstoneTag, toolName] = TrackingIdentifier.split(':');
if (supportedLegacyCornerstoneTags.includes(cornerstoneTag)) {
cornerstoneTag = CORNERSTONE_3D_TAG;
}
const mappedTrackingIdentifier = `${cornerstoneTag}:${toolName}`;
TrackingIdentifierGroup.TextValue = mappedTrackingIdentifier;
});
return dataset;
/**
* For 3d annotations, there are often several display sets which could
* be used to display the annotation. Choose the first annotation with the
* same frame of reference that is reconstructable, or the first display set
* otherwise.
*/
function chooseDisplaySet(displaySets, annotation) {
if (!displaySets?.length) {
console.warn('No display set found for', annotation);
return;
}
if (displaySets.length === 1) {
return displaySets[0];
}
const volumeDs = displaySets.find(ds => ds.isReconstructable);
if (volumeDs) {
return volumeDs;
}
return displaySets[0];
}
const toArray = function (x) {
return Array.isArray(x) ? x : [x];
};
/**
* Gets the additional reference data appropriate for a 3d reference.
* This will choose a volume id, frame of reference and a plane restriction.
*/
function getReferenceData3D(toolData, servicesManager: Types.ServicesManager) {
const { FrameOfReferenceUID } = toolData.annotation.metadata;
const { points } = toolData.annotation.data.handles;
const { displaySetService } = servicesManager.services;
const displaySetsFOR = displaySetService.getDisplaySetsBy(
ds => ds.FrameOfReferenceUID === FrameOfReferenceUID
);
if (!displaySetsFOR.length || !points?.length) {
return {
FrameOfReferenceUID,
};
}
const ds = chooseDisplaySet(displaySetsFOR, toolData.annotation);
const cameraView = chooseCameraView(ds, points);
const codeMeaningEquals = codeMeaningName => {
return contentItem => {
return contentItem.ConceptNameCodeSequence.CodeMeaning === codeMeaningName;
const viewReference = {
...cameraView,
volumeId: ds.displaySetInstanceUID,
FrameOfReferenceUID,
};
};
utilities.updatePlaneRestriction(points, viewReference);
return viewReference;
}
/**
* Chooses a possible camera view - right now this is fairly basic,
* just setting the unknowns to null.
*/
function chooseCameraView(_ds, points) {
const selectedPoints = choosePoints(points);
const cameraFocalPoint = <Point3>centerOf(selectedPoints);
// These are sufficient to be null for now and can be set on first view
let viewPlaneNormal: Types.Point3 = null;
let viewUp: Types.Point3 = null;
return {
cameraFocalPoint,
viewPlaneNormal,
viewUp,
};
}
function centerOf(points) {
const scale = 1 / points.length;
const center = vec3.create();
for (const point of points) {
vec3.scaleAndAdd(center, center, point, scale);
}
return center;
}
function choosePoints(points) {
if (points.length === 1 || points.length === 2) {
return points;
}
const firstIndex = 0;
const secondIndex = Math.ceil(points.length / 4);
const thirdIndex = Math.ceil(points.length / 2);
// TODO - check if colinear, if so try to find another 3 points.
const newPoints = [points[firstIndex], points[secondIndex], points[thirdIndex]];
return newPoints;
}
@@ -1,60 +0,0 @@
import { adaptersSR } from '@cornerstonejs/adapters';
const cornerstoneAdapters =
adaptersSR.Cornerstone3D.MeasurementReport.CORNERSTONE_TOOL_CLASSES_BY_UTILITY_TYPE;
const supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0'];
const CORNERSTONE_3D_TAG = adaptersSR.Cornerstone3D.CORNERSTONE_3D_TAG;
/**
* Checks if the given `displaySet`can be rehydrated into the `measurementService`.
*
* @param {object} displaySet The SR `displaySet` to check.
* @param {object[]} mappings The CornerstoneTools 4 mappings to the `measurementService`.
* @returns {boolean} True if the SR can be rehydrated into the `measurementService`.
*/
export default function isRehydratable(displaySet, mappings) {
if (!mappings || !mappings.length) {
return false;
}
const mappingDefinitions = mappings.map(m => m.annotationType);
const { measurements } = displaySet;
const adapterKeys = Object.keys(cornerstoneAdapters).filter(
adapterKey =>
typeof cornerstoneAdapters[adapterKey].isValidCornerstoneTrackingIdentifier === 'function'
);
const adapters = [];
adapterKeys.forEach(key => {
if (mappingDefinitions.includes(key)) {
// Must have both a dcmjs adapter and a measurementService
// Definition in order to be a candidate for import.
adapters.push(cornerstoneAdapters[key]);
}
});
for (let i = 0; i < measurements.length; i++) {
const { TrackingIdentifier } = measurements[i] || {};
const hydratable = adapters.some(adapter => {
let [cornerstoneTag, toolName] = TrackingIdentifier.split(':');
if (supportedLegacyCornerstoneTags.includes(cornerstoneTag)) {
cornerstoneTag = CORNERSTONE_3D_TAG;
}
const mappedTrackingIdentifier = `${cornerstoneTag}:${toolName}`;
return adapter.isValidCornerstoneTrackingIdentifier(mappedTrackingIdentifier);
});
if (hydratable) {
return true;
}
console.log('Measurement is not rehydratable', TrackingIdentifier, measurements[i]);
}
console.log('No measurements found which were rehydratable');
return false;
}
@@ -0,0 +1,48 @@
import { adaptersSR } from '@cornerstonejs/adapters';
const { MeasurementReport } = adaptersSR.Cornerstone3D;
/**
* Checks if the given `displaySet`can be rehydrated into the `measurementService`.
*
* @param {object} displaySet The SR `displaySet` to check.
* @param {object[]} mappings The CornerstoneTools 4 mappings to the `measurementService`.
* @returns {boolean} True if the SR can be rehydrated into the `measurementService`.
*/
export default function isRehydratable(displaySet, mappings) {
if (!mappings || !mappings.length) {
return false;
}
const mappingDefinitions = new Set<string>();
for (const m of mappings) {
mappingDefinitions.add(m.annotationType);
}
const { measurements } = displaySet;
for (let i = 0; i < measurements.length; i++) {
const measurement = measurements[i];
if (!measurement) {
continue;
}
const { TrackingIdentifier = '', graphicType, graphicCode, pointsLength } = measurement;
if (!TrackingIdentifier && !graphicType) {
console.warn('No tracking identifier or graphicType for measurement ', measurement);
continue;
}
const adapter = MeasurementReport.getAdapterForTrackingIdentifier(TrackingIdentifier);
const adapters = MeasurementReport.getAdaptersForTypes(graphicCode, graphicType, pointsLength);
const hydratable =
(adapter && mappingDefinitions.has(adapter.toolType)) ||
(adapters && adapters.some(adapter => mappingDefinitions.has(adapter.toolType)));
if (hydratable) {
return true;
}
console.log('Measurement is not rehydratable', TrackingIdentifier, measurements[i]);
}
console.log('No measurements found which were rehydratable');
return false;
}
File diff suppressed because it is too large. Load diff
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone-dynamic-volume",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "OHIF extension for 4D volumes data",
"author": "OHIF",
"license": "MIT",
@@ -29,12 +29,12 @@
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
},
"peerDependencies": {
"@ohif/core": "3.10.0-beta.12",
"@ohif/extension-cornerstone": "3.10.0-beta.12",
"@ohif/extension-default": "3.10.0-beta.12",
"@ohif/i18n": "3.10.0-beta.12",
"@ohif/ui": "3.10.0-beta.12",
"dcmjs": "*",
"@ohif/core": "3.11.0",
"@ohif/extension-cornerstone": "3.11.0",
"@ohif/extension-default": "3.11.0",
"@ohif/i18n": "3.11.0",
"@ohif/ui": "3.11.0",
"dcmjs": "0.43.1",
"dicom-parser": "^1.8.21",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
@@ -42,8 +42,8 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/core": "^2.2.20",
"@cornerstonejs/tools": "^2.2.20",
"@cornerstonejs/core": "^3.32.5",
"@cornerstonejs/tools": "^3.32.5",
"classnames": "^2.3.2"
}
}
@@ -262,7 +262,6 @@ function _getInstanceFromSegmentations(segmentations, { servicesManager }) {
}
function updateSegmentationsChartDisplaySet({ servicesManager }: withAppTypes): void {
debugger;
const { segmentationService } = servicesManager.services;
const segmentations = segmentationService.getSegmentations();
const { seriesMetadata, instance } =
@@ -263,7 +263,7 @@ const commandsModule = ({ commandsManager, servicesManager }: withAppTypes) => {
}
}
viewportGridService.setDisplaySetsForViewports(viewportsToUpdate);
commandsManager.run('setDisplaySetsForViewports', { viewportsToUpdate });
},
swapComputedWithDynamicDisplaySet: () => {
// Todo: this assumes there is only one dynamic display set in the viewer
@@ -313,7 +313,7 @@ const commandsModule = ({ commandsManager, servicesManager }: withAppTypes) => {
}
}
viewportGridService.setDisplaySetsForViewports(viewportsToUpdate);
commandsManager.run('setDisplaySetsForViewports', { viewportsToUpdate });
},
createNewLabelMapForDynamicVolume: async ({ label }) => {
const { viewports, activeViewportId } = viewportGridService.getState();
@@ -1,10 +1,12 @@
import React from 'react';
import { DynamicDataPanel } from './panels';
import { Toolbox } from '@ohif/ui-next';
import { Toolbox } from '@ohif/extension-default';
import { PanelSegmentation } from '@ohif/extension-cornerstone';
import DynamicExport from './panels/DynamicExport';
function getPanelModule({ commandsManager, extensionManager, servicesManager, configuration }) {
const { toolbarService } = servicesManager.services;
const wrappedDynamicDataPanel = () => {
return (
<DynamicDataPanel
@@ -19,10 +21,7 @@ function getPanelModule({ commandsManager, extensionManager, servicesManager, co
return (
<>
<Toolbox
commandsManager={commandsManager}
servicesManager={servicesManager}
extensionManager={extensionManager}
buttonSectionId="dynamic-toolbox"
buttonSectionId={toolbarService.sections.dynamicToolbox}
title="Threshold Tools"
/>
<PanelSegmentation
@@ -1,38 +1,45 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import {
Tabs,
TabsList,
TabsTrigger,
Button,
PanelSection,
ButtonGroup,
IconButton,
InputNumber,
Icon,
Icons,
Tooltip,
} from '@ohif/ui';
import { DoubleSlider } from '@ohif/ui-next';
TooltipTrigger,
TooltipContent,
Numeric,
} from '@ohif/ui-next';
import { Enums } from '@cornerstonejs/core';
const controlClassNames = {
sizeClassName: 'w-[58px] h-[28px]',
arrowsDirection: 'horizontal',
labelPosition: 'bottom',
// Helper function to safely convert any value to uppercase string
const toUpperCaseString = value => {
if (value === null || value === undefined) {
return '';
}
return String(value).toUpperCase();
};
const Header = ({ title, tooltip }) => (
<div className="flex items-center space-x-1">
<Tooltip
content={<div className="text-white">{tooltip}</div>}
position="bottom-left"
tight={true}
tooltipBoxClassName="max-w-xs p-2"
>
<Icon
name="info-link"
className="text-primary-active h-[14px] w-[14px]"
/>
<Tooltip>
<TooltipTrigger asChild>
<span>
<Icons.ByName
name="info-link"
className="text-primary h-3 w-3"
/>
</span>
</TooltipTrigger>
<TooltipContent
sideOffset={4}
className="max-w-xs"
>
<div>{tooltip}</div>
</TooltipContent>
</Tooltip>
<span className="text-aqua-pale text-[11px] uppercase">{title}</span>
<span className="text-muted-foreground text-xs uppercase tracking-wide">{title}</span>
</div>
);
@@ -45,132 +52,149 @@ const DynamicVolumeControls = ({
minFps,
maxFps,
// Frames
currentFrameIndex,
onFrameChange,
framesLength,
currentDimensionGroupNumber,
onDimensionGroupChange,
numDimensionGroups,
onGenerate,
onDoubleRangeChange,
rangeValues,
onDynamicClick,
}) => {
const [computedView, setComputedView] = useState(false);
const [computeViewMode, setComputeViewMode] = useState(Enums.DynamicOperatorType.SUM);
const [sliderRangeValues, setSliderRangeValues] = useState([0, framesLength - 1]);
const handleSliderChange = newValues => {
onDoubleRangeChange(newValues);
setSliderRangeValues(newValues);
// Wrapper for onGenerate to handle potential errors
const handleGenerate = () => {
try {
if (typeof onGenerate === 'function') {
onGenerate(computeViewMode);
} else {
console.error('onGenerate is not a function', onGenerate);
}
} catch (error) {
console.error('Error in onGenerate:', error);
}
};
const formatLabel = value => Math.round(value);
return (
<div className="flex select-none flex-col">
<PanelSection
title="Controls"
childrenClassName="space-y-4 pb-5 px-5"
>
<div className="mt-2">
<Header
title="View"
tooltip={
'Select the view mode, 4D to view the dynamic volume or Computed to view the computed volume'
}
/>
<ButtonGroup className="mt-2 w-full">
<button
className="w-1/2"
onClick={() => {
setComputedView(false);
onDynamicClick?.();
<PanelSection defaultOpen={true}>
<PanelSection.Header>Controls</PanelSection.Header>
<PanelSection.Content className="bg-muted space-y-4 px-5 pt-2 pb-4">
<div className="mb-4">
<Header
title="View"
tooltip={
'Select the view mode, 4D to view the dynamic volume or Computed to view the computed volume'
}
/>
<Tabs
value={computedView ? 'computed' : '4d'}
onValueChange={value => {
const isComputed = value === 'computed';
setComputedView(isComputed);
if (!isComputed && typeof onDynamicClick === 'function') {
onDynamicClick();
}
}}
className="my-2 w-full"
>
4D
</button>
<button
className="w-1/2"
onClick={() => {
setComputedView(true);
}}
>
Computed
</button>
</ButtonGroup>
</div>
<div>
<FrameControls
onPlayPauseChange={onPlayPauseChange}
isPlaying={isPlaying}
computedView={computedView}
// fps
fps={fps}
onFpsChange={onFpsChange}
minFps={minFps}
maxFps={maxFps}
//
framesLength={framesLength}
onFrameChange={onFrameChange}
currentFrameIndex={currentFrameIndex}
/>
</div>
<div className={`mt-6 flex flex-col ${computedView ? '' : 'ohif-disabled'}`}>
<Header
title="Computed Operation"
tooltip={
<div>
Operation Buttons (SUM, AVERAGE, SUBTRACT): Select the mathematical operation to be
applied to the data set.
<br></br> Range Slider: Choose the numeric range within which the operation will be
performed.
<br></br>Generate Button: Execute the chosen operation on the specified range of
data.{' '}
</div>
}
/>
<ButtonGroup
className={`mt-2 w-full`}
separated={true}
>
<button
className="w-1/2"
onClick={() => setComputeViewMode(Enums.DynamicOperatorType.SUM)}
>
{Enums.DynamicOperatorType.SUM.toString().toUpperCase()}
</button>
<button
className="w-1/2"
onClick={() => setComputeViewMode(Enums.DynamicOperatorType.AVERAGE)}
>
{Enums.DynamicOperatorType.AVERAGE.toString().toUpperCase()}
</button>
<button
className="w-1/2"
onClick={() => setComputeViewMode(Enums.DynamicOperatorType.SUBTRACT)}
>
{Enums.DynamicOperatorType.SUBTRACT.toString().toUpperCase()}
</button>
</ButtonGroup>
<div className="mt-2 w-full">
<DoubleSlider
min={0}
max={framesLength - 1}
step={1}
defaultValue={sliderRangeValues}
onValueChange={handleSliderChange}
formatLabel={formatLabel}
className="w-full"
<TabsList className="w-full">
<TabsTrigger
value="4d"
className="w-1/2"
>
4D
</TabsTrigger>
<TabsTrigger
value="computed"
className="w-1/2"
>
Computed
</TabsTrigger>
</TabsList>
</Tabs>
</div>
<div>
<DimensionGroupControls
onPlayPauseChange={onPlayPauseChange}
isPlaying={isPlaying}
computedView={computedView}
// fps
fps={fps}
onFpsChange={onFpsChange}
minFps={minFps}
maxFps={maxFps}
//
numDimensionGroups={numDimensionGroups}
onDimensionGroupChange={onDimensionGroupChange}
currentDimensionGroupNumber={currentDimensionGroupNumber}
/>
</div>
<Button
className="mt-2 !h-[26px] !w-[115px] self-start !p-0"
onClick={() => {
onGenerate(computeViewMode);
}}
>
Generate
</Button>
</div>
<div className={`mt-3 flex flex-col ${computedView ? '' : 'ohif-disabled'}`}>
<Header
title="Computed Operation"
tooltip={
<div>
Operation Buttons (SUM, AVERAGE, SUBTRACT): Select the mathematical operation to
be applied to the data set.
<br /> Range Slider: Choose the numeric range of dimension groups within which the
operation will be performed.
<br />
Generate Button: Execute the chosen operation on the specified range of data.
</div>
}
/>
<Tabs
value={String(computeViewMode)}
onValueChange={value => {
setComputeViewMode(value);
}}
className="mt-2 w-full"
>
<TabsList className="w-full gap-1">
{' '}
<TabsTrigger
value={String(Enums.DynamicOperatorType.SUM)}
className="w-1/3"
>
{toUpperCaseString(Enums.DynamicOperatorType.SUM)}
</TabsTrigger>
<TabsTrigger
value={String(Enums.DynamicOperatorType.AVERAGE)}
className="w-1/3"
>
{toUpperCaseString(Enums.DynamicOperatorType.AVERAGE)}
</TabsTrigger>
<TabsTrigger
value={String(Enums.DynamicOperatorType.SUBTRACT)}
className="w-1/3"
>
{toUpperCaseString(Enums.DynamicOperatorType.SUBTRACT)}
</TabsTrigger>
</TabsList>
</Tabs>
<div className="mt-2 w-full">
<Numeric.Container
mode="doubleRange"
min={1}
max={numDimensionGroups || 1}
values={rangeValues || [1, numDimensionGroups || 1]}
onChange={onDoubleRangeChange || (() => {})}
>
<Numeric.DoubleRange showNumberInputs />
</Numeric.Container>
</div>
<Button
variant="default"
size="sm"
className="mt-2 h-[26px] w-[115px] self-start p-0"
onClick={handleGenerate}
>
Generate
</Button>
</div>
</PanelSection.Content>
</PanelSection>
</div>
);
@@ -178,58 +202,84 @@ const DynamicVolumeControls = ({
export default DynamicVolumeControls;
function FrameControls({
function DimensionGroupControls({
isPlaying,
onPlayPauseChange,
fps,
minFps,
maxFps,
onFpsChange,
framesLength,
onFrameChange,
currentFrameIndex,
numDimensionGroups,
onDimensionGroupChange,
currentDimensionGroupNumber,
computedView,
}) {
const getPlayPauseIconName = () => (isPlaying ? 'icon-pause' : 'icon-play');
return (
<div className={computedView && 'ohif-disabled'}>
<div className={computedView ? 'ohif-disabled' : ''}>
<Header
title="4D Controls"
tooltip={
<div>
Play/Pause Button: Begin or pause the animation of the 4D visualization. <br></br> Frame
Selector: Navigate through individual frames of the 4D data. <br></br> FPS (Frames Per
Second) Selector: Adjust the playback speed of the animation.
Play/Pause Button: Begin or pause the animation of the 4D visualization. <br />
Dimension Group Selector: Navigate through individual dimension groups of the 4D data.{' '}
<br />
FPS (Frames Per Second) Selector: Adjust the playback speed of the animation.
</div>
}
/>
<div className="mt-3 flex justify-between">
<IconButton
className="bg-customblue-30 h-[26px] w-[58px] rounded-[4px]"
onClick={() => onPlayPauseChange(!isPlaying)}
<Button
id="play-pause-button"
variant="secondary"
size="default"
className="w-[58px]"
onClick={() => {
if (typeof onPlayPauseChange === 'function') {
onPlayPauseChange(!isPlaying);
}
}}
>
<Icon
<Icons.ByName
name={getPlayPauseIconName()}
className="active:text-primary-light hover:bg-customblue-300 h-[24px] w-[24px] cursor-pointer text-white"
className="text-foreground h-[24px] w-[24px]"
/>
</IconButton>
<InputNumber
value={currentFrameIndex}
onChange={onFrameChange}
minValue={0}
maxValue={framesLength - 1}
label="Frame"
{...controlClassNames}
/>
<InputNumber
value={fps}
onChange={onFpsChange}
minValue={minFps}
maxValue={maxFps}
{...controlClassNames}
label="FPS"
/>
</Button>
<Numeric.Container
mode="stepper"
value={currentDimensionGroupNumber || 1}
onChange={onDimensionGroupChange || (() => {})}
min={1}
max={numDimensionGroups || 1}
step={1}
>
<div className="flex flex-col items-center">
<Numeric.NumberStepper
className="h-[28px] w-[58px]"
direction="horizontal"
/>
<Numeric.Label className="text-muted-foreground mt-1 text-sm">Frame</Numeric.Label>
</div>
</Numeric.Container>
<Numeric.Container
mode="stepper"
value={fps || 1}
onChange={onFpsChange || (() => {})}
min={minFps || 1}
max={maxFps || 30}
step={1}
>
<div className="flex flex-col items-center">
<Numeric.NumberStepper
className="h-[28px] w-[58px]"
direction="horizontal"
/>
<Numeric.Label className="text-muted-foreground mt-1 text-sm">FPS</Numeric.Label>
</div>
</Numeric.Container>
</div>
</div>
);
@@ -1,71 +0,0 @@
import React from 'react';
import { InputDoubleRange } from '@ohif/ui';
import { Select } from '@ohif/ui';
import { Button } from '@ohif/ui';
import PropTypes from 'prop-types';
const GenerateVolume = ({
rangeValues,
handleSliderChange,
operationsUI,
options,
handleGenerateOptionsChange,
onGenerateImage,
returnTo4D,
displayingComputedVolume,
}) => {
return (
<>
<div>
<div className="mb-2 text-white">Computed Image</div>
<Select
closeMenuOnSelect={true}
className="border-primary-main mr-2 bg-black text-white "
options={operationsUI}
placeholder={operationsUI.find(option => option.value === options.Operation).placeHolder}
value={options.Operation}
onChange={({ value }) => {
handleGenerateOptionsChange({
Operation: value,
});
}}
/>
<InputDoubleRange
values={rangeValues}
onChange={handleSliderChange}
minValue={rangeValues[0] || 1}
maxValue={rangeValues[1] || 2}
showLabel={true}
step={1}
/>
<div className="flex space-x-2">
<Button
onClick={onGenerateImage}
className="w-1/2"
>
Generate
</Button>
<Button
onClick={returnTo4D}
disabled={!displayingComputedVolume}
className="w-1/2"
>
Return To 4D
</Button>
</div>
</div>
</>
);
};
GenerateVolume.propTypes = {
rangeValues: PropTypes.array.isRequired,
handleSliderChange: PropTypes.func.isRequired,
operationsUI: PropTypes.array.isRequired,
options: PropTypes.object.isRequired,
handleGenerateOptionsChange: PropTypes.func.isRequired,
onGenerateImage: PropTypes.func.isRequired,
returnTo4D: PropTypes.func.isRequired,
};
export default GenerateVolume;
@@ -1,5 +1,6 @@
import React, { useEffect, useState, useRef } from 'react';
import { useCine, useViewportGrid } from '@ohif/ui';
import { useCine } from '@ohif/ui-next';
import { useViewportGrid } from '@ohif/ui-next';
import { utilities as csUtils, volumeLoader, eventTarget, Enums, cache } from '@cornerstonejs/core';
import { utilities as cstUtils } from '@cornerstonejs/tools';
import DynamicVolumeControls from './DynamicVolumeControls';
@@ -14,13 +15,12 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
const [{ activeViewportId }] = useViewportGrid();
//
const [timePointsRange, setTimePointsRange] = useState([0, 0]);
const [timePointsRangeToUseForGenerate, setTimePointsRangeToUseForGenerate] = useState([0, 0]);
const [dimensionGroupRange, setDimensionGroupRange] = useState([1, 1]);
const [computedDisplaySet, setComputedDisplaySet] = useState(null);
const [dynamicVolume, setDynamicVolume] = useState(null);
const [frameRate, setFrameRate] = useState(20);
const [isPlaying, setIsPlaying] = useState(isCineEnabled);
const [timePointRendered, setTimePointRendered] = useState(null);
const [dimensionGroupNumberRendered, setDimensionGroupNumberRendered] = useState(null);
const [displayingComputed, setDisplayingComputed] = useState(false);
//
@@ -37,9 +37,8 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
if (volumeData.volume?.isDynamicVolume()) {
setDynamicVolume(volumeData.volume);
uuidDynamicVolume.current = volumeData.displaySetInstanceUID;
const newRange = [1, volumeData.volume.numTimePoints];
setTimePointsRange(newRange);
setTimePointsRangeToUseForGenerate(newRange);
const newRange = [1, volumeData.volume.numDimensionGroups];
setDimensionGroupRange(newRange);
}
});
};
@@ -64,10 +63,10 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
}, [cornerstoneViewportService, cineService, servicesManager.services.cineService]);
useEffect(() => {
const evt = Enums.Events.DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED;
const evt = Enums.Events.DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED;
const callback = evt => {
setTimePointRendered(evt.detail.timePointIndex);
setDimensionGroupNumberRendered(evt.detail.dimensionGroupNumber);
};
eventTarget.addEventListener(evt, callback);
@@ -75,7 +74,7 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
return () => {
eventTarget.removeEventListener(evt, callback);
};
}, [cornerstoneViewportService]);
}, []);
useEffect(() => {
const displaySetUIDs = viewportGridService.getDisplaySetsUIDsForViewport(activeViewportId);
@@ -101,9 +100,7 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
setDynamicVolume(dynamicVolume);
uuidDynamicVolume.current = dynamicVolumeDisplaySet.displaySetInstanceUID;
const newRange = [1, dynamicVolume.numTimePoints];
setTimePointsRange(newRange);
setTimePointsRangeToUseForGenerate(newRange);
setDimensionGroupRange([1, dynamicVolume.numDimensionGroups]);
}, [
activeViewportId,
viewportGridService,
@@ -140,11 +137,12 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
volumeId: computedVolumeId,
});
}
const [start, end] = timePointsRangeToUseForGenerate;
const frameNumbers = Array.from({ length: end - start + 1 }, (_, i) => i + start - 1);
const [start, end] = dimensionGroupRange;
// from start to end, with steps of 1
const frameNumbers = Array.from({ length: end - start + 1 }, (_, i) => start + i);
const options = {
frameNumbers: operationName === 'SUBTRACT' ? [start, end - 1] : frameNumbers,
dimensionGroupNumbers: operationName === 'SUBTRACT' ? [start, end] : frameNumbers,
targetVolume: computedVolume,
};
@@ -206,21 +204,6 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
handlePlay();
};
function handleSliderChange(newValues) {
if (
newValues[0] === timePointsRangeToUseForGenerate[0] &&
newValues[1] === timePointsRangeToUseForGenerate[1]
) {
return;
}
setTimePointsRangeToUseForGenerate(newValues);
}
if (!dynamicVolume || timePointsRange.length === 0) {
return null;
}
return (
<DynamicVolumeControls
fps={frameRate}
@@ -228,16 +211,16 @@ export default function PanelGenerateImage({ servicesManager, commandsManager }:
onPlayPauseChange={onPlayPauseChange}
minFps={1}
maxFps={50}
currentFrameIndex={timePointRendered}
onFpsChange={handleSetFrameRate}
framesLength={timePointsRange[1]}
onFrameChange={timePointIndex => {
dynamicVolume.timePointIndex = timePointIndex;
currentDimensionGroupNumber={dimensionGroupNumberRendered}
numDimensionGroups={dynamicVolume?.numDimensionGroups || 1}
onDimensionGroupChange={dimensionGroupNumber => {
dynamicVolume.dimensionGroupNumber = dimensionGroupNumber;
}}
onGenerate={onGenerateImage}
onDynamicClick={displayingComputed ? () => renderDynamicImage(computedDisplaySet) : null}
onDoubleRangeChange={handleSliderChange}
initialRangeValues={timePointsRangeToUseForGenerate}
onDoubleRangeChange={setDimensionGroupRange}
rangeValues={dimensionGroupRange}
/>
);
}
@@ -5,7 +5,7 @@ function WorkflowPanel({ servicesManager }: { servicesManager: ServicesManager }
const ProgressDropdownWithService =
servicesManager.services.customizationService.getCustomization(
'progressDropdownWithServiceComponent'
).component;
);
return (
<div
File diff suppressed because it is too large. Load diff
+16 -14
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone",
"version": "3.10.0-beta.12",
"version": "3.11.0",
"description": "OHIF extension for Cornerstone",
"author": "OHIF",
"license": "MIT",
@@ -38,11 +38,10 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.4",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^2.2.20",
"@icr/polyseg-wasm": "^0.4.0",
"@ohif/core": "3.10.0-beta.12",
"@ohif/ui": "3.10.0-beta.12",
"dcmjs": "*",
"@cornerstonejs/dicom-image-loader": "^3.32.5",
"@ohif/core": "3.11.0",
"@ohif/ui": "3.11.0",
"dcmjs": "0.43.1",
"dicom-parser": "^1.8.21",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
@@ -50,19 +49,22 @@
"react-dom": "^18.3.1",
"react-resize-detector": "^10.0.1"
},
"devDependencies": {
"lodash": "^4.17.21"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^2.2.20",
"@cornerstonejs/core": "^2.2.20",
"@cornerstonejs/tools": "^2.2.20",
"@icr/polyseg-wasm": "^0.4.0",
"@kitware/vtk.js": "32.1.1",
"@cornerstonejs/adapters": "^3.32.5",
"@cornerstonejs/ai": "^3.32.5",
"@cornerstonejs/core": "^3.32.5",
"@cornerstonejs/labelmap-interpolation": "^3.32.5",
"@cornerstonejs/polymorphic-segmentation": "^3.32.5",
"@cornerstonejs/tools": "^3.32.5",
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
"@kitware/vtk.js": "32.12.0",
"html2canvas": "^1.4.1",
"lodash.compact": "^3.0.1",
"lodash.debounce": "^4.0.8",
"lodash.flatten": "^4.4.0",
"lodash.merge": "^4.6.2",
"lodash.zip": "^4.2.0",
"shader-loader": "^1.3.1",
"worker-loader": "^3.0.8"
}
@@ -2,6 +2,11 @@
width: 100%;
height: 100%; /* MUST have `height` to prevent resize infinite loop */
position: relative;
/* Prevent text selection on the entire viewport wrapper */
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
.cornerstone-viewport-element {
@@ -16,4 +21,26 @@
/* Prevents the entire page from getting larger
when the magnify tool is near the sides/corners of the page */
overflow: hidden;
/* Prevent text selection on the viewport element */
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
/* Prevent text selection on overlay elements */
.noselect {
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
/* Ensure all elements within viewport wrapper prevent text selection */
.viewport-wrapper * {
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
@@ -1,9 +1,8 @@
import React, { useEffect, useRef, useCallback, useState } from 'react';
import { useResizeDetector } from 'react-resize-detector';
import * as cs3DTools from '@cornerstonejs/tools';
import { Enums, eventTarget, getEnabledElement } from '@cornerstonejs/core';
import { MeasurementService } from '@ohif/core';
import { AllInOneMenu, Notification, useViewportDialog } from '@ohif/ui';
import { MeasurementService, useViewportRef } from '@ohif/core';
import { useViewportDialog } from '@ohif/ui-next';
import type { Types as csTypes } from '@cornerstonejs/core';
import { setEnabledElement } from '../state';
@@ -14,20 +13,15 @@ import CinePlayer from '../components/CinePlayer';
import type { Types } from '@ohif/core';
import OHIFViewportActionCorners from '../components/OHIFViewportActionCorners';
import { getWindowLevelActionMenu } from '../components/WindowLevelActionMenu/getWindowLevelActionMenu';
import { useAppConfig } from '@state';
import { getViewportDataOverlaySettingsMenu } from '../components/ViewportDataOverlaySettingMenu';
import { getViewportPresentations } from '../utils/presentations/getViewportPresentations';
import { useSynchronizersStore } from '../stores/useSynchronizersStore';
import ActiveViewportBehavior from '../utils/ActiveViewportBehavior';
import { WITH_NAVIGATION } from '../services/ViewportService/CornerstoneViewportService';
const STACK = 'stack';
/**
* Caches the jump to measurement operation, so that if display set is shown,
* it can jump to the measurement.
*/
let cacheJumpToMeasurementEvent;
// Cache for viewport dimensions, persists across component remounts
const viewportDimensions = new Map<string, { width: number; height: number }>();
// Todo: This should be done with expose of internal API similar to react-vtkjs-viewport
// Then we don't need to worry about the re-renders if the props change.
@@ -46,7 +40,6 @@ const OHIFCornerstoneViewport = React.memo(
viewportOptions,
displaySetOptions,
servicesManager,
commandsManager,
onElementEnabled,
// eslint-disable-next-line react/prop-types
onElementDisabled,
@@ -88,7 +81,7 @@ const OHIFCornerstoneViewport = React.memo(
const [scrollbarHeight, setScrollbarHeight] = useState('100px');
const [enabledVPElement, setEnabledVPElement] = useState(null);
const elementRef = useRef() as React.MutableRefObject<HTMLDivElement>;
const [appConfig] = useAppConfig();
const viewportRef = useViewportRef(viewportId);
const {
displaySetService,
@@ -98,23 +91,56 @@ const OHIFCornerstoneViewport = React.memo(
cornerstoneViewportService,
segmentationService,
cornerstoneCacheService,
viewportActionCornersService,
customizationService,
measurementService,
} = servicesManager.services;
const [viewportDialogState] = useViewportDialog();
// useCallback for scroll bar height calculation
const setImageScrollBarHeight = useCallback(() => {
const scrollbarHeight = `${elementRef.current.clientHeight - 40}px`;
const scrollbarHeight = `${elementRef.current.clientHeight - 10}px`;
setScrollbarHeight(scrollbarHeight);
}, [elementRef]);
// useCallback for onResize
const onResize = useCallback(() => {
if (elementRef.current) {
cornerstoneViewportService.resize();
setImageScrollBarHeight();
const onResize = useCallback(
(entries: ResizeObserverEntry[]) => {
if (elementRef.current && entries?.length) {
const entry = entries[0];
const { width, height } = entry.contentRect;
const prevDimensions = viewportDimensions.get(viewportId) || { width: 0, height: 0 };
// Check if dimensions actually changed and then only resize if they have changed
const hasDimensionsChanged =
prevDimensions.width !== width || prevDimensions.height !== height;
if (width > 0 && height > 0 && hasDimensionsChanged) {
viewportDimensions.set(viewportId, { width, height });
// Perform resize operations
cornerstoneViewportService.resize();
setImageScrollBarHeight();
}
}
},
[viewportId, elementRef, cornerstoneViewportService, setImageScrollBarHeight]
);
useEffect(() => {
const element = elementRef.current;
if (!element) {
return;
}
}, [elementRef]);
const resizeObserver = new ResizeObserver(onResize);
resizeObserver.observe(element);
// Cleanup function
return () => {
resizeObserver.unobserve(element);
resizeObserver.disconnect();
};
}, [onResize]);
const cleanUpServices = useCallback(
viewportInfo => {
@@ -125,16 +151,8 @@ const OHIFCornerstoneViewport = React.memo(
syncGroupService.removeViewportFromSyncGroup(viewportId, renderingEngineId, syncGroups);
segmentationService.clearSegmentationRepresentations(viewportId);
viewportActionCornersService.clear(viewportId);
},
[
viewportId,
segmentationService,
syncGroupService,
toolGroupService,
viewportActionCornersService,
]
[viewportId, segmentationService, syncGroupService, toolGroupService]
);
const elementEnabledHandler = useCallback(
@@ -146,6 +164,11 @@ const OHIFCornerstoneViewport = React.memo(
const { viewportId, element } = evt.detail;
const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
if (!viewportInfo) {
return;
}
setEnabledElement(viewportId, element);
setEnabledVPElement(element);
@@ -197,6 +220,7 @@ const OHIFCornerstoneViewport = React.memo(
}
cornerstoneViewportService.disableElement(viewportId);
viewportRef.unregister();
eventTarget.removeEventListener(Enums.Events.ELEMENT_ENABLED, elementEnabledHandler);
};
@@ -258,14 +282,6 @@ const OHIFCornerstoneViewport = React.memo(
const presentations = getViewportPresentations(viewportId, viewportOptions);
let measurement;
if (cacheJumpToMeasurementEvent?.viewportId === viewportId) {
measurement = cacheJumpToMeasurementEvent.measurement;
// Delete the position presentation so that viewport navigates direct
presentations.positionPresentation = null;
cacheJumpToMeasurementEvent = null;
}
// Note: This is a hack to get the grid to re-render the OHIFCornerstoneViewport component
// Used for segmentation hydration right now, since the logic to decide whether
// a viewport needs to render a segmentation lives inside the CornerstoneViewportService
@@ -283,95 +299,12 @@ const OHIFCornerstoneViewport = React.memo(
displaySetOptions,
presentations
);
if (measurement) {
cs3DTools.annotation.selection.setAnnotationSelected(measurement.uid);
}
};
loadViewportData();
}, [viewportOptions, displaySets, dataSource]);
/**
* There are two scenarios for jump to click
* 1. Current viewports contain the displaySet that the annotation was drawn on
* 2. Current viewports don't contain the displaySet that the annotation was drawn on
* and we need to change the viewports displaySet for jumping.
* Since measurement_jump happens via events and listeners, the former case is handled
* by the measurement_jump direct callback, but the latter case is handled first by
* the viewportGrid to set the correct displaySet on the viewport, AND THEN we check
* the cache for jumping to see if there is any jump queued, then we jump to the correct slice.
*/
useEffect(() => {
if (isJumpToMeasurementDisabled) {
return;
}
const unsubscribeFromJumpToMeasurementEvents = _subscribeToJumpToMeasurementEvents(
elementRef,
viewportId,
servicesManager
);
_checkForCachedJumpToMeasurementEvents(elementRef, viewportId, displaySets, servicesManager);
return () => {
unsubscribeFromJumpToMeasurementEvents();
};
}, [displaySets, elementRef, viewportId, isJumpToMeasurementDisabled, servicesManager]);
// Set up the window level action menu in the viewport action corners.
useEffect(() => {
// Doing an === check here because the default config value when not set is true
if (appConfig.addWindowLevelActionMenu === false) {
return;
}
const location = viewportActionCornersService.LOCATIONS.topRight;
// TODO: In the future we should consider using the customization service
// to determine if and in which corner various action components should go.
viewportActionCornersService.addComponent({
viewportId,
id: 'windowLevelActionMenu',
component: getWindowLevelActionMenu({
viewportId,
element: elementRef.current,
displaySets,
servicesManager,
commandsManager,
location,
verticalDirection: AllInOneMenu.VerticalDirection.TopToBottom,
horizontalDirection: AllInOneMenu.HorizontalDirection.RightToLeft,
}),
location,
});
viewportActionCornersService.addComponent({
viewportId,
id: 'segmentation',
component: getViewportDataOverlaySettingsMenu({
viewportId,
element: elementRef.current,
displaySets,
servicesManager,
commandsManager,
location,
}),
location,
});
}, [
displaySets,
viewportId,
viewportActionCornersService,
servicesManager,
commandsManager,
appConfig,
]);
const { ref: resizeRef } = useResizeDetector({
onResize,
});
const Notification = customizationService.getCustomization('ui.notificationComponent');
return (
<React.Fragment>
@@ -381,9 +314,12 @@ const OHIFCornerstoneViewport = React.memo(
style={{ height: '100%', width: '100%' }}
onContextMenu={e => e.preventDefault()}
onMouseDown={e => e.preventDefault()}
data-viewportid={viewportId}
ref={el => {
resizeRef.current = el;
elementRef.current = el;
if (el) {
viewportRef.register(el);
}
}}
></div>
<CornerstoneOverlays
@@ -425,97 +361,6 @@ const OHIFCornerstoneViewport = React.memo(
areEqual
);
function _subscribeToJumpToMeasurementEvents(elementRef, viewportId, servicesManager) {
const { measurementService, cornerstoneViewportService } = servicesManager.services;
const { unsubscribe } = measurementService.subscribe(
MeasurementService.EVENTS.JUMP_TO_MEASUREMENT_VIEWPORT,
props => {
cacheJumpToMeasurementEvent = props;
const { viewportId: jumpId, measurement, isConsumed } = props;
if (!measurement || isConsumed) {
return;
}
if (cacheJumpToMeasurementEvent.cornerstoneViewport === undefined) {
// Decide on which viewport should handle this
cacheJumpToMeasurementEvent.cornerstoneViewport =
cornerstoneViewportService.getViewportIdToJump(jumpId, {
displaySetInstanceUID: measurement.displaySetInstanceUID,
...measurement.metadata,
referencedImageId:
measurement.referencedImageId || measurement.metadata?.referencedImageId,
});
}
if (cacheJumpToMeasurementEvent.cornerstoneViewport !== viewportId) {
return;
}
_jumpToMeasurement(measurement, elementRef, viewportId, servicesManager);
}
);
return unsubscribe;
}
// Check if there is a queued jumpToMeasurement event
function _checkForCachedJumpToMeasurementEvents(
elementRef,
viewportId,
displaySets,
servicesManager
) {
if (!cacheJumpToMeasurementEvent) {
return;
}
if (cacheJumpToMeasurementEvent.isConsumed) {
cacheJumpToMeasurementEvent = null;
return;
}
const displaysUIDs = displaySets.map(displaySet => displaySet.displaySetInstanceUID);
if (!displaysUIDs?.length) {
return;
}
// Jump to measurement if the measurement exists
const { measurement } = cacheJumpToMeasurementEvent;
if (measurement && elementRef) {
if (displaysUIDs.includes(measurement?.displaySetInstanceUID)) {
_jumpToMeasurement(measurement, elementRef, viewportId, servicesManager);
}
}
}
function _jumpToMeasurement(measurement, targetElementRef, viewportId, servicesManager) {
const { viewportGridService } = servicesManager.services;
const targetElement = targetElementRef.current;
// Todo: setCornerstoneMeasurementActive should be handled by the toolGroupManager
// to set it properly
// setCornerstoneMeasurementActive(measurement);
viewportGridService.setActiveViewportId(viewportId);
const enabledElement = getEnabledElement(targetElement);
if (enabledElement) {
// See how the jumpToSlice() of Cornerstone3D deals with imageIdx param.
const viewport = enabledElement.viewport as csTypes.IStackViewport | csTypes.IVolumeViewport;
const { metadata } = measurement;
if (!viewport.isReferenceViewable(metadata, { withNavigation: true, withOrientation: true })) {
console.log("Reference isn't viewable, postponing until updated");
return;
}
viewport.setViewReference(metadata);
cs3DTools.annotation.selection.setAnnotationSelected(measurement.uid);
// Jump to measurement consumed, remove.
cacheJumpToMeasurementEvent?.consume?.();
cacheJumpToMeasurementEvent = null;
}
}
function _rehydrateSynchronizers(viewportId: string, syncGroupService: any) {
const { synchronizersStore } = useSynchronizersStore.getState();
const synchronizers = synchronizersStore[viewportId];
@@ -576,22 +421,18 @@ OHIFCornerstoneViewport.displayName = 'OHIFCornerstoneViewport';
function areEqual(prevProps, nextProps) {
if (nextProps.needsRerendering) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: needsRerendering');
return false;
}
if (prevProps.displaySets.length !== nextProps.displaySets.length) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: displaySets length change');
return false;
}
if (prevProps.viewportOptions.orientation !== nextProps.viewportOptions.orientation) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: orientation change');
return false;
}
if (prevProps.viewportOptions.toolGroupId !== nextProps.viewportOptions.toolGroupId) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: toolGroupId change');
return false;
}
@@ -599,12 +440,10 @@ function areEqual(prevProps, nextProps) {
nextProps.viewportOptions.viewportType &&
prevProps.viewportOptions.viewportType !== nextProps.viewportOptions.viewportType
) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: viewportType change');
return false;
}
if (nextProps.viewportOptions.needsRerendering) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: viewportOptions.needsRerendering');
return false;
}
@@ -612,7 +451,6 @@ function areEqual(prevProps, nextProps) {
const nextDisplaySets = nextProps.displaySets;
if (prevDisplaySets.length !== nextDisplaySets.length) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: displaySets length mismatch');
return false;
}
@@ -625,13 +463,11 @@ function areEqual(prevProps, nextProps) {
);
if (!foundDisplaySet) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: displaySet not found');
return false;
}
// check they contain the same image
if (foundDisplaySet.images?.length !== prevDisplaySet.images?.length) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: images length mismatch');
return false;
}
@@ -639,7 +475,6 @@ function areEqual(prevProps, nextProps) {
if (foundDisplaySet.images?.length) {
for (let j = 0; j < foundDisplaySet.images.length; j++) {
if (foundDisplaySet.images[j].imageId !== prevDisplaySet.images[j].imageId) {
console.debug('OHIFCornerstoneViewport: Rerender caused by: imageId mismatch');
return false;
}
}
@@ -649,16 +484,4 @@ function areEqual(prevProps, nextProps) {
return true;
}
// Helper function to check if display sets have changed
function haveDisplaySetsChanged(prevDisplaySets, currentDisplaySets) {
if (prevDisplaySets.length !== currentDisplaySets.length) {
return true;
}
return currentDisplaySets.some((currentDS, index) => {
const prevDS = prevDisplaySets[index];
return currentDS.displaySetInstanceUID !== prevDS.displaySetInstanceUID;
});
}
export default OHIFCornerstoneViewport;
@@ -1,16 +1,20 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { vec3 } from 'gl-matrix';
import PropTypes from 'prop-types';
import { metaData, Enums, utilities } from '@cornerstonejs/core';
import { metaData, Enums, utilities, eventTarget } from '@cornerstonejs/core';
import { Enums as csToolsEnums, UltrasoundPleuraBLineTool } from '@cornerstonejs/tools';
import type { ImageSliceData } from '@cornerstonejs/core/types';
import { ViewportOverlay } from '@ohif/ui';
import { ViewportOverlay } from '@ohif/ui-next';
import type { InstanceMetadata } from '@ohif/core/src/types';
import { formatPN, formatDICOMDate, formatDICOMTime, formatNumberPrecision } from './utils';
import { formatDICOMDate, formatDICOMTime, formatNumberPrecision } from './utils';
import { utils } from '@ohif/core';
import { StackViewportData, VolumeViewportData } from '../../types/CornerstoneCacheService';
import './CustomizableViewportOverlay.css';
import { useViewportRendering } from '../../hooks';
const EPSILON = 1e-4;
const { formatPN } = utils;
type ViewportData = StackViewportData | VolumeViewportData;
@@ -45,80 +49,6 @@ const OverlayItemComponents = {
'ohif.overlayItem.instanceNumber': InstanceNumberOverlayItem,
};
const studyDateItem = {
id: 'StudyDate',
customizationType: 'ohif.overlayItem',
label: '',
title: 'Study date',
condition: ({ referenceInstance }) => referenceInstance?.StudyDate,
contentF: ({ referenceInstance, formatters: { formatDate } }) =>
formatDate(referenceInstance.StudyDate),
};
const seriesDescriptionItem = {
id: 'SeriesDescription',
customizationType: 'ohif.overlayItem',
label: '',
title: 'Series description',
condition: ({ referenceInstance }) => {
return referenceInstance && referenceInstance.SeriesDescription;
},
contentF: ({ referenceInstance }) => referenceInstance.SeriesDescription,
};
const topLeftItems = {
id: 'cornerstoneOverlayTopLeft',
items: [studyDateItem, seriesDescriptionItem],
};
const topRightItems = { id: 'cornerstoneOverlayTopRight', items: [] };
const bottomLeftItems = {
id: 'cornerstoneOverlayBottomLeft',
items: [
{
id: 'WindowLevel',
customizationType: 'ohif.overlayItem.windowLevel',
},
{
id: 'ZoomLevel',
customizationType: 'ohif.overlayItem.zoomLevel',
condition: props => {
const activeToolName = props.toolGroupService.getActiveToolForViewport(props.viewportId);
return activeToolName === 'Zoom';
},
},
],
};
const bottomRightItems = {
id: 'cornerstoneOverlayBottomRight',
items: [
{
id: 'InstanceNumber',
customizationType: 'ohif.overlayItem.instanceNumber',
},
],
};
/**
* The @ohif/cornerstoneOverlay is a default value for a customization
* for the cornerstone overlays. The intent is to allow it to be extended
* without needing to re-write the individual overlays by using the append
* mechanism. Individual attributes can be modified individually without
* affecting the other items by using the append as well, with position
* based replacement.
* This is used as a default in the getCustomizationModule so that it
* is available early for additional customization extensions.
*/
const CornerstoneOverlay = {
id: '@ohif/cornerstoneOverlay',
topLeftItems,
topRightItems,
bottomLeftItems,
bottomRightItems,
};
/**
* Customizable Viewport Overlay
*/
@@ -139,28 +69,22 @@ function CustomizableViewportOverlay({
servicesManager.services;
const [voi, setVOI] = useState({ windowCenter: null, windowWidth: null });
const [scale, setScale] = useState(1);
const [annotationState, setAnnotationState] = useState(0);
const { isViewportBackgroundLight: isLight } = useViewportRendering(viewportId);
const { imageIndex } = imageSliceData;
// The new customization is 'cornerstoneOverlay', with an append or replace
// on the individual items rather than defining individual items.
const cornerstoneOverlay = customizationService.getCustomization('@ohif/cornerstoneOverlay');
// Historical usage defined the overlays as separate items due to lack of
// append functionality. This code enables the historical usage, but
// the recommended functionality is to append to the default values in
// cornerstoneOverlay rather than defining individual items.
const topLeftCustomization =
customizationService.getCustomization('cornerstoneOverlayTopLeft') ||
cornerstoneOverlay?.topLeftItems;
const topRightCustomization =
customizationService.getCustomization('cornerstoneOverlayTopRight') ||
cornerstoneOverlay?.topRightItems;
const bottomLeftCustomization =
customizationService.getCustomization('cornerstoneOverlayBottomLeft') ||
cornerstoneOverlay?.bottomLeftItems;
const bottomRightCustomization =
customizationService.getCustomization('cornerstoneOverlayBottomRight') ||
cornerstoneOverlay?.bottomRightItems;
const topLeftCustomization = customizationService.getCustomization('viewportOverlay.topLeft');
const topRightCustomization = customizationService.getCustomization('viewportOverlay.topRight');
const bottomLeftCustomization = customizationService.getCustomization(
'viewportOverlay.bottomLeft'
);
const bottomRightCustomization = customizationService.getCustomization(
'viewportOverlay.bottomRight'
);
const instanceNumber = useMemo(
() =>
@@ -210,6 +134,20 @@ function CustomizableViewportOverlay({
};
}, [viewportId, viewportData, voi, element]);
const annotationModified = useCallback(evt => {
if (evt.detail.annotation.metadata.toolName === UltrasoundPleuraBLineTool.toolName) {
// Update the annotation state to trigger a re-render
setAnnotationState(prevState => prevState + 1);
}
}, []);
useEffect(() => {
eventTarget.addEventListener(csToolsEnums.Events.ANNOTATION_MODIFIED, annotationModified);
return () => {
eventTarget.removeEventListener(csToolsEnums.Events.ANNOTATION_MODIFIED, annotationModified);
};
}, [annotationModified]);
/**
* Updating the scale when the viewport changes its zoom
*/
@@ -250,6 +188,7 @@ function CustomizableViewportOverlay({
viewportId,
servicesManager,
customization: item,
isLight,
formatters: {
formatPN,
formatDate: formatDICOMDate,
@@ -262,8 +201,8 @@ function CustomizableViewportOverlay({
return null;
}
const { customizationType } = item;
const OverlayItemComponent = OverlayItemComponents[customizationType];
const { inheritsFrom } = item;
const OverlayItemComponent = OverlayItemComponents[inheritsFrom];
if (OverlayItemComponent) {
return <OverlayItemComponent {...overlayItemProps} />;
@@ -286,15 +225,12 @@ function CustomizableViewportOverlay({
voi,
scale,
instanceNumber,
annotationState,
]
);
const getContent = useCallback(
(customization, keyPrefix) => {
if (!customization?.items) {
return null;
}
const { items } = customization;
const props = {
...displaySetProps,
formatters: { formatDate: formatDICOMDate },
@@ -303,11 +239,12 @@ function CustomizableViewportOverlay({
instanceNumber,
viewportId,
toolGroupService,
isLight,
};
return (
<>
{items.map((item, index) => (
{customization.map((item, index) => (
<div key={`${keyPrefix}_${index}`}>
{((!item?.condition || item.condition(props)) && _renderOverlayItem(item, props)) ||
null}
@@ -325,6 +262,8 @@ function CustomizableViewportOverlay({
topRight={getContent(topRightCustomization, 'topRightOverlayItem')}
bottomLeft={getContent(bottomLeftCustomization, 'bottomLeftOverlayItem')}
bottomRight={getContent(bottomRightCustomization, 'bottomRightOverlayItem')}
color={isLight ? 'text-neutral-dark' : 'text-neutral-light'}
shadowClass={isLight ? 'shadow-light' : 'shadow-dark'}
/>
);
}
@@ -452,13 +391,14 @@ function OverlayItem(props) {
title={title}
>
{label ? <span className="mr-1 shrink-0">{label}</span> : null}
<span className="ml-1 mr-2 shrink-0">{value}</span>
<span className="ml-0 mr-2 shrink-0">{value}</span>
</div>
);
}
/**
* Window Level / Center Overlay item
* //
*/
function VOIOverlayItem({ voi, customization }: OverlayItemProps) {
const { windowWidth, windowCenter } = voi;
@@ -471,10 +411,10 @@ function VOIOverlayItem({ voi, customization }: OverlayItemProps) {
className="overlay-item flex flex-row"
style={{ color: customization?.color }}
>
<span className="mr-1 shrink-0">W:</span>
<span className="ml-1 mr-2 shrink-0">{windowWidth.toFixed(0)}</span>
<span className="mr-1 shrink-0">L:</span>
<span className="ml-1 shrink-0">{windowCenter.toFixed(0)}</span>
<span className="mr-0.5 shrink-0 opacity-[0.70]">W:</span>
<span className="mr-2.5 shrink-0">{windowWidth.toFixed(0)}</span>
<span className="mr-0.5 shrink-0 opacity-[0.70]">L:</span>
<span className="shrink-0">{windowCenter.toFixed(0)}</span>
</div>
);
}
@@ -488,7 +428,7 @@ function ZoomOverlayItem({ scale, customization }: OverlayItemProps) {
className="overlay-item flex flex-row"
style={{ color: (customization && customization.color) || undefined }}
>
<span className="mr-1 shrink-0">Zoom:</span>
<span className="mr-0.5 shrink-0 opacity-[0.70]">Zoom:</span>
<span>{scale.toFixed(2)}x</span>
</div>
);
@@ -512,7 +452,7 @@ function InstanceNumberOverlayItem({
<span>
{instanceNumber !== undefined && instanceNumber !== null ? (
<>
<span className="mr-1 shrink-0">I:</span>
<span className="mr-0.5 shrink-0 opacity-[0.70]">I:</span>
<span>{`${instanceNumber} (${imageIndex + 1}/${numberOfSlices})`}</span>
</>
) : (
@@ -531,4 +471,4 @@ CustomizableViewportOverlay.propTypes = {
export default CustomizableViewportOverlay;
export { CustomizableViewportOverlay, CornerstoneOverlay };
export { CustomizableViewportOverlay };
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { Enums, VolumeViewport3D, utilities as csUtils } from '@cornerstonejs/core';
import { ImageScrollbar } from '@ohif/ui';
import { ImageScrollbar } from '@ohif/ui-next';
function CornerstoneImageScrollbar({
viewportData,
@@ -44,13 +44,17 @@ function CornerstoneImageScrollbar({
return;
}
const imageIndex = viewport.getCurrentImageIdIndex();
const numberOfSlices = viewport.getNumberOfSlices();
try {
const imageIndex = viewport.getCurrentImageIdIndex();
const numberOfSlices = viewport.getNumberOfSlices();
setImageSliceData({
imageIndex: imageIndex,
numberOfSlices,
});
setImageSliceData({
imageIndex: imageIndex,
numberOfSlices,
});
} catch (error) {
console.warn(error);
}
}, [viewportId, viewportData]);
useEffect(() => {
@@ -59,7 +63,7 @@ function CornerstoneImageScrollbar({
}
const { viewportType } = viewportData;
const eventId =
(viewportType === Enums.ViewportType.STACK && Enums.Events.STACK_VIEWPORT_SCROLL) ||
(viewportType === Enums.ViewportType.STACK && Enums.Events.STACK_NEW_IMAGE) ||
(viewportType === Enums.ViewportType.ORTHOGRAPHIC && Enums.Events.VOLUME_NEW_IMAGE) ||
Enums.Events.IMAGE_RENDERED;
@@ -68,11 +72,11 @@ function CornerstoneImageScrollbar({
if (!viewport || viewport instanceof VolumeViewport3D) {
return;
}
const { imageIndex, newImageIdIndex = imageIndex } = event.detail;
const { imageIndex, newImageIdIndex = imageIndex, imageIdIndex } = event.detail;
const numberOfSlices = viewport.getNumberOfSlices();
// find the index of imageId in the imageIds
setImageSliceData({
imageIndex: newImageIdIndex,
imageIndex: newImageIdIndex ?? imageIdIndex,
numberOfSlices,
});
};
@@ -3,27 +3,30 @@
--marker-height: 100px;
--scrollbar-width: 20px;
pointer-events: none;
font-size: 15px;
line-height: 18px;
}
.ViewportOrientationMarkers .orientation-marker {
position: absolute;
}
.ViewportOrientationMarkers .top-mid {
top: 0.6rem;
top: 0.38rem;
left: 50%;
transform: translateX(-50%);
}
.ViewportOrientationMarkers .left-mid {
top: 47%;
left: 5px;
top: 50%;
left: 0.38rem;
transform: translateY(-50%);
}
.ViewportOrientationMarkers .right-mid {
top: 47%;
top: 50%;
left: calc(100% - var(--marker-width) - var(--scrollbar-width));
transform: translateY(-50%);
}
.ViewportOrientationMarkers .bottom-mid {
top: calc(100% - var(--marker-height) - 0.6rem);
left: 47%;
left: 50%;
transform: translateX(-50%);
}
.ViewportOrientationMarkers .right-mid .orientation-marker-value {
display: flex;
@@ -1,11 +1,17 @@
import React, { useEffect, useState, useMemo } from 'react';
import React, { useEffect, useState, useMemo, useRef } from 'react';
import classNames from 'classnames';
import { metaData, Enums, Types, getEnabledElement } from '@cornerstonejs/core';
import {
metaData,
Enums,
Types,
getEnabledElement,
utilities as coreUtilities,
} from '@cornerstonejs/core';
import { utilities } from '@cornerstonejs/tools';
import { vec3 } from 'gl-matrix';
import './ViewportOrientationMarkers.css';
import { useViewportRendering } from '../../hooks';
const { getOrientationStringLPS, invertOrientationStringLPS } = utilities.orientation;
function ViewportOrientationMarkers({
@@ -20,8 +26,34 @@ function ViewportOrientationMarkers({
const [rotation, setRotation] = useState(0);
const [flipHorizontal, setFlipHorizontal] = useState(false);
const [flipVertical, setFlipVertical] = useState(false);
const { isViewportBackgroundLight: isLight } = useViewportRendering(viewportId);
const { cornerstoneViewportService } = servicesManager.services;
// Store initial viewUp and viewRight for volume viewports
const initialVolumeOrientationRef = useRef<{
initialViewUp: number[] | null;
initialViewRight: number[] | null;
}>({
initialViewUp: null,
initialViewRight: null,
});
useEffect(() => {
initialVolumeOrientationRef.current.initialViewUp = null;
initialVolumeOrientationRef.current.initialViewRight = null;
if (viewportData?.viewportType !== 'stack' && element && getEnabledElement(element)) {
const { viewport } = getEnabledElement(element);
const { viewUp, viewPlaneNormal } = viewport.getCamera();
const viewRight = vec3.create();
vec3.cross(viewRight, viewUp, viewPlaneNormal);
initialVolumeOrientationRef.current.initialViewUp = [...viewUp];
initialVolumeOrientationRef.current.initialViewRight = [...viewRight];
}
}, [element, viewportData]);
useEffect(() => {
const cameraModifiedListener = (evt: Types.EventTypes.CameraModifiedEvent) => {
const { previousCamera, camera } = evt.detail;
@@ -79,14 +111,21 @@ function ViewportOrientationMarkers({
return '';
}
const { viewport } = getEnabledElement(element);
const { viewUp, viewPlaneNormal } = viewport.getCamera();
const viewRight = vec3.create();
vec3.cross(viewRight, viewUp, viewPlaneNormal);
columnCosines = [-viewUp[0], -viewUp[1], -viewUp[2]];
rowCosines = viewRight;
if (
initialVolumeOrientationRef.current.initialViewUp &&
initialVolumeOrientationRef.current.initialViewRight
) {
// Use initial orientation values for consistency, even as the camera changes
columnCosines = [
-initialVolumeOrientationRef.current.initialViewUp[0],
-initialVolumeOrientationRef.current.initialViewUp[1],
-initialVolumeOrientationRef.current.initialViewUp[2],
];
rowCosines = initialVolumeOrientationRef.current.initialViewRight;
} else {
console.warn('ViewportOrientationMarkers::No initial orientation values');
return '';
}
}
if (
@@ -119,8 +158,9 @@ function ViewportOrientationMarkers({
className={classNames(
'overlay-text',
`${m}-mid orientation-marker`,
'text-aqua-pale',
'text-[13px]',
isLight ? 'text-neutral-dark/70' : 'text-neutral-light/70',
isLight ? 'shadow-light' : 'shadow-dark',
'text-base',
'leading-5'
)}
key={`${m}-mid orientation-marker`}
@@ -136,6 +176,7 @@ function ViewportOrientationMarkers({
flipHorizontal,
orientationMarkers,
element,
isLight,
]);
return <div className="ViewportOrientationMarkers select-none">{markers}</div>;
@@ -157,6 +198,9 @@ function _getOrientationMarkers(rowCosines, columnCosines, rotation, flipVertica
const oppositeRowString = invertOrientationStringLPS(rowString);
const oppositeColumnString = invertOrientationStringLPS(columnString);
// Round to 4 decimal places (after rotate right 3 times and flip horizontally -> rotation is 90.00000000000001)
rotation = Math.round(rotation * 10000) / 10000;
const markers = {
top: oppositeColumnString,
left: oppositeRowString,
@@ -52,31 +52,6 @@ export function formatDICOMTime(time, strFormat = 'HH:mm:ss') {
return moment(time, 'HH:mm:ss').format(strFormat);
}
/**
* Formats a patient name for display purposes
*
* @param {string} name
* @returns {string} formatted name.
*/
export function formatPN(name) {
if (!name) {
return '';
}
if (typeof name === 'object') {
name = name.Alphabetic;
if (!name) {
return '';
}
}
const cleaned = name
.split('^')
.filter(s => !!s)
.join(', ')
.trim();
return cleaned === ',' || cleaned === '' ? '' : cleaned;
}
/**
* Gets compression type
*
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,195 @@
import React from 'react';
import { useSystem } from '@ohif/core';
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@ohif/ui-next';
import { ChevronDownIcon } from '@radix-ui/react-icons';
export type AccordionGrouping = {
[name: string]: unknown;
};
export type AccordionGroupProps = {
grouping: AccordionGrouping;
};
/**
* Searches for the required type from the provided allChildren list and
* renders them.
*/
export const CloneChildren = props => {
const { group, allChildren, children, childType, defaultTypes } = props;
const subType = group?.subType;
for (const child of allChildren) {
if (subType && child.props?.subType !== subType) {
continue;
}
if (childType && child.type === childType) {
return React.cloneElement(child, { ...props, children: child.props.children });
}
if (defaultTypes?.indexOf(child.type) === -1) {
return childType({ ...props, children: child });
}
}
if (!children) {
throw new Error(`No children defined for ${props.name} CloneChildren in group ${group?.name}`);
}
return React.cloneElement(children, props);
};
/** Used to exclude defaults */
const DEFAULT_TYPES = [GroupAccordion, Content, Trigger];
/**
* An AccordionGroup is a component that splits a set of items into different
* groups according to a set of grouping rules. It then puts the groups
* into a set of accordion folds selected from the body of the accordion group,
* looking for matching trigger/content sections according to the type definition
* in the group with first one found being used.
*
* This design allows for easy customization of the component by declaring grouping
* functions with default grouping setups and then only overriding the specific
* children needing to be changed. See the PanelMeasurement for some example
* possibilities of how to modify the default grouping, or the test-extension
* measurements panel for a practical, working example.
*/
export function AccordionGroup(props) {
const { grouping, items, children, sourceChildren, type } = props;
const childProps = useSystem();
let defaultValue = props.defaultValue;
const groups = grouping.groupingFunction(items, grouping, childProps);
if (!defaultValue) {
const defaultGroup = groups.values().find(group => group.isSelected);
defaultValue = defaultGroup?.key || defaultGroup?.title;
}
const valueArr =
(Array.isArray(defaultValue) && defaultValue) || (defaultValue && [defaultValue]) || [];
const sourceChildrenArr = sourceChildren ? React.Children.toArray(sourceChildren) : [];
const childrenArr = children ? React.Children.toArray(children) : [];
const allChildren = sourceChildrenArr.concat(childrenArr);
return (
<CloneChildren
allChildren={allChildren}
groups={groups}
childType={GroupAccordion}
grouping={grouping}
defaultValue={valueArr}
name={'grouping ' + grouping.name}
>
<DefaultAccordion name="DefaultAccordion" />
</CloneChildren>
);
}
function DefaultAccordion(props) {
const { groups, defaultValue, grouping, allChildren, asChild } = props;
if (!allChildren || !groups) {
return null;
}
if (Boolean(asChild)) {
return React.cloneElement(props.children, props);
}
return (
<Accordion
type={grouping.type || 'multiple'}
className="text-white"
defaultValue={defaultValue}
>
{[...groups.entries()].map(([key, group]) => {
return (
<AccordionItem
key={group.key + '-i'}
value={group.key}
>
<CloneChildren
allChildren={allChildren}
group={group}
childType={Trigger}
name="AccordionGroup.Trigger"
/>
<CloneChildren
allChildren={allChildren}
group={group}
childType={Content}
defaultTypes={DEFAULT_TYPES}
name="AccordionGroup.Content"
/>
</AccordionItem>
);
})}
</Accordion>
);
}
function GroupAccordion(props) {
const { groups, children } = props;
if (!groups) {
return null;
}
return [...groups.values()].map(group =>
React.cloneElement(children, {
...props,
children: children.props.children,
group,
...group,
key: group.title,
})
);
}
function Content(props) {
const { children, asChild, ...childProps } = props;
const { group } = props;
Object.assign(childProps, group);
if (!group) {
return null;
}
if (asChild) {
return React.cloneElement(children, { ...group, ...props, children: children.props.children });
}
return (
<AccordionContent>
{React.cloneElement(children, { ...group, ...props, children: children.props.children })}
</AccordionContent>
);
}
function Trigger(props) {
const { children, asChild, ...childProps } = props;
const { group } = props;
Object.assign(childProps, group);
if (!group) {
return null;
}
if (asChild) {
return React.cloneElement(children, childProps);
}
return (
<AccordionTrigger
value={group.value}
asChild={true}
>
<div>
{React.cloneElement(children, childProps)}
<ChevronDownIcon
key="chevronDown"
className="text-primary h-4 w-4 shrink-0 transition-transform duration-200"
/>
</div>
</AccordionTrigger>
);
}
AccordionGroup.Content = Content;
AccordionGroup.Trigger = Trigger;
AccordionGroup.Accordion = GroupAccordion;
export default AccordionGroup;
@@ -0,0 +1,4 @@
export * from './AccordionGroup';
import AccordionGroup from './AccordionGroup';
export default AccordionGroup;
@@ -1,6 +1,6 @@
import React, { ReactElement } from 'react';
import PropTypes from 'prop-types';
import { useViewportGrid } from '@ohif/ui';
import { useViewportGrid } from '@ohif/ui-next';
import ViewportWindowLevel from '../ViewportWindowLevel/ViewportWindowLevel';
const ActiveViewportWindowLevel = ({ servicesManager }: withAppTypes): ReactElement => {
@@ -0,0 +1,149 @@
import { useToolbar, useViewportMousePosition } from '@ohif/core/src/hooks';
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useViewportRendering } from '../../hooks';
import { ButtonLocation } from '@ohif/core/src/services/ToolBarService/ToolbarService';
import classNames from 'classnames';
const mouseNearControlsRanges = {
[ButtonLocation.TopMiddle]: { minX: 0, minY: 0, maxX: 1, maxY: 0.1 },
[ButtonLocation.BottomMiddle]: { minX: 0, minY: 0.9, maxX: 1, maxY: 1 },
[ButtonLocation.LeftMiddle]: { minX: 0, minY: 0, maxX: 0.1, maxY: 1 },
[ButtonLocation.RightMiddle]: { minX: 0.9, minY: 0, maxX: 1, maxY: 1 },
};
const getFlexDirectionClassName = (location: ButtonLocation) =>
location === ButtonLocation.LeftMiddle || location === ButtonLocation.RightMiddle
? 'flex-col'
: 'flex-row';
function AdvancedRenderingControls({
viewportId,
location,
buttonSection,
}: {
viewportId: string;
location: number;
buttonSection: string;
}) {
const {
onInteraction,
toolbarButtons,
isItemOpen,
isItemLocked,
openItem,
closeItem,
toggleLock,
} = useToolbar({
buttonSection,
});
const mousePosition = useViewportMousePosition(viewportId);
const [isMouseNearControls, setIsMouseNearControls] = useState(false);
const [showAllIcons, setShowAllIcons] = useState(true);
const firstMountRef = useRef(true);
const { hasColorbar } = useViewportRendering(viewportId);
const [isAnItemOpen, setIsAnItemOpen] = useState(false);
useEffect(() => {
if (firstMountRef.current) {
firstMountRef.current = false;
const timer = setTimeout(() => {
setShowAllIcons(false);
}, 3000);
return () => clearTimeout(timer);
}
}, []);
useEffect(() => {
if (!showAllIcons && mousePosition.isInViewport) {
const mouseHoverLocation = mouseNearControlsRanges[location];
if (mousePosition.isWithinNormalizedBox(mouseHoverLocation)) {
setIsMouseNearControls(true);
} else {
setIsMouseNearControls(false);
}
}
}, [location, mousePosition, showAllIcons]);
const handleOnItemOpen = useCallback(
(id, viewportId) => {
openItem(id, viewportId);
setIsAnItemOpen(true);
},
[openItem, setIsAnItemOpen]
);
const handleOnItemClose = useCallback(
(id, viewportId) => {
closeItem(id, viewportId);
setIsAnItemOpen(false);
},
[closeItem, setIsAnItemOpen]
);
if (!toolbarButtons?.length) {
return null;
}
if (!hasColorbar) {
return null;
}
return (
<div className={classNames('flex gap-2', getFlexDirectionClassName(location))}>
{toolbarButtons.map(toolDef => {
if (!toolDef) {
return null;
}
const { id, Component, componentProps } = toolDef;
// Enhanced props with state and actions - respecting viewport specificity
const enhancedProps = {
...componentProps,
isOpen: isItemOpen(id, viewportId),
isLocked: isItemLocked(id, viewportId),
onOpen: () => handleOnItemOpen(id, viewportId),
onClose: () => handleOnItemClose(id, viewportId),
onToggleLock: () => toggleLock(id, viewportId),
viewportId,
};
const tool = (
<Component
key={id}
id={id}
location={location}
onInteraction={args => {
onInteraction({
...args,
itemId: id,
viewportId,
});
}}
{...enhancedProps}
/>
);
// Always show all icons on first mount for 3 seconds
// After that, always show Colorbar, show others only when mouse is at bottom
const shouldBeVisible =
isAnItemOpen || showAllIcons || id === 'Colorbar' || isMouseNearControls;
return (
<div
key={id}
className={shouldBeVisible ? 'opacity-100' : 'pointer-events-none opacity-0'}
style={{ transition: 'opacity 0.2s ease-in-out' }}
>
{tool}
</div>
);
})}
</div>
);
}
export default AdvancedRenderingControls;
@@ -0,0 +1 @@
export { default } from './AdvancedRenderingControls';
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState, useRef } from 'react';
import { CinePlayer, useCine } from '@ohif/ui';
import { useCine } from '@ohif/ui-next';
import { Enums, eventTarget, cache } from '@cornerstonejs/core';
import { useAppConfig } from '@state';
@@ -53,13 +53,13 @@ function WrappedCinePlayer({
// check if the displaySet is dynamic and set the dynamic info
if (displaySet.isDynamicVolume) {
const { dynamicVolumeInfo } = displaySet;
const numTimePoints = dynamicVolumeInfo.timePoints.length;
const numDimensionGroups = dynamicVolumeInfo.timePoints.length;
const label = dynamicVolumeInfo.splittingTag;
const timePointIndex = dynamicVolumeInfo.timePointIndex || 0;
const dimensionGroupNumber = dynamicVolumeInfo.dimensionGroupNumber || 1;
setDynamicInfo({
volumeId: displaySet.displaySetInstanceUID,
timePointIndex,
numTimePoints,
dimensionGroupNumber,
numDimensionGroups,
label,
});
} else {
@@ -160,8 +160,7 @@ function RenderCinePlayer({
dynamicInfo: dynamicInfoProp,
customizationService,
}) {
const { component: CinePlayerComponent = CinePlayer } =
customizationService.get('cinePlayer') ?? {};
const CinePlayerComponent = customizationService.getCustomization('cinePlayer');
const [dynamicInfo, setDynamicInfo] = useState(dynamicInfoProp);
@@ -177,20 +176,20 @@ function RenderCinePlayer({
return;
}
const handleTimePointIndexChange = evt => {
const { volumeId, timePointIndex, numTimePoints, splittingTag } = evt.detail;
setDynamicInfo({ volumeId, timePointIndex, numTimePoints, label: splittingTag });
const handleDimensionGroupChange = evt => {
const { volumeId, dimensionGroupNumber, numDimensionGroups, splittingTag } = evt.detail;
setDynamicInfo({ volumeId, dimensionGroupNumber, numDimensionGroups, label: splittingTag });
};
eventTarget.addEventListener(
Enums.Events.DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED,
handleTimePointIndexChange
Enums.Events.DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED,
handleDimensionGroupChange
);
return () => {
eventTarget.removeEventListener(
Enums.Events.DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED,
handleTimePointIndexChange
Enums.Events.DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED,
handleDimensionGroupChange
);
};
}, [dynamicInfo]);
@@ -200,17 +199,17 @@ function RenderCinePlayer({
return;
}
const { volumeId, timePointIndex, numTimePoints, splittingTag } = dynamicInfo || {};
const { volumeId, dimensionGroupNumber, numDimensionGroups, splittingTag } = dynamicInfo || {};
const volume = cache.getVolume(volumeId, true);
volume.timePointIndex = timePointIndex;
volume.dimensionGroupNumber = dimensionGroupNumber;
setDynamicInfo({ volumeId, timePointIndex, numTimePoints, label: splittingTag });
setDynamicInfo({ volumeId, dimensionGroupNumber, numDimensionGroups, label: splittingTag });
}, []);
const updateDynamicInfo = useCallback(props => {
const { volumeId, timePointIndex } = props;
const { volumeId, dimensionGroupNumber } = props;
const volume = cache.getVolume(volumeId, true);
volume.timePointIndex = timePointIndex;
volume.dimensionGroupNumber = dimensionGroupNumber;
}, []);
return (
@@ -245,4 +244,4 @@ function RenderCinePlayer({
);
}
export default WrappedCinePlayer;
export default WrappedCinePlayer;
@@ -1,6 +1,8 @@
import React, { useCallback, useEffect, useRef, useState, ReactElement } from 'react';
import PropTypes from 'prop-types';
import { Button, Icon, ProgressLoadingBar } from '@ohif/ui';
import { useSystem } from '@ohif/core';
import { Button } from '@ohif/ui';
import { Icons } from '@ohif/ui-next';
import DicomFileUploader, {
EVENTS,
UploadStatus,
@@ -39,6 +41,11 @@ function DicomUploadProgress({
dicomFileUploaderArr,
onComplete,
}: DicomUploadProgressProps): ReactElement {
const { servicesManager } = useSystem();
const ProgressLoadingBar =
servicesManager.services.customizationService.getCustomization('ui.progressLoadingBar');
const [totalUploadSize] = useState(
dicomFileUploaderArr.reduce((acc, fileUploader) => acc + fileUploader.getFileSize(), 0)
);
@@ -252,22 +259,24 @@ function DicomUploadProgress({
}, [getPercentCompleteRounded, percentComplete]);
/**
* Gets the css style for the 'n of m' (files completed) text. The only css attribute
* of the style is width such that the 'n of m' is always a fixed width and thus
* as each file completes uploading the text on screen does not constantly shift
* left and right.
* Gets the CSS style for the 'n of m' (files completed) text.
* The width changes according to numFilesCompleted and can vary,
* e.g. "1 of 200", "10 of 200", "100 of 200" all have differents width.
*/
const getNofMFilesStyle = useCallback(() => {
// the number of digits accounts for the digits being on each side of the ' of '
const numDigits = 2 * dicomFileUploaderArr.length.toString().length;
// the number of digits + 2 spaces and 2 characters for ' of '
const numChars = numDigits + 4;
const numDigits =
numFilesCompleted.toString().length + dicomFileUploaderArr.length.toString().length;
// The number of digits + 3 additional characters (accounts for ' of ').
// Even though intuitively 4 should be better, this is the most accurate width.
// The font may play a part in this discrepancy.
const numChars = numDigits + 3;
return { width: `${numChars}ch` };
}, []);
}, [numFilesCompleted]);
const getNumCompletedAndTimeRemainingComponent = (): ReactElement => {
return (
<div className="bg-primary-dark flex h-14 items-center px-1 pb-4 text-lg">
<div className="bg-primary-dark flex h-14 items-center px-1 pb-4 text-lg text-white">
{numFilesCompleted === dicomFileUploaderArr.length ? (
<>
<span className={NO_WRAP_ELLIPSIS_CLASS_NAMES}>{`${dicomFileUploaderArr.length} ${
@@ -283,21 +292,24 @@ function DicomUploadProgress({
</>
) : (
<>
<div className="flex flex-wrap">
<span
style={getNofMFilesStyle()}
className={classNames(NO_WRAP_ELLIPSIS_CLASS_NAMES, 'text-right')}
>
{`${numFilesCompleted} of ${dicomFileUploaderArr.length}`}&nbsp;
</span>
<span className={NO_WRAP_ELLIPSIS_CLASS_NAMES}>{' files completed.'}</span>
<br />
<span>
{timeRemaining ? `Less than ${getFormattedTimeRemaining()} remaining. ` : ''}
</span>
</div>
<span
style={getNofMFilesStyle()}
className={classNames(NO_WRAP_ELLIPSIS_CLASS_NAMES, 'text-end')}
>
{`${numFilesCompleted} of ${dicomFileUploaderArr.length}`}&nbsp;
</span>
<span className={NO_WRAP_ELLIPSIS_CLASS_NAMES}>{' files completed.'}&nbsp;</span>
<span className={NO_WRAP_ELLIPSIS_CLASS_NAMES}>
{timeRemaining ? `Less than ${getFormattedTimeRemaining()} remaining. ` : ''}
</span>
<span
className={classNames(
NO_WRAP_ELLIPSIS_CLASS_NAMES,
'text-primary-active hover:text-primary-light active:text-aqua-pale ml-auto cursor-pointer'
)}
className={
'text-primary hover:text-primary-lightactive:text-aqua-pale ml-auto cursor-pointer whitespace-nowrap'
}
onClick={cancelAllUploads}
>
Cancel All Uploads
@@ -313,10 +325,10 @@ function DicomUploadProgress({
<div className="ml-auto flex w-6 justify-center">
{numFails > 0 && (
<div onClick={() => setShowFailedOnly(currentShowFailedOnly => !currentShowFailedOnly)}>
<Icon
<Icons.ByName
className="cursor-pointer"
name="icon-status-alert"
></Icon>
></Icons.ByName>
</div>
)}
</div>
@@ -347,7 +359,7 @@ function DicomUploadProgress({
></ProgressLoadingBar>
</div>
<div className="ml-1 flex w-24 items-center">
<div className="w-10 text-right">{`${getPercentCompleteRounded()}%`}</div>
<div className="w-10 text-right text-foreground">{`${getPercentCompleteRounded()}%`}</div>
{getShowFailedOnlyIconComponent()}
</div>
</>
@@ -6,7 +6,7 @@ import DicomFileUploader, {
UploadRejection,
UploadStatus,
} from '../../utils/DicomFileUploader';
import { Icon } from '@ohif/ui';
import { Icons } from '@ohif/ui-next';
type DicomUploadProgressItemProps = {
dicomFileUploader: DicomFileUploader;
@@ -54,17 +54,17 @@ const DicomUploadProgressItem = memo(
switch (dicomFileUploader.getStatus()) {
case UploadStatus.Success:
return (
<Icon
<Icons.ByName
name="status-tracked"
className="text-primary-light"
></Icon>
/>
);
case UploadStatus.InProgress:
return <Icon name="icon-transferring"></Icon>;
return <Icons.ByName name="icon-transferring" />;
case UploadStatus.Failed:
return <Icon name="icon-alert-small"></Icon>;
return <Icons.ByName name="icon-alert-small" />;
case UploadStatus.Cancelled:
return <Icon name="icon-alert-outline"></Icon>;
return <Icons.ByName name="icon-alert-outline" />;
default:
return <></>;
}
@@ -75,7 +75,7 @@ const DicomUploadProgressItem = memo(
<div className="self-top flex w-0 shrink grow flex-col gap-1">
<div className="flex gap-4">
<div className="flex w-6 shrink-0 items-center justify-center">{getStatusIcon()}</div>
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
<div className="overflow-hidden text-ellipsis whitespace-nowrap text-white">
{dicomFileUploader.getFileName()}
</div>
</div>
@@ -88,9 +88,8 @@ const DicomUploadProgressItem = memo(
<div className="w-10 text-right">{percentComplete}%</div>
)}
<div className="ml-auto flex cursor-pointer">
<Icon
className="text-primary-active self-center"
name="close"
<Icons.Close
className="text-primary self-center"
onClick={cancelUpload}
/>
</div>
@@ -0,0 +1,70 @@
import React from 'react';
import { Accordion, AccordionContent, AccordionItem } from '@ohif/ui-next';
import PanelAccordionTrigger from './PanelAccordionTrigger';
import MeasurementsMenu from './MeasurementsMenu';
import { useSystem } from '@ohif/core';
export function MeasurementItem(props) {
const { index, item } = props;
return (
<PanelAccordionTrigger
count={index + 1}
text={item.toolName || item.label || item.title}
colorHex="#f00"
isActive={item.isSelected}
menu={MeasurementsMenu}
group={{ items: [item], onClick: props.onClick }}
/>
);
}
export default function MeasurementAccordion(props) {
const { items } = props;
const system = useSystem();
const onClick = (e, group) => {
const { items } = group;
// Just jump to the first measurement in the set, and mark that one as active
// with the set of items.
system.commandsManager.run('jumpToMeasurement', {
uid: items[0].uid,
displayMeasurements: items,
group,
});
};
return (
<Accordion
type="multiple"
className="flex-shrink-0 overflow-hidden"
>
{items.map((item, index) => {
const { displayText: details = {} } = item;
return (
<AccordionItem
key={`measurementAccordion:${item.uid}`}
value={item.uid}
>
<MeasurementItem
item={item}
key={`measurementItem:${item.uid}`}
index={index}
onClick={onClick}
/>
<AccordionContent key={`measurementContent:${item.uid}`}>
<div className="ml-7 px-2 py-2">
<div className="text-secondary-foreground flex items-center gap-1 text-base leading-normal">
{details.primary?.length > 0 &&
details.primary.map((detail, index) => (
<span key={`details:${item.uid}:${index}`}>{detail}</span>
))}
</div>
</div>
</AccordionContent>
</AccordionItem>
);
})}
</Accordion>
);
}
@@ -0,0 +1,30 @@
import React from 'react';
import { MeasurementTable } from '@ohif/ui-next';
import { useSystem } from '@ohif/core';
/**
* This is a measurement table that is designed to be nested inside
* the accordion groups.
*/
export default function MeasurementTableNested(props) {
const { title, items, group, customHeader } = props;
const { commandsManager } = useSystem();
const onAction = (e, command, uid) => {
commandsManager.run(command, { uid, annotationUID: uid, displayMeasurements: items });
};
return (
<MeasurementTable
title={title ? title : `Measurements`}
data={items}
onAction={onAction}
{...group}
key={group.key}
>
<MeasurementTable.Header key="measurementTableHeader">
{customHeader && group.isFirst && customHeader({ ...props, items: props.allItems })}
</MeasurementTable.Header>
<MeasurementTable.Body key="measurementTableBody" />
</MeasurementTable>
);
}
Loaded 100 of 2822 files, more files were not shown because too many files have changed in this diff. Show more