cornerstonejs / cornerstonewebimageloader Goto Github PK
View Code? Open in Web Editor NEWCornerstone Image Loader for Web Images (PNG, JPEG)
License: MIT License
Cornerstone Image Loader for Web Images (PNG, JPEG)
License: MIT License
I make an api call to append the headers for CORS, but the loadImage function fails. Tried loading this image: https://phpapi.rsna.org/image-viewer/v1/get/image?image-address=https://pubs.rsna.org/na101/home/literatum/publisher/rsna/journals/content/radiographics/2018/rg.2018.38.issue-1/rg.2018170120/20171226/images/large/rg.2018170120.fig1a.jpeg in our code, and on the example site: https://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/index.html, but it doesn't work even though it works in older version of the code in an example shown here: http://images.rsna.org/index.html?doi=10.1148/rg.2018170120&fig=fig1a
Potential Enhancement.
It's possible to load metaData for images without doing so directly during image loading. You can see an example of this with the wadors
metaDataProvider. Knowing that, would it be worth checking if metaData exists for the imageId when its created? Similar to how we do in the WadoImageLoader
?
When using cornerstoneTools with webImageLoader, the error "TypeError: errorLoadingHandler is not a function" is raised.
It looks like that handler is implemented in WADOImageLoader but not in WebImageLoader.
Hello,
I am unable to set Authorization headers, as the images which are fetched are secured and giving 401.
Thanks
Gaurav
In both cornerstoneWebImageLoader and cornerstoneWADOImageLoader I'm getting the same error while setting xhr.reponseType
(line 116 of cornerstoneWebImageLoader.js).
This can be easily reproduced using the example: http://chafey.github.io/cornerstoneWebImageLoader/
The error is documented here:
https://connect.microsoft.com/IE/feedback/details/795580/ie11-xmlhttprequest-incorrectly-throws-invalidstateerror-when-setting-responsetype
I'm trying to workaround this, but if you find a solution please post here or update head.
it no longer matches a GH release
Is this link active? when I load i get a 404
https://raw.githubusercontent.com/cornerstonejs/cornerstoneWebImageLoader/master/dist/cornerstoneWebImageLoader.js
when I load the same image by using wado and web(Images were converted from DICOM to JPG in the back end),In webload mode, an error occurred in WWWC,The display did not reach the correct value。
var viewport = cornerstone.getViewport(dt); viewport.voi.windowWidth = 1200; viewport.voi.windowCenter = -600; cornerstone.setViewport(dt,viewport);
I I tried to add tag information, but he hasn't changed a bit. Can you give me some advice?
image.sopInstUID=localData.series[seriesId].imgs[iIndex].sopInstUID; image.maxPixelValue=localData.series[seriesId].imgs[iIndex].largestImagePixelValue; image.windowWidth=localData.series[seriesId].imgs[iIndex].windowWidth; image.windowCenter=localData.series[seriesId].imgs[iIndex].windowCenter; image.minPixelValue=localData.series[seriesId].imgs[iIndex].smallestImagePixelValue; image.intercept=localData.series[seriesId].imgs[iIndex].rescaleIntercept; image.FrameofReferenceUID=localData.series[seriesId].imgs[iIndex].FrameofReferenceUID; image.Rows=localData.series[seriesId].imgs[iIndex].Rows; image.columns=localData.series[seriesId].imgs[iIndex].columns; image.ImagePositionPatient=localData.series[seriesId].imgs[iIndex].ImagePositionPatient;
cornerstone.displayImage(dt,image);
Or use this method:
metaDataProvider:function(type, imageId) { if(type === 'imagePlaneModule') { for(var i=0;i<dataHandle.getSerNum();i++) { for(var j=0;j<dataHandle.getImgNum(i);j++) { var img=localData.series[localData.sIdArr[i]].imgs[j]; if(img.imageId===imageId) return img; } } } }
cornerstone.metaData.addProvider(metaDataProvider);
(I'm from China. English is not very good. I'm sorry.)
So I am converting a TIFF image to a canvas and then converting that canvas into a PNG. I can display this new PNG on the webpage, but whenever I try to load it with cornerstoneWebImageLoader, I get an error, because it is looking for an imageID.
let img = new Image();
img.src = canvas.toDataURL('image/png'); // img.src = data:image/png;base64,....
cornerstone.loadImage(img).then(image => {
// more code
}); // This is where it blows up.
How can I use this loader to show my PNG?
We should be able to load images from file inputs as we can with the WADO Image Loader.
Hello,
Is there a way to apply some filters on the loaded images, for example (Sharpness).
This filter usually implemented using a mathematical method to change the image pixels, using a 3d matrix.
Regards.
when i build a program with the lastest version of cornerstonetools ,the png load fine,but all the tools not work
Now that the dist
folder isn't available, links from readme.md do not resolve.
Annoyingly, there's no NPM package for the WADO loader and no dist package for this loader.
I've dug up the last dist/ release to use for now.
metaDataProvider
`if (type === 'imagePlaneModule') {
const imageOrientationPatient = getNumberValues(dataSet, 'x00200037', 6);
const imagePositionPatient = getNumberValues(dataSet, 'x00200032', 3);
const pixelSpacing = getNumberValues(dataSet, 'x00280030', 2);
let columnPixelSpacing = null;
let rowPixelSpacing = null;
if (pixelSpacing) {
rowPixelSpacing = pixelSpacing[0];
columnPixelSpacing = pixelSpacing[1];
}
let rowCosines = null;
let columnCosines = null;
if (imageOrientationPatient) {
rowCosines = [parseFloat(imageOrientationPatient[0]), parseFloat(imageOrientationPatient[1]), parseFloat(imageOrientationPatient[2])];
columnCosines = [parseFloat(imageOrientationPatient[3]), parseFloat(imageOrientationPatient[4]), parseFloat(imageOrientationPatient[5])];
}
return {
frameOfReferenceUID: dataSet.string('x00200052'),
rows: dataSet.uint16('x00280010'),
columns: dataSet.uint16('x00280011'),
imageOrientationPatient,
rowCosines,
columnCosines,
imagePositionPatient,
sliceThickness: dataSet.floatString('x00180050'),
sliceLocation: dataSet.floatString('x00201041'),
pixelSpacing,
rowPixelSpacing,
columnPixelSpacing
};
}`
if dicom refined. it has pixelspacing or sometimes only has imagePixelSpacing.
naybe can do some compatibility?
Hi, I would like to know how can I define a list of imageIds pointing to relative paths.
For example:
var imageIds = [
'/image/1791922.jpg',
'/image/1791925.jpg',
'/image/1791928.jpg'
];
Breaks with error Error: loadImageFromImageLoader: no image loader for imageId
But if I add http://<IP_OF_SERVER>
it loads wonderfully.
Any hint?.
The png can be seen here https://v2.vetology.net/patient-manager/image?id=1100414&id2=5367541
Then if you go to the sample page http://rawgit.com/chafey/cornerstoneWebImageLoader/master/examples/index.html
and load the same issue, when it is added to the canvas, the image can't be recognized any longer
Is there some setting I can change so mages display correctly? See screenshot below:
I believe the documentation is outdated. There does not appear to be a bower.json
and grunt
does not appear to be included as a local dependency. However, webpack
appears as a dependency, and there are a number of NPM scripts.
Image loader was not updating last image id drawn at getLoadImage(); This works when I add lastImageIdDrawn = imageId; at getImageData() when lastImageIdDrawn is different to imageId.
Im trying to make custom colormaps on PNGs work.
Is there an example somewhere?
Missing main
tag in package.json
requires a more explicit path to use. You can see expected usage versus actual usage below. Here is an example of the tag in cornerstoneWADOImageLoader
:
https://github.com/chafey/cornerstoneWADOImageLoader/blob/master/package.json#L15
Expected:
Global
<script src="https://unpkg.com/cornerstone-web-image-loader"></script>
Import
import * as cornerstoneWebImageLoader from 'cornerstone-web-image-loader
Actual:
Global
<script src="https://unpkg.com/[email protected]/dist/cornerstoneWebImageLoader.js"></script>
Import
import * as cornerstoneWebImageLoader from 'cornerstone-web-image-loader/dist/cornerstoneWebImageLoader.js
If I get a 👍, I'll make a quick PR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.