Skip to content

Commit

Permalink
fix: image loading (#309)
Browse files Browse the repository at this point in the history
* fix: image loading

* Update docs

* fix: loading

* Update docs

* fix: rendering and docs

* Update docs

* fix: expose maxWebWorkers

* Update docs

* fix: expose maxWebWorkers

* Update docs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
daron1337 and github-actions[bot] authored Feb 15, 2024
1 parent 2499149 commit ebdbcf1
Show file tree
Hide file tree
Showing 148 changed files with 1,054 additions and 1,002 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.1.12
### Current version: 2.2.0

### Latest Published Release: 2.1.12
### Latest Published Release: 2.2.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
16 changes: 2 additions & 14 deletions dist/imaging/imageLoading.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,13 @@
*/
import { ImageObject } from "./types";
import { getLarvitarManager } from "./loaders/commonLoader";
declare const globalConfig: {
maxWebWorkers: number;
startWebWorkersOnDemand: boolean;
taskConfiguration: {
decodeTask: {
loadCodecsOnStartup: boolean;
initializeCodecsOnStartup: boolean;
strict: boolean;
};
};
};
/**
* Configure DICOMImageLoader
* @instance
* @function initializeImageLoader
* @param {Object} config - Custom config @default globalConfig
* @param {number} maxConcurrency - Optional maximum number of web workers
*/
export declare const initializeImageLoader: (config?: typeof globalConfig) => void;
export declare const initializeImageLoader: (maxConcurrency?: number) => void;
/**
* Configure cornerstoneWebImageLoader
* @instance
Expand Down Expand Up @@ -68,4 +57,3 @@ export declare const registerDsaImageLoader: () => void;
* @param {number} sliceIndex - Optional custom index to overwrite slice index as default one
*/
export declare const updateLoadedStack: (seriesData: ImageObject, allSeriesStack: ReturnType<typeof getLarvitarManager>, customId?: string, sliceIndex?: number) => void;
export {};
4 changes: 2 additions & 2 deletions dist/imaging/imageRendering.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ export declare const rotateImageLeft: (elementId: string | HTMLElement) => void;
*/
export declare const rotateImageRight: (elementId: string | HTMLElement) => void;
/**
* Update Larvitar manager viewport data
* Update Larvitar manager temporal viewport data
* @instance
* @function updateViewportDataInLarvitarManager
* @function updateTemporalViewportData
* @param {Series} seriesStack The Id of the series
* @param {String} elementId The Id of the html element
*/
Expand Down
11 changes: 6 additions & 5 deletions dist/imaging/loaders/dicomLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ export declare const cacheImage: (seriesData: Series, imageIndex: number) => Pro
*/
export declare const cacheImages: (seriesData: Series, callback?: Function) => Promise<void>;
/**
* Unload DSA Image Stack and Recache Image Stack for DSA
* Load and cache image stack
* @instance
* @function unloadAndRecacheImageStackDSA
* @function loadAndCacheImageStack
* @param {Object} seriesData The series data
* @return {Promise} Promise object represents the loading and caching of the image stack
*/
export declare const unloadAndRecacheImageStackDSA: (seriesData: Series) => Promise<void>;
export declare const loadAndCacheImageStack: (seriesData: Series) => Promise<void>;
/**
* Load and cache image stack
* @instance
* @function loadAndCacheImageStack
* @function loadAndCacheDsaImageStack
* @param {Object} seriesData The series data
* @param {boolean} forceRecache Optional parameter to force recache
* @return {Promise} Promise object represents the loading and caching of the image stack
*/
export declare const loadAndCacheImageStack: (seriesData: Series) => Promise<void>;
export declare const loadAndCacheDsaImageStack: (seriesData: Series, forceRecache?: boolean) => Promise<void>;
/**
* Get the dicom imageId from dicom loader
* @instance
Expand Down
4 changes: 2 additions & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { DEFAULT_TOOLS, dvTools, getDefaultToolsByType, setDefaultToolsProps, re
import { initSegmentationModule, addSegmentationMask, clearSegmentationState, deleteMask, setActiveLabelmap, setActiveSegment, enableBrushTool, disableBrushTool, undoLastStroke, redoLastStroke, setBrushProps, toggleContourMode, toggleVisibility, hexToRgb, rgbToHex, getActiveLabelmapBuffer } from "./imaging/tools/segmentation";
import { updateLarvitarManager, populateLarvitarManager, getLarvitarManager, getLarvitarImageTracker, resetLarvitarManager, removeSeriesFromLarvitarManager, getSeriesDataFromLarvitarManager, getImageFrame, getSopInstanceUIDFromLarvitarManager } from "./imaging/loaders/commonLoader";
import { buildNrrdImage, getNrrdImageId, loadNrrdImage, getImageIdFromSlice, getSliceNumberFromImageId, getNrrdSerieDimensions } from "./imaging/loaders/nrrdLoader";
import { getDicomImageId, cacheImage, cacheImages, loadAndCacheImageStack, unloadAndRecacheImageStackDSA } from "./imaging/loaders/dicomLoader";
import { getDicomImageId, cacheImage, cacheImages, loadAndCacheImageStack, loadAndCacheDsaImageStack } from "./imaging/loaders/dicomLoader";
import { loadReslicedImage } from "./imaging/loaders/resliceLoader";
import { loadMultiFrameImage, buildMultiFrameImage, getMultiFrameImageId, clearMultiFrameCache } from "./imaging/loaders/multiframeLoader";
import { populateDsaImageIds } from "./imaging/loaders/dsaImageLoader";
Expand All @@ -35,4 +35,4 @@ import { getColormapsList, applyColorMap, addColorMap, fillPixelData, HSVToRGB }
import { applyDSAShift } from "./imaging/postProcessing/applyDSA";
import { saveAnnotations, loadAnnotations } from "./imaging/tools/io";
import { addMouseKeyHandlers, removeMouseKeyHandlers, toggleMouseToolsListeners } from "./imaging/tools/interaction";
export { VERSION, cornerstone, cornerstoneTools, parseDicom, segModule, cornerstoneDICOMImageLoader, checkAndClearMemory, checkMemoryAllocation, getUsedMemory, getAvailableMemory, getPerformanceMonitor, activatePerformanceMonitor, deactivatePerformanceMonitor, store, parseECG, renderECG, unrenderECG, syncECGFrame, updateECGFrame, getDefaultECGLayout, getImagePresets, setImagePreset, setImageCustomPreset, getNormalOrientation, getMinPixelValue, getMaxPixelValue, getPixelRepresentation, getTypedArrayFromDataType, getSortedStack, randomId, getMeanValue, getReslicedMetadata, getReslicedPixeldata, getDistanceBetweenSlices, getImageMetadata, buildHeader, getCachedPixelData, buildData, buildDataAsync, importNRRDImage, exportImageToBase64, anonymize, buildLayer, updateLayer, getActiveLayer, setActiveLayer, initializeImageLoader, initializeWebImageLoader, initializeFileImageLoader, registerNRRDImageLoader, registerResliceLoader, registerMultiFrameImageLoader, registerDsaImageLoader, updateLoadedStack, readFile, readFiles, parseDataSet, clearImageParsing, clearImageCache, loadAndCacheImages, renderFileImage, renderDICOMPDF, renderWebImage, disableViewport, unloadViewport, resizeViewport, renderImage, updateImage, redrawImage, resetViewports, updateViewportData, toggleMouseToolsListeners, storeViewportData, invertImage, flipImageHorizontal, flipImageVertical, rotateImageLeft, rotateImageRight, resliceSeries, getColormapsList, applyColorMap, addColorMap, fillPixelData, HSVToRGB, parseContours, updateLarvitarManager, populateLarvitarManager, getLarvitarManager, getLarvitarImageTracker, resetLarvitarManager, removeSeriesFromLarvitarManager, getSeriesDataFromLarvitarManager, getImageFrame, getSopInstanceUIDFromLarvitarManager, buildNrrdImage, getNrrdImageId, loadNrrdImage, getImageIdFromSlice, getSliceNumberFromImageId, getNrrdSerieDimensions, loadReslicedImage, getDicomImageId, cacheImage, cacheImages, loadAndCacheImageStack, unloadAndRecacheImageStackDSA, loadMultiFrameImage, buildMultiFrameImage, getMultiFrameImageId, clearMultiFrameCache, populateDsaImageIds, getFileManager, resetFileLoader, resetFileManager, populateFileManager, getFileImageId, applyDSAShift, addDiameterTool, addContoursTool, addMaskEditingTool, getCurrentMaskData, addStackStateToElement, addSeedsTool, clearMeasurements, getToolState, clearToolStateByName, updateDiameterTool, addToolStateSingleSlice, clearCornerstoneElements, syncToolStack, updateStackToolState, setSegmentationConfig, csToolsCreateStack, csToolsUpdateImageIds, csToolsUpdateImageIndex, initializeCSTools, setToolsStyle, addDefaultTools, addTool, setToolActive, setToolDisabled, setToolEnabled, setToolPassive, exportAnnotations, DEFAULT_TOOLS, dvTools, getDefaultToolsByType, setDefaultToolsProps, registerExternalTool, saveAnnotations, loadAnnotations, addMouseKeyHandlers, removeMouseKeyHandlers, initSegmentationModule, addSegmentationMask, setActiveLabelmap, setActiveSegment, undoLastStroke, redoLastStroke, setBrushProps, hexToRgb, rgbToHex, clearSegmentationState, deleteMask, enableBrushTool, disableBrushTool, toggleContourMode, toggleVisibility, getActiveLabelmapBuffer, updateTemporalViewportData };
export { VERSION, cornerstone, cornerstoneTools, parseDicom, segModule, cornerstoneDICOMImageLoader, checkAndClearMemory, checkMemoryAllocation, getUsedMemory, getAvailableMemory, getPerformanceMonitor, activatePerformanceMonitor, deactivatePerformanceMonitor, store, parseECG, renderECG, unrenderECG, syncECGFrame, updateECGFrame, getDefaultECGLayout, getImagePresets, setImagePreset, setImageCustomPreset, getNormalOrientation, getMinPixelValue, getMaxPixelValue, getPixelRepresentation, getTypedArrayFromDataType, getSortedStack, randomId, getMeanValue, getReslicedMetadata, getReslicedPixeldata, getDistanceBetweenSlices, getImageMetadata, buildHeader, getCachedPixelData, buildData, buildDataAsync, importNRRDImage, exportImageToBase64, anonymize, buildLayer, updateLayer, getActiveLayer, setActiveLayer, initializeImageLoader, initializeWebImageLoader, initializeFileImageLoader, registerNRRDImageLoader, registerResliceLoader, registerMultiFrameImageLoader, registerDsaImageLoader, updateLoadedStack, readFile, readFiles, parseDataSet, clearImageParsing, clearImageCache, loadAndCacheImages, renderFileImage, renderDICOMPDF, renderWebImage, disableViewport, unloadViewport, resizeViewport, renderImage, updateImage, redrawImage, resetViewports, updateViewportData, toggleMouseToolsListeners, storeViewportData, invertImage, flipImageHorizontal, flipImageVertical, rotateImageLeft, rotateImageRight, resliceSeries, getColormapsList, applyColorMap, addColorMap, fillPixelData, HSVToRGB, parseContours, updateLarvitarManager, populateLarvitarManager, getLarvitarManager, getLarvitarImageTracker, resetLarvitarManager, removeSeriesFromLarvitarManager, getSeriesDataFromLarvitarManager, getImageFrame, getSopInstanceUIDFromLarvitarManager, buildNrrdImage, getNrrdImageId, loadNrrdImage, getImageIdFromSlice, getSliceNumberFromImageId, getNrrdSerieDimensions, loadReslicedImage, getDicomImageId, cacheImage, cacheImages, loadAndCacheImageStack, loadAndCacheDsaImageStack, loadMultiFrameImage, buildMultiFrameImage, getMultiFrameImageId, clearMultiFrameCache, populateDsaImageIds, getFileManager, resetFileLoader, resetFileManager, populateFileManager, getFileImageId, applyDSAShift, addDiameterTool, addContoursTool, addMaskEditingTool, getCurrentMaskData, addStackStateToElement, addSeedsTool, clearMeasurements, getToolState, clearToolStateByName, updateDiameterTool, addToolStateSingleSlice, clearCornerstoneElements, syncToolStack, updateStackToolState, setSegmentationConfig, csToolsCreateStack, csToolsUpdateImageIds, csToolsUpdateImageIndex, initializeCSTools, setToolsStyle, addDefaultTools, addTool, setToolActive, setToolDisabled, setToolEnabled, setToolPassive, exportAnnotations, DEFAULT_TOOLS, dvTools, getDefaultToolsByType, setDefaultToolsProps, registerExternalTool, saveAnnotations, loadAnnotations, addMouseKeyHandlers, removeMouseKeyHandlers, initSegmentationModule, addSegmentationMask, setActiveLabelmap, setActiveSegment, undoLastStroke, redoLastStroke, setBrushProps, hexToRgb, rgbToHex, clearSegmentationState, deleteMask, enableBrushTool, disableBrushTool, toggleContourMode, toggleVisibility, getActiveLabelmapBuffer, updateTemporalViewportData };
Loading

0 comments on commit ebdbcf1

Please sign in to comment.