NRRDLoader.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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" rel="noopener">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"><a href="LoadingManager.html">LoadingManager</a></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">
  37. <strong>manager</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The loading manager.</p>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Methods</h2>
  48. <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"><a href="global.html#onProgressCallback">onProgressCallback</a></span>, onError : <span class="param-type"><a href="global.html#onErrorCallback">onErrorCallback</a></span> )</span> </h3>
  49. <div class="method">
  50. <div class="description">
  51. <p>Starts loading from the given URL and passes the loaded NRRD asset
  52. to the <code>onLoad()</code> callback.</p>
  53. </div>
  54. <table class="params">
  55. <tbody>
  56. <tr>
  57. <td class="name">
  58. <strong>url</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The path/URL of the file to be loaded. This can also be a data URI.</p>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class="name">
  66. <strong>onLoad</strong>
  67. </td>
  68. <td class="description last">
  69. <p>Executed when the loading process has been finished.</p>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="name">
  74. <strong>onProgress</strong>
  75. </td>
  76. <td class="description last">
  77. <p>Executed while the loading is in progress.</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="name">
  82. <strong>onError</strong>
  83. </td>
  84. <td class="description last">
  85. <p>Executed when errors occur.</p>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. <dl class="details">
  91. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  92. </dl>
  93. </div>
  94. <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>
  95. <div class="method">
  96. <div class="description">
  97. <p>Parses the given NRRD data and returns the resulting volume data.</p>
  98. </div>
  99. <table class="params">
  100. <tbody>
  101. <tr>
  102. <td class="name">
  103. <strong>data</strong>
  104. </td>
  105. <td class="description last">
  106. <p>The raw NRRD data as an array buffer.</p>
  107. </td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <dl class="details">
  112. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  113. </dl>
  114. <dl class="details">
  115. <dt class="tag-returns"><strong>Returns:</strong> The parsed volume.</dt>
  116. </dl>
  117. </div>
  118. <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>
  119. <div class="method">
  120. <div class="description">
  121. <p>Toggles the segmentation mode.</p>
  122. </div>
  123. <table class="params">
  124. <tbody>
  125. <tr>
  126. <td class="name">
  127. <strong>segmentation</strong>
  128. </td>
  129. <td class="description last">
  130. <p>Whether to use segmentation mode or not.</p>
  131. </td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. </div>
  136. <h2 class="subsection-title">Source</h2>
  137. <p>
  138. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/NRRDLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/NRRDLoader.js</a>
  139. </p>
  140. </article>
  141. </section>
  142. <script src="../scripts/linenumber.js"></script>
  143. <script src="../scripts/page.js"></script>
  144. </body>
  145. </html>
粤ICP备19079148号