You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,15 +31,17 @@ The app is built using [craco](https://github.com/gsoft-inc/craco) (with the [cr
31
31
32
32
Tests are written and run using the [jest](https://jestjs.io/) framework.
33
33
34
-
The [yarn](https://yarnpkg.com/) package manager is used to manage dependencies and run scripts specified in `package.json` (`build`, `lint`, `test`, etc.).
34
+
The [Bun](https://bun.sh/) runtime and package manager is used to manage dependencies and run scripts specified in `package.json` (`build`, `lint`, `test`, etc.).
35
35
36
36
## Coding style
37
37
38
-
Source code is linted using [ts-standard](https://github.com/standard/ts-standard) (based on [eslint](https://eslint.org/)) and TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled.
38
+
Source code is linted and formatted using [Biome](https://biomejs.dev/). TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled. Semicolons are not used at the end of statements (Biome uses `asNeeded`).
39
39
40
-
Use the following command to identify potential coding style and type annotation violations:
40
+
Use the following commands to check and fix style:
Copy file name to clipboardExpand all lines: README.md
+46-13Lines changed: 46 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ It relies on [DICOMweb](https://www.dicomstandard.org/dicomweb/) RESTful service
16
16
-[Display of images](#display-of-images)
17
17
-[Display of image annotations and analysis results](#display-of-image-annotations-and-analysis-results)
18
18
-[Annotation of images](#annotation-of-images)
19
+
-[Memory Monitoring](#memory-monitoring)
19
20
-[Authentication and Authorization](#autentication-and-authorization)
20
21
-[Configuration](#configuration)
21
22
-[Server Configuration](#server-configuration)
@@ -105,6 +106,22 @@ ROIs are stored as 3D spatial coordinates (SCOORD3D) in millimeter unit accordin
105
106
Specifically, [Image Region](http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_A.html#para_b68aa0a9-d0b1-475c-9630-fbbd48dc581d) is used to store the vector graphic data and [Finding](http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_A.html#para_c4ac1cac-ee86-4a86-865a-8137ebe1bd95) is used to describe what has been annotated using a standard medical terminology such as [SNOMED CT](https://www.snomed.org/).
106
107
The terms that can be chosen by a user can be configured (see [AppConfig.d.ts](src/AppConfig.d.ts)).
107
108
109
+
### Memory Monitoring
110
+
111
+
_Slim_ includes automatic memory monitoring to help track browser memory usage when viewing large whole slide images. The memory monitor:
112
+
113
+
- Displays real-time memory usage in the footer (used memory, heap limit, usage percentage, remaining memory)
114
+
- Automatically monitors memory every 5 seconds using modern browser APIs when available
115
+
- Shows color-coded status indicators (green/orange/red) based on usage levels
116
+
- Issues warnings when memory usage exceeds 80% (high) or 90% (critical)
117
+
- Falls back to Chrome-specific APIs when modern APIs aren't available
118
+
119
+
The memory footer appears at the bottom of all pages and updates automatically. When memory usage is high, users receive notifications with recommendations to refresh the page or close other tabs.
120
+
121
+
Memory monitoring is enabled by default and can be disabled via configuration by setting `enableMemoryMonitoring: false` in the application config.
122
+
123
+
For technical details, see [Memory Monitoring Documentation](docs/MEMORY_MONITORING.md).
124
+
108
125
## Autentication and authorization
109
126
110
127
Users can authenticate and authorize the application to access data via [OpenID Connect (OIDC)](https://openid.net/connect/) based on the [OAuth 2.0](https://oauth.net/2/) protocol using either the [authorization code grant type](https://oauth.net/2/grant-types/authorization-code/) (with [Proof Key for Code Exchange (PKCE)](https://oauth.net/2/pkce/) extension) or the legacy [implicit grant type](https://oauth.net/2/grant-types/implicit/).
@@ -198,13 +215,29 @@ Default values if not specified:
198
215
-`duration`: 5 seconds
199
216
-`top`: 100 pixels
200
217
218
+
### Memory Monitoring Configuration
219
+
220
+
Memory monitoring can be enabled or disabled through configuration:
221
+
222
+
```javascript
223
+
window.config= {
224
+
// ... other config options ...
225
+
enableMemoryMonitoring:false, // Set to false to disable memory monitoring footer
226
+
};
227
+
```
228
+
229
+
-**Default**: Memory monitoring is enabled (`enableMemoryMonitoring: true` or undefined)
230
+
-**Disable**: Set `enableMemoryMonitoring: false` to hide the memory footer and stop monitoring
231
+
232
+
When enabled, the memory footer appears at the bottom of all pages and monitors memory usage every 5 seconds.
233
+
201
234
## Deployment
202
235
203
236
Download the latest release from [github.com/imagingdatacommons/slim/releases](https://github.com/imagingdatacommons/slim/releases) and then run the following commands to install build dependencies and build the app:
204
237
205
238
```none
206
-
yarn install
207
-
PUBLIC_URL=/ yarn build
239
+
bun install
240
+
PUBLIC_URL=/ bun run build
208
241
```
209
242
210
243
Once the app has been built, the content of the `build` folder can be directly served by a static web server at the location specified by `PUBLIC_URL` (in this case at `/`).
@@ -341,57 +374,57 @@ For the time being, the legacy implicit grand type has to be used.
341
374
To install requirements and run the app for local development, run the following commands:
342
375
343
376
```none
344
-
yarn install
345
-
yarn start
377
+
bun install
378
+
bun run start
346
379
```
347
380
348
381
This will serve the app via a development server at [http://localhost:3000](http://localhost:3000) using the default `local` configuration.
349
382
350
383
The configuration can be specified using the `REACT_APP_CONFIG` environment variable, which can be set either in the `.env` file or directly in the command line:
351
384
352
385
```none
353
-
REACT_APP_CONFIG=local yarn start
386
+
REACT_APP_CONFIG=local bun run start
354
387
```
355
388
356
389
## Linking Slim to a Local dicom-microscopy-viewer Library
357
390
358
-
If you are developing features or fixing bugs that require changes in both Slim and the underlying [`dicom-microscopy-viewer`](https://github.com/ImagingDataCommons/dicom-microscopy-viewer) library, you can use `yarn link` to connect your local Slim project to a local clone of `dicom-microscopy-viewer`. This allows Slim to immediately use the latest local changes from the library without publishing to npm.
391
+
If you are developing features or fixing bugs that require changes in both Slim and the underlying [`dicom-microscopy-viewer`](https://github.com/ImagingDataCommons/dicom-microscopy-viewer) library, you can use `bun link` to connect your local Slim project to a local clone of `dicom-microscopy-viewer`. This allows Slim to immediately use the latest local changes from the library without publishing to npm.
359
392
360
393
### Steps
361
394
362
395
1.**Clone dicom-microscopy-viewer**
363
396
If you haven't already, clone the `dicom-microscopy-viewer` repository to your machine.
364
397
365
-
2.**Set up yarn link in dicom-microscopy-viewer**
398
+
2.**Set up bun link in dicom-microscopy-viewer**
366
399
In the root directory of your local `dicom-microscopy-viewer` repository, run:
367
400
```sh
368
-
yarn link
401
+
bun link
369
402
```
370
403
371
404
3.**Link dicom-microscopy-viewer in Slim**
372
405
In the root directory of your Slim project, run:
373
406
```sh
374
-
yarn link dicom-microscopy-viewer
407
+
bun link dicom-microscopy-viewer
375
408
```
376
409
377
410
4.**Enable live rebuilding in dicom-microscopy-viewer**
378
411
To automatically rebuild `dicom-microscopy-viewer` when you make changes, run the following command in the `dicom-microscopy-viewer` directory:
379
412
```sh
380
-
yarn webpack:dynamic-import:watch
413
+
bun run webpack:dynamic-import:watch
381
414
```
382
415
This will watch for file changes and rebuild the library, so Slim can immediately use the updated code.
383
416
384
417
5.**Run Slim as usual**
385
418
In the Slim directory, start the development server:
386
419
```sh
387
-
yarn start
420
+
bun run start
388
421
```
389
422
Slim will now use your locally linked version of `dicom-microscopy-viewer`.
390
423
391
424
### Notes
392
425
393
-
- If you want to unlink and return to the npm-published version, run `yarn unlink dicom-microscopy-viewer` and `yarn install --force` in the Slim directory.
394
-
- Make sure both projects use compatible Node and Yarn versions to avoid dependency issues.
426
+
- If you want to unlink and return to the npm-published version, run `bun unlink dicom-microscopy-viewer` and `bun install` in the Slim directory.
427
+
- Make sure both projects use compatible Bun versions to avoid dependency issues.
0 commit comments