Skip to content

Commit

Permalink
Fix plot (#327)
Browse files Browse the repository at this point in the history
* update vet tool

* fixed settings.json

* Update docs

* Update docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent f92a363 commit f11078c
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 121 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"prettier.arrowParens": "avoid",
"prettier.trailingComma": "none"
}
"prettier.arrowParens": "avoid",
"prettier.trailingComma": "none"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

## Dicom Image Toolkit for CornerstoneJS

### Current version: 2.4.10
### Current version: 2.4.11

### Latest Published Release: 2.4.10
### Latest Published Release: 2.4.11

This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.

Expand Down
81 changes: 71 additions & 10 deletions dist/imaging/tools/custom/LengthPlotTool.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,66 @@
import cornerstone from "cornerstone-core";
declare const BaseAnnotationTool: any;
import { HandlePosition, dataSets, MeasurementData, Handles, MeasurementMouseEvent, Coords, EventData, PlotlyData } from "../types";
import { HandlePosition } from "../types";
type dataSets = {
points: number[];
pixelValues: number[];
color: string;
}[];
interface data {
visible: boolean;
active: boolean;
color: string;
invalidated: boolean;
handles: Handles;
length: number;
}
interface Handles {
start: HandlePosition;
end: HandlePosition;
offset: number;
fixedoffset: number;
color: string;
textBox?: {
active: boolean;
hasMoved: boolean;
movesIndependently: boolean;
drawnIndependently: boolean;
allowedOutsideImage: boolean;
hasBoundingBox: boolean;
};
}
interface ToolMouseEvent {
detail: EventData;
currentTarget: any;
}
interface Coords {
x: number;
y: number;
}
interface EventData {
currentPoints: {
image: Coords;
};
element: HTMLElement;
buttons: number;
shiftKey: boolean;
event: {
altKey: boolean;
shiftKey: boolean;
};
image: cornerstone.Image;
canvasContext: {
canvas: any;
};
}
interface PlotlyData {
x: number[];
y: number[];
type: string;
line: {
color: string;
};
}
/**
* @public
* @class LengthPlotTool
Expand All @@ -12,9 +72,9 @@ import { HandlePosition, dataSets, MeasurementData, Handles, MeasurementMouseEve
export default class LengthPlotTool extends BaseAnnotationTool {
name: string;
eventData?: EventData;
datahandles?: Handles;
abovehandles?: Handles;
belowhandles?: Handles;
datahandles?: Handles | null;
abovehandles?: Handles | null;
belowhandles?: Handles | null;
plotlydata: Array<PlotlyData>;
measuring: boolean;
throttledUpdateCachedStats: any;
Expand Down Expand Up @@ -77,36 +137,37 @@ export default class LengthPlotTool extends BaseAnnotationTool {
hasBoundingBox: boolean;
};
offset: number;
fixedoffset: number;
};
} | undefined;
/**
* Identifies when the cursor is near the tool data
* @method
* @name pointNearTool
* @param {HTMLElement} element
* @param {MeasurementData} data
* @param {data} data
* @param {Coords} coords
* @returns {boolean}
*/
pointNearTool(element: HTMLElement, data: MeasurementData, coords: Coords): boolean;
pointNearTool(element: HTMLElement, data: data, coords: Coords): boolean;
/**
* Updates stats of line length
* @method
* @name updateCachedStats
* @param {cornerstone.Image} image
* @param {HTMLElement} element
* @param {MeasurementData} data
* @param {data} data
* @returns {boolean}
*/
updateCachedStats(image: cornerstone.Image, element: HTMLElement, data: MeasurementData): void;
updateCachedStats(image: cornerstone.Image, element: HTMLElement, data: data): void;
/**
* Renders the data (new line/modified line)
* @method
* @name updateCachedStats
* @param {MeasurementMouseEvent | WheelEvent} evt
* @param {ToolMouseEvent | WheelEvent} evt
* @returns {void}
*/
renderToolData(evt: MeasurementMouseEvent | WheelEvent): void;
renderToolData(evt: ToolMouseEvent | WheelEvent): void;
/**
* Retrieves the points along the line
* @method
Expand Down
2 changes: 1 addition & 1 deletion dist/larvitar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/larvitar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ <h3> </h3>
<h1 id="larvitar">Larvitar</h1>
<p><a href="https://github.com/dvisionlab/Larvitar"><img src="https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&amp;prefix=%E2%89%A5&amp;suffix=%25&amp;query=$.typeCoverage.atLeast&amp;uri=https%3A%2F%2Fraw.githubusercontent.com%2Fplantain-00%2Ftype-coverage%2Fmaster%2Fpackage.json" alt="type-coverage"></a></p>
<h2 id="dicom-image-toolkit-for-cornerstonejs">Dicom Image Toolkit for CornerstoneJS</h2>
<h3 id="current-version%3A-2.4.10">Current version: 2.4.10</h3>
<h3 id="latest-published-release%3A-2.4.10">Latest Published Release: 2.4.10</h3>
<h3 id="current-version%3A-2.4.11">Current version: 2.4.11</h3>
<h3 id="latest-published-release%3A-2.4.11">Latest Published Release: 2.4.11</h3>
<p>This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.</p>
<h2 id="features%3A">Features:</h2>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/larvitar.js

Large diffs are not rendered by default.

Loading

0 comments on commit f11078c

Please sign in to comment.