Skip to content

Commit

Permalink
fix: getPixelData (#380)
Browse files Browse the repository at this point in the history
* fix: getPixelData

* Update docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
daron1337 and github-actions[bot] authored Aug 6, 2024
1 parent 5a3016b commit 83da064
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
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.5.15
### Current version: 2.5.16

### Latest Published Release: 2.5.15
### Latest Published Release: 2.5.16

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
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.5.15">Current version: 2.5.15</h3>
<h3 id="latest-published-release%3A-2.5.15">Latest Published Release: 2.5.15</h3>
<h3 id="current-version%3A-2.5.16">Current version: 2.5.16</h3>
<h3 id="latest-published-release%3A-2.5.16">Latest Published Release: 2.5.16</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.

3 changes: 2 additions & 1 deletion imaging/loaders/multiframeLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,12 @@ let createCustomImage = function (
loadTimeInMS: undefined // TODO
};
// add function to return pixel data
// @ts-ignore: is needed to avoid array conversion
image.getPixelData = function () {
if (imageFrame.pixelData === undefined) {
throw new Error("No pixel data for image " + imageId);
}
return Array.from(imageFrame.pixelData);
return imageFrame.pixelData;
};

// convert color space if not isJPEGBaseline8BitColor
Expand Down
2 changes: 1 addition & 1 deletion imaging/tools/custom/OverlayTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class OverlayTool extends BaseTool {
const manager = getLarvitarManager() as LarvitarManager;

const seriesData = manager![seriesId] as Series;
if (seriesData) {
if (seriesData && seriesData.instances[image.imageId]) {
overlayPlaneMetadata = seriesData.instances[image.imageId].overlays as {
overlays: Overlay[];
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"medical",
"cornerstone"
],
"version": "2.5.15",
"version": "2.5.16",
"description": "typescript library for parsing, loading, rendering and interacting with DICOM images",
"repository": {
"url": "https://github.com/dvisionlab/Larvitar.git",
Expand Down

0 comments on commit 83da064

Please sign in to comment.