1

I am trying to do volume rendering using one of the open source project. I want to create a surface file from my DICOM images. I know this is possible by using mango viewer exe; but I want to do it using javascript. Please help me.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <link rel="stylesheet" type="text/css" href="papaya.css" />
    <script type="text/javascript" src="papaya.js"></script>
    <script type="text/javascript">
        var finalImages = [];
        var images = window.opener.imageIds;
        for (var i = 0; i < images.length; i++)
        {
            if (images[i].substr(0, 8) == "dicomweb")
            {
                temp = images[i].substr(9, images[i].length);
                //images[i] = "http:" + images[i];
                finalImages.push("http:" + temp);
            }
        }
        var params = [];
        params["images"] = [finalImages];
        params["surfaces"] = [];       
    </script>
    <title>Papaya Viewer</title>
</head>
<body>
<div class="papaya" data-params="params">
</div>
</body>
</html>
0

1 Answer 1

2

Unfortunately, Papaya only supports reading surface files (VTK, GIFTI, etc) not generating them.

If you want to do it yourself in JavaScript, looking into Marching Cubes. This is what Mango uses and I think is a common approach to converting image volume data to surface data. (See this and also this.)

Once you've created your surface data (triangles, indices) you'll need to organize it into a format Papaya can read. VTK is probably the simplest, but here's the complete list of supported formats.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.