NRRDLoader.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>NRRDLoader - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="Loader.html">Loader</a> → </p>
  13. <h1 translate="no">NRRDLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the NRRD format.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new NRRDLoader();
  19. const volume = await loader.loadAsync( 'models/nrrd/I.nrrd' );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">NRRDLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  25. <pre><code class="language-js">import { NRRDLoader } from 'three/addons/loaders/NRRDLoader.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="NRRDLoader" translate="no">new <a href="#NRRDLoader">NRRDLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new NRRD loader.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>manager</code></td>
  37. <td class="description last"><p>The loading manager.</p></td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Methods</h2>
  44. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">string</span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type">onProgressCallback</span>, onError : <span class="param-type">onErrorCallback</span> )</span> </h3>
  45. <div class="method">
  46. <div class="description">
  47. <p>Starts loading from the given URL and passes the loaded NRRD asset
  48. to the <code>onLoad()</code> callback.</p>
  49. </div>
  50. <table class="params">
  51. <tbody>
  52. <tr>
  53. <td class="name"><code>url</code></td>
  54. <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>onLoad</code></td>
  58. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>onProgress</code></td>
  62. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  63. </tr>
  64. <tr>
  65. <td class="name"><code>onError</code></td>
  66. <td class="description last"><p>Executed when errors occur.</p></td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <dl class="details">
  71. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  72. </dl>
  73. </div>
  74. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( data : <span class="param-type">ArrayBuffer</span> )</span><span class="type-signature"> : <a href="Volume.html">Volume</a></span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Parses the given NRRD data and returns the resulting volume data.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name"><code>data</code></td>
  83. <td class="description last"><p>The raw NRRD data as an array buffer.</p></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <dl class="details">
  88. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  89. </dl>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> The parsed volume.</dt>
  92. </dl>
  93. </div>
  94. <h3 class="name name-method" id="setSegmentation" translate="no">.<a href="#setSegmentation">setSegmentation</a><span class="signature">( segmentation : <span class="param-type">boolean</span> )</span> </h3>
  95. <div class="method">
  96. <div class="description">
  97. <p>Toggles the segmentation mode.</p>
  98. </div>
  99. <table class="params">
  100. <tbody>
  101. <tr>
  102. <td class="name"><code>segmentation</code></td>
  103. <td class="description last"><p>Whether to use segmentation mode or not.</p></td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. </div>
  108. <h2 class="subsection-title">Source</h2>
  109. <p>
  110. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/NRRDLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/NRRDLoader.js</a>
  111. </p>
  112. </article>
  113. </section>
  114. <script src="../scripts/linenumber.js"></script>
  115. <script src="../scripts/page.js"></script>
  116. </body>
  117. </html>
粤ICP备19079148号