Skip to content

Commit

Permalink
feat: added biplane support (#353)
Browse files Browse the repository at this point in the history
* feat: added biplane support

* Update docs

* fix: type

* Update docs

* fix: added multiframe info to imageStore (#354)

* fix: added multiframe info to imageStore

* Update docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: added biplane support

* fix: type

* Update docs

* fix: rebased

* Update docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Toselli <[email protected]>
  • Loading branch information
3 people authored May 13, 2024
1 parent a05b3e7 commit 5416519
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 8 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.4.31
### Current version: 2.5.0

### Latest Published Release: 2.4.31
### Latest Published Release: 2.5.0

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

1 change: 1 addition & 0 deletions imaging/MetaDataReadable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type MetaDataReadable = {
numberOfTemporalPositions?: number;
contentTime?: number;
is4D?: boolean;
biplane?: BiPlane;
windowCenter?: number | number[];
windowWidth?: number | number[];
minPixelValue?: number;
Expand Down
29 changes: 29 additions & 0 deletions imaging/imageParsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ const parseFile = function (file: File) {
let numberOfFrames = metadata["x00280008"];
let isMultiframe = (numberOfFrames as number) > 1 ? true : false;
let waveform = metadata["x50003000"] ? true : false;
// check dicom tag image type x00080008 if contains the word BIPLANE A or BIPLANE B
// if true, then it is a biplane image
let biplane = metadata["x00080008"]
? metadata["x00080008"].includes("BIPLANE")
: false;

if (dataSet.warnings.length > 0) {
// warnings
Expand Down Expand Up @@ -439,6 +444,30 @@ const parseFile = function (file: File) {
metadata["x00200105"];
imageObject.metadata.contentTime = metadata["x00080033"];
}
if (biplane) {
// check if dicom tag image type x00080008 contains the word
// BIPLANE A or BIPLANE B
// if true, the tag is set to BIPLANE A or BIPLANE B
let tag =
metadata["x00080008"] &&
metadata["x00080008"].includes("BIPLANE A")
? "BIPLANE A"
: "BIPLANE B";
const referencedSOPInstanceUID = metadata["x00081155"];
const positionerPrimaryAngle = metadata["x00181510"]
? metadata["x00181510"]
: 0;
const positionerSecondaryAngle = metadata["x00181511"]
? metadata["x00181511"]
: 0;
imageObject.metadata.biplane.tag = tag;
imageObject.metadata.biplane.referencedSOPInstanceUID =
referencedSOPInstanceUID;
imageObject.metadata.biplane.positionerPrimaryAngle =
(positionerPrimaryAngle as number) >= 0 ? "LAO" : "RAO";
imageObject.metadata.biplane.positionerSecondaryAngle =
(positionerSecondaryAngle as number) >= 0 ? "CRA" : "CAU";
}
imageObject.metadata.is4D = is4D;
imageObject.metadata.waveform = waveform;
imageObject.metadata.windowCenter = metadata["x00281050"];
Expand Down
7 changes: 7 additions & 0 deletions imaging/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export type StagedProtocol = {
viewNumber?: number; // Number of the view
};

export type BiPlane = {
tag: string;
referencedSOPInstanceUID: string;
positionerPrimaryAngle: string; // LAO >= 0, RAO < 0
positionerSecondaryAngle: string; // CRA >= 0, CAU < 0
};

export type DSA = {
imageIds: string[];
x00286101?: string; // DSA MaskOperation
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.4.31",
"version": "2.5.0",
"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 5416519

Please sign in to comment.