@cornerstonejs/nifti-volume-loader 5.1.3 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import NIFTI_LOADER_SCHEME from './niftiLoaderScheme';
1
+ import NIFTI_LOADER_SCHEME from './niftiLoaderScheme.js';
2
2
  export { NIFTI_LOADER_SCHEME };
@@ -1,2 +1,2 @@
1
- import NIFTI_LOADER_SCHEME from './niftiLoaderScheme';
1
+ import NIFTI_LOADER_SCHEME from './niftiLoaderScheme.js';
2
2
  export { NIFTI_LOADER_SCHEME };
@@ -1,8 +1,8 @@
1
1
  import { Enums, eventTarget, metaData, triggerEvent, utilities, } from '@cornerstonejs/core';
2
2
  import * as NiftiReader from 'nifti-reader-js';
3
- import { Events } from './enums';
4
- import { modalityScaleNifti } from './helpers';
5
- import { getOptions } from './internal';
3
+ import { Events } from './enums/index.js';
4
+ import { modalityScaleNifti } from './helpers/index.js';
5
+ import { getOptions } from './internal/index.js';
6
6
  const dataFetchStateMap = new Map();
7
7
  function fetchArrayBuffer({ url, signal, onload, }) {
8
8
  return new Promise(async (resolve, reject) => {
@@ -1,11 +1,11 @@
1
1
  import * as NiftiReader from 'nifti-reader-js';
2
2
  import { eventTarget, triggerEvent, utilities } from '@cornerstonejs/core';
3
- import { rasToLps } from './helpers/convert';
4
- import Events from './enums/Events';
5
- import { NIFTI_LOADER_SCHEME } from './constants';
6
- import makeVolumeMetadata from './helpers/makeVolumeMetadata';
7
- import { getArrayConstructor } from './helpers/dataTypeCodeHelper';
8
- import { getOptions } from './internal';
3
+ import { rasToLps } from './helpers/convert.js';
4
+ import Events from './enums/Events.js';
5
+ import { NIFTI_LOADER_SCHEME } from './constants/index.js';
6
+ import makeVolumeMetadata from './helpers/makeVolumeMetadata.js';
7
+ import { getArrayConstructor } from './helpers/dataTypeCodeHelper.js';
8
+ import { getOptions } from './internal/index.js';
9
9
  export const urlsMap = new Map();
10
10
  const NIFTI1_HEADER_SIZE = 348;
11
11
  const NIFTI2_HEADER_SIZE = 540;
@@ -1,2 +1,2 @@
1
- import Events from './Events';
1
+ import Events from './Events.js';
2
2
  export { Events };
@@ -1,2 +1,2 @@
1
- import Events from './Events';
1
+ import Events from './Events.js';
2
2
  export { Events };
@@ -1,4 +1,4 @@
1
- import { parseAffineMatrix } from './affineUtilities';
1
+ import { parseAffineMatrix } from './affineUtilities.js';
2
2
  const invertDataPerFrame = (dimensions, imageDataArray) => {
3
3
  let TypedArrayConstructor;
4
4
  let bytesPerVoxel;
@@ -1,4 +1,4 @@
1
- import * as NIFTICONSTANTS from './niftiConstants';
1
+ import * as NIFTICONSTANTS from './niftiConstants.js';
2
2
  export function getArrayConstructor(datatypeCode) {
3
3
  switch (datatypeCode) {
4
4
  case NIFTICONSTANTS.NIFTI_TYPE_UINT8:
@@ -1,3 +1,3 @@
1
- import makeVolumeMetadata from './makeVolumeMetadata';
2
- import modalityScaleNifti from './modalityScaleNifti';
1
+ import makeVolumeMetadata from './makeVolumeMetadata.js';
2
+ import modalityScaleNifti from './modalityScaleNifti.js';
3
3
  export { modalityScaleNifti, makeVolumeMetadata };
@@ -1,3 +1,3 @@
1
- import makeVolumeMetadata from './makeVolumeMetadata';
2
- import modalityScaleNifti from './modalityScaleNifti';
1
+ import makeVolumeMetadata from './makeVolumeMetadata.js';
2
+ import modalityScaleNifti from './modalityScaleNifti.js';
3
3
  export { modalityScaleNifti, makeVolumeMetadata };
@@ -1,5 +1,5 @@
1
1
  import { cache, Enums } from '@cornerstonejs/core';
2
- import * as NIFTICONSTANTS from './niftiConstants';
2
+ import * as NIFTICONSTANTS from './niftiConstants.js';
3
3
  export default function modalityScaleNifti(niftiHeader, niftiImageBuffer) {
4
4
  const { datatypeCode, scl_slope, scl_inter } = niftiHeader;
5
5
  let slope = scl_slope;
@@ -1,6 +1,6 @@
1
- import cornerstoneNiftiImageLoader from './cornerstoneNiftiImageLoader';
2
- import * as helpers from './helpers';
3
- import * as Enums from './enums';
4
- import { createNiftiImageIdsAndCacheMetadata } from './createNiftiImageIdsAndCacheMetadata';
5
- import init from './init';
1
+ import cornerstoneNiftiImageLoader from './cornerstoneNiftiImageLoader.js';
2
+ import * as helpers from './helpers/index.js';
3
+ import * as Enums from './enums/index.js';
4
+ import { createNiftiImageIdsAndCacheMetadata } from './createNiftiImageIdsAndCacheMetadata.js';
5
+ import init from './init.js';
6
6
  export { cornerstoneNiftiImageLoader, helpers, Enums, createNiftiImageIdsAndCacheMetadata, init, };
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import cornerstoneNiftiImageLoader from './cornerstoneNiftiImageLoader';
2
- import * as helpers from './helpers';
3
- import * as Enums from './enums';
4
- import { createNiftiImageIdsAndCacheMetadata } from './createNiftiImageIdsAndCacheMetadata';
5
- import init from './init';
1
+ import cornerstoneNiftiImageLoader from './cornerstoneNiftiImageLoader.js';
2
+ import * as helpers from './helpers/index.js';
3
+ import * as Enums from './enums/index.js';
4
+ import { createNiftiImageIdsAndCacheMetadata } from './createNiftiImageIdsAndCacheMetadata.js';
5
+ import init from './init.js';
6
6
  export { cornerstoneNiftiImageLoader, helpers, Enums, createNiftiImageIdsAndCacheMetadata, init, };
@@ -1,3 +1,3 @@
1
- import type { LoaderOptions } from './types';
1
+ import type { LoaderOptions } from './types/index.js';
2
2
  declare function init(options?: LoaderOptions): void;
3
3
  export default init;
package/dist/esm/init.js CHANGED
@@ -1,4 +1,4 @@
1
- import { setOptions } from './internal';
1
+ import { setOptions } from './internal/index.js';
2
2
  function init(options = {}) {
3
3
  setOptions(options);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { setOptions, getOptions } from './options';
1
+ import { setOptions, getOptions } from './options.js';
2
2
  export { setOptions, getOptions };
@@ -1,2 +1,2 @@
1
- import { setOptions, getOptions } from './options';
1
+ import { setOptions, getOptions } from './options.js';
2
2
  export { setOptions, getOptions };
@@ -1,3 +1,3 @@
1
- import type { LoaderOptions } from '../types';
1
+ import type { LoaderOptions } from '../types/index.js';
2
2
  export declare function setOptions(newOptions: LoaderOptions): void;
3
3
  export declare function getOptions(): LoaderOptions;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,2 +1,2 @@
1
- import type { LoaderOptions } from './LoaderOptions';
1
+ import type { LoaderOptions } from './LoaderOptions.js';
2
2
  export type { LoaderOptions };
@@ -1 +1 @@
1
- export declare const version = "5.1.3";
1
+ export declare const version = "5.2.0";
@@ -1 +1 @@
1
- export const version = '5.1.3';
1
+ export const version = '5.2.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/nifti-volume-loader",
3
- "version": "5.1.3",
3
+ "version": "5.2.0",
4
4
  "description": "Nifti Image Loader for Cornerstone3D",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -14,43 +14,51 @@
14
14
  "sideEffects": false,
15
15
  "exports": {
16
16
  ".": {
17
+ "types": "./dist/esm/index.d.ts",
17
18
  "import": "./dist/esm/index.js",
18
- "types": "./dist/esm/index.d.ts"
19
+ "default": "./dist/esm/index.js"
19
20
  },
20
21
  "./helpers": {
22
+ "types": "./dist/esm/helpers/index.d.ts",
21
23
  "import": "./dist/esm/helpers/index.js",
22
- "types": "./dist/esm/helpers/index.d.ts"
24
+ "default": "./dist/esm/helpers/index.js"
23
25
  },
24
26
  "./helpers/*": {
27
+ "types": "./dist/esm/helpers/*.d.ts",
25
28
  "import": "./dist/esm/helpers/*.js",
26
- "types": "./dist/esm/helpers/*.d.ts"
29
+ "default": "./dist/esm/helpers/*.js"
27
30
  },
28
31
  "./constants": {
32
+ "types": "./dist/esm/constants/index.d.ts",
29
33
  "import": "./dist/esm/constants/index.js",
30
- "types": "./dist/esm/constants/index.d.ts"
34
+ "default": "./dist/esm/constants/index.js"
31
35
  },
32
36
  "./constants/*": {
37
+ "types": "./dist/esm/constants/*.d.ts",
33
38
  "import": "./dist/esm/constants/*.js",
34
- "types": "./dist/esm/constants/*.d.ts"
39
+ "default": "./dist/esm/constants/*.js"
35
40
  },
36
41
  "./enums": {
42
+ "types": "./dist/esm/enums/index.d.ts",
37
43
  "import": "./dist/esm/enums/index.js",
38
- "types": "./dist/esm/enums/index.d.ts"
44
+ "default": "./dist/esm/enums/index.js"
39
45
  },
40
46
  "./enums/*": {
47
+ "types": "./dist/esm/enums/*.d.ts",
41
48
  "import": "./dist/esm/enums/*.js",
42
- "types": "./dist/esm/enums/*.d.ts"
49
+ "default": "./dist/esm/enums/*.js"
43
50
  },
44
51
  "./version": {
45
- "node": "./dist/esm/version.js",
52
+ "types": "./dist/esm/version.d.ts",
46
53
  "import": "./dist/esm/version.js",
47
- "types": "./dist/esm/version.d.ts"
48
- }
54
+ "default": "./dist/esm/version.js"
55
+ },
56
+ "./package.json": "./package.json"
49
57
  },
50
58
  "scripts": {
51
59
  "prebuild": "node ../../scripts/generate-version.js ./",
52
- "build:esm": "pnpm run prebuild && tsc --project ./tsconfig.json",
53
- "build:esm:watch": "tsc --project ./tsconfig.json --watch",
60
+ "build:esm": "pnpm run prebuild && tsc --project ./tsconfig.json && tsc-alias -p ./tsconfig.json --resolve-full-paths && node ../../scripts/write-dist-esm-package-json.js ./",
61
+ "build:esm:watch": "sh -c 'tsc-alias -p ./tsconfig.json --resolve-full-paths --watch & alias_pid=$!; node ../../scripts/write-dist-esm-package-json.js ./ --watch & writer_pid=$!; trap \"kill $alias_pid $writer_pid\" EXIT; tsc --project ./tsconfig.json --watch'",
54
62
  "build:all": "pnpm run build:esm",
55
63
  "dev": "tsc --project ./tsconfig.json --watch",
56
64
  "build": "pnpm run build:all",
@@ -65,10 +73,10 @@
65
73
  "nifti-reader-js": "0.6.9"
66
74
  },
67
75
  "devDependencies": {
68
- "@cornerstonejs/core": "5.1.3"
76
+ "@cornerstonejs/core": "5.2.0"
69
77
  },
70
78
  "peerDependencies": {
71
- "@cornerstonejs/core": "5.1.3"
79
+ "@cornerstonejs/core": "5.2.0"
72
80
  },
73
81
  "contributors": [
74
82
  {
@@ -81,5 +89,5 @@
81
89
  "type": "individual",
82
90
  "url": "https://ohif.org/donate"
83
91
  },
84
- "gitHead": "e3694f1ab70dc631b251985c54364e65a5e90ea6"
92
+ "gitHead": "e3f8b2ba29ee50d4a7039e3f1e7e7fb49db58130"
85
93
  }