Skip to content

Commit

Permalink
Merge branch 'master' into fix/overview-thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
igoroctaviano authored Feb 25, 2025
2 parents 0f44db7 + 93c2985 commit d53974c
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 6 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,27 @@ For more information about the motivation, design, and capabilities of Slim, ple
If you use Slim in your research, please cite the above article.

## Acknowledgments

This software is maintained by the Imaging Data Commons (IDC) team, which has been funded in whole or
in part with Federal funds from the NCI, NIH, under task order no. HHSN26110071
under contract no. HHSN261201500003l.

NCI Imaging Data Commons (IDC) (https://imaging.datacommons.cancer.gov/) is a cloud-based environment
containing publicly available cancer imaging data co-located with analysis and exploration tools and resources.
IDC is a node within the broader NCI Cancer Research Data Commons (CRDC) infrastructure that provides secure
access to a large, comprehensive, and expanding collection of cancer research data.

Learn more about IDC from this publication:

> Fedorov, A., Longabaugh, W. J. R., Pot, D., Clunie, D. A., Pieper, S. D.,
> Gibbs, D. L., Bridge, C., Herrmann, M. D., Homeyer, A., Lewis, R., Aerts, H.
> J. W., Krishnaswamy, D., Thiriveedhi, V. K., Ciausu, C., Schacherer, D. P.,
> Bontempi, D., Pihl, T., Wagner, U., Farahani, K., Kim, E. & Kikinis, R.
> _National Cancer Institute Imaging Data Commons: Toward Transparency,
> Reproducibility, and Scalability in Imaging Artificial Intelligence_.
> RadioGraphics (2023). https://doi.org/10.1148/rg.230180
## DICOM Conformance Statement

The DICOM conformance statement for Slim is available in this repository [here](/DICOM-Conformance-Statement.md)
2 changes: 1 addition & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = {
'^.+\\.[t|j]sx?$': 'babel-jest'
}
config.transformIgnorePatterns = [
'node_modules/(?!(ol|dicom-microscopy-viewer|dicomweb-client|@cornerstonejs|dicomicc)/)'
'node_modules/(?!(ol|dicom-microscopy-viewer|dicomweb-client|@cornerstonejs|dicomicc|rbush|color-rgba|color-parse|color-name|color-space|quickselect|earcut)/)'
]
config.moduleNameMapper = {
'@cornerstonejs/codec-libjpeg-turbo-8bit/decodewasmjs': '@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode',
Expand Down
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [0.39.0](https://github.com/ImagingDataCommons/slim/compare/v0.38.0...v0.39.0) (2025-02-25)


### Features

* icc profiles toggle ([#269](https://github.com/ImagingDataCommons/slim/issues/269)) ([2320267](https://github.com/ImagingDataCommons/slim/commit/23202679246d8f2dbd8ac7b741d8d970e3cb3beb))

# [0.38.0](https://github.com/ImagingDataCommons/slim/compare/v0.37.0...v0.38.0) (2025-02-04)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slim",
"version": "0.38.0",
"version": "0.39.0",
"homepage": "https://github.com/imagingdatacommons/slim",
"private": true,
"author": "ImagingDataCommons",
Expand Down
28 changes: 27 additions & 1 deletion src/components/SlideViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { UndoOutlined, CheckOutlined, StopOutlined } from '@ant-design/icons'
import * as dmv from 'dicom-microscopy-viewer'
import * as dcmjs from 'dcmjs'
import * as dwc from 'dicomweb-client'
import type { CheckboxChangeEvent } from 'antd/es/checkbox'

import DicomWebManager from '../DicomWebManager'
import AnnotationList from './AnnotationList'
Expand Down Expand Up @@ -422,6 +423,7 @@ interface SlideViewerState {
}
}
loadingFrames: Set<string>
isICCProfilesEnabled: boolean
}

/**
Expand Down Expand Up @@ -582,6 +584,7 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
this.handleOpticalPathActivityChange = this.handleOpticalPathActivityChange.bind(this)
this.handlePresentationStateSelection = this.handlePresentationStateSelection.bind(this)
this.handlePresentationStateReset = this.handlePresentationStateReset.bind(this)
this.handleICCProfilesToggle = this.handleICCProfilesToggle.bind(this)

const { volumeViewer, labelViewer } = _constructViewers({
clients: this.props.clients,
Expand Down Expand Up @@ -638,7 +641,8 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
areRoisHidden: false,
pixelDataStatistics: {},
selectedPresentationStateUID: this.props.selectedPresentationStateUID,
loadingFrames: new Set()
loadingFrames: new Set(),
isICCProfilesEnabled: true
}
}

Expand Down Expand Up @@ -3167,6 +3171,16 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
}
}

/**
* Handler that will toggle the ICC profile color management, i.e., either
* enable or disable it, depending on its current state.
*/
handleICCProfilesToggle = (event: CheckboxChangeEvent): void => {
const checked = event.target.checked
this.setState({ isICCProfilesEnabled: checked })
this.volumeViewer.toggleICCProfiles()
}

render (): React.ReactNode {
const rois: dmv.roi.ROI[] = []
const segments: dmv.segment.Segment[] = []
Expand Down Expand Up @@ -3757,6 +3771,17 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
)
}

const iccProfilesMenu = this.volumeViewer.getICCProfiles().length > 0 && (
<div style={{ margin: '0.9rem' }}>
<Checkbox
checked={this.state.isICCProfilesEnabled}
onChange={this.handleICCProfilesToggle}
>
ICC Profiles
</Checkbox>
</div>
)

return (
<Layout style={{ height: '100%' }} hasSider>
<Layout.Content style={{ height: '100%' }}>
Expand Down Expand Up @@ -3914,6 +3939,7 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
</Menu.SubMenu>
)}
{specimenMenu}
{iccProfilesMenu}
{equipmentMenu}
{opticalPathMenu}
{presentationStateMenu}
Expand Down
2 changes: 2 additions & 0 deletions types/dicom-microscopy-viewer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ declare module 'dicom-microscopy-viewer' {
getAnnotationGroupMetadata (
annotationGroupUID: string
): metadata.MicroscopyBulkSimpleAnnotations
toggleICCProfiles(): void;
getICCProfiles(): any[];
}

export interface OverviewImageViewerOptions {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11408,9 +11408,9 @@ semver@^7.1.2, semver@^7.5.2:
lru-cache "^6.0.0"

semver@^7.3.5, semver@^7.3.7:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
version "7.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f"
integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==

[email protected]:
version "0.19.0"
Expand Down

0 comments on commit d53974c

Please sign in to comment.