fix(segmentation): Various fixes for segmentation mode and other (#3709)

This commit is contained in:
Joe Boccanfuso 2023-10-10 10:25:30 -04:00 committed by GitHub
parent f8455056cd
commit a9a6ad50ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 27 deletions

View File

@ -130,7 +130,7 @@ class SegmentationService extends PubSubService {
throw new Error('Segment index 0 is reserved for "no label"');
}
const toolGroupId = config.toolGroupId ?? this._getFirstToolGroupId();
const toolGroupId = config.toolGroupId ?? this._getApplicableToolGroupId();
const { segmentationRepresentationUID, segmentation } = this._getSegmentationInfo(
segmentationId,
@ -361,7 +361,7 @@ class SegmentationService extends PubSubService {
}
public setActiveSegmentationForToolGroup(segmentationId: string, toolGroupId?: string): void {
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const suppressEvents = false;
this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, suppressEvents);
@ -912,7 +912,7 @@ class SegmentationService extends PubSubService {
}
const segmentation = this.getSegmentation(segmentationId);
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const segmentationRepresentation = this._getSegmentationRepresentation(
segmentationId,
@ -1313,7 +1313,7 @@ class SegmentationService extends PubSubService {
if (remainingHydratedSegmentations.length) {
const { id } = remainingHydratedSegmentations[0];
this._setActiveSegmentationForToolGroup(id, this._getFirstToolGroupId(), false);
this._setActiveSegmentationForToolGroup(id, this._getApplicableToolGroupId(), false);
}
}
@ -1325,7 +1325,7 @@ class SegmentationService extends PubSubService {
}
public getConfiguration = (toolGroupId?: string): SegmentationConfig => {
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const brushSize = 1;
// const brushSize = cstUtils.segmentation.getBrushSizeForToolGroup(
@ -1620,7 +1620,7 @@ class SegmentationService extends PubSubService {
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
}
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const segmentationRepresentation = this._getSegmentationRepresentation(
segmentationId,
@ -1714,7 +1714,7 @@ class SegmentationService extends PubSubService {
toolGroupId?: string,
suppressEvents = false
) {
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const { segmentationRepresentationUID, segmentation } = this._getSegmentationInfo(
segmentationId,
@ -1773,7 +1773,7 @@ class SegmentationService extends PubSubService {
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
}
toolGroupId = toolGroupId ?? this._getFirstToolGroupId();
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
const segmentationRepresentation = this._getSegmentationRepresentation(
segmentationId,
@ -2090,11 +2090,21 @@ class SegmentationService extends PubSubService {
}
}
private _getFirstToolGroupId = () => {
const { toolGroupService } = this.servicesManager.services;
const toolGroupIds = toolGroupService.getToolGroupIds();
private _getApplicableToolGroupId = () => {
const { toolGroupService, viewportGridService, cornerstoneViewportService } =
this.servicesManager.services;
return toolGroupIds[0];
const viewportInfo = cornerstoneViewportService.getViewportInfo(
viewportGridService.getActiveViewportId()
);
if (!viewportInfo) {
const toolGroupIds = toolGroupService.getToolGroupIds();
return toolGroupIds[0];
}
return viewportInfo.getToolGroupId();
};
private getNextColorLUTIndex = (): number => {

View File

@ -165,20 +165,6 @@ const toolbarButtons = [
],
'Ellipse Tool'
),
_createToolButton(
'CircleROI',
'tool-circle',
'Circle',
[
..._createCommands('setToolActive', 'CircleROI', [
toolGroupIds.CT,
toolGroupIds.PT,
toolGroupIds.Fusion,
// toolGroupIds.MPR,
]),
],
'Circle Tool'
),
],
},
},

View File

@ -26,7 +26,7 @@ function createStudyMetadata(StudyInstanceUID) {
let series = this.series.find(s => s.SeriesInstanceUID === SeriesInstanceUID);
if (!series) {
const series = createSeriesMetadata(SeriesInstanceUID);
series = createSeriesMetadata(SeriesInstanceUID);
this.series.push(series);
}

View File

@ -18,6 +18,11 @@ Google Cloud Healthcare data source.
![Data source configuration UI](../../assets/img/data-source-configuration-ui.png)
:::tip
A datasource root URI can be [fully or partially specified](../../deployment/google-cloud-healthcare.md#configuring-google-cloud-healthcare-as-a-datasource-in-ohif)
in the OHIF configuration file.
:::
## `BaseDataSourceConfigurationAPIItem` interface
Each (path) item of a data source is represented by an instance of this interface.

View File

@ -128,3 +128,12 @@ cd OHIFViewer
yarn install
APP_CONFIG=config/google.js yarn run dev
```
## Configuring Google Cloud Healthcare as a datasource in OHIF
A Google Cloud Healthcare DICOM store can be configured as a DICOMweb datasource
in OHIF. A full or partial path is permitted in the configuration file. For
partial paths, the [data source configuration UI](../configuration/dataSources/configuration-ui.md)
will assist in filling in the missing pieces. For example, a configuration with
empty `wadoUriRoot`, `qidoRoot` and `wadoRoot` will prompt for the entire path
step-by-step starting with the project.