cornerstone.playClip is not a function

352 views
Skip to first unread message

ohjua...@gmail.com

unread,
Jul 6, 2016, 10:17:05 AM7/6/16
to cornerstone platform
Hi,
I am not sure why I am getting this error.
I tested several cornerstone.js libraries.
Thanks,
Octavio

Chris Hafey

unread,
Jul 6, 2016, 10:37:06 AM7/6/16
to cornerstone platform
playClip is in the cornerstoneTools library, not cornerstone.  There is an example that shows how to use the function here:


Use "View source" to see how it is done

ohjua...@gmail.com

unread,
Jul 6, 2016, 11:23:58 AM7/6/16
to cornerstone platform
Thanks Chris,
My error was to look in the code that I downloaded:

function setupViewport(element, stack, image) {

    // Display the image on the viewer element

    cornerstone.displayImage(element, image);


    // If it's a movie (has frames), then play the clip

    if (stack.frameRate !== undefined) {

        cornerstone.playClip(element, stack.frameRate);

    }


    // Activate mouse clicks, mouse wheel and touch

    cornerstoneTools.mouseInput.enable(element);

    cornerstoneTools.mouseWheelInput.enable(element);

    cornerstoneTools.touchInput.enable(element);


    // Enable all tools we want to use with this element

    cornerstoneTools.wwwc.activate(element, 1); // ww/wc is the default tool for left mouse button

    cornerstoneTools.pan.activate(element, 2); // pan is the default tool for middle mouse button

    cornerstoneTools.zoom.activate(element, 4); // zoom is the default tool for right mouse button

    cornerstoneTools.probe.enable(element);

    cornerstoneTools.length.enable(element);

    cornerstoneTools.ellipticalRoi.enable(element);

    cornerstoneTools.rectangleRoi.enable(element);

    cornerstoneTools.wwwcTouchDrag.activate(element);

    cornerstoneTools.zoomTouchPinch.activate(element);


    // Stack tools

    cornerstoneTools.addStackStateManager(element, ['playClip']);

    cornerstoneTools.addToolState(element, 'stack', stack);

    cornerstoneTools.stackScrollWheel.activate(element);

    cornerstoneTools.stackPrefetch.enable(element);



}

That is why I was using that from cornerstone...
Thanks again

ohjua...@gmail.com

unread,
Jul 6, 2016, 12:32:38 PM7/6/16
to cornerstone platform
My problem was that I downloaded several versions but they did not match...


On Wednesday, July 6, 2016 at 10:17:05 AM UTC-4, ohjua...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages