You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
</span></span></code></pre></div></div></div><p>Compile the project in the development environment. Make sure to select a <em>Release</em> build.</p><h3id=use-your-module-in-mevislab>Use Your Module in MeVisLab</h3><p>Your compiled *<em>.dll</em> is available in your project directory under <em>Sources/lib</em>. In order to use it in MeVisLab, it needs to be copied to the <em>lib</em> folder of your user package.</p><p>This only works in a post-build step.</p><p>If the environment variable <em>MLAB_AUTOMATIC_POSTBUILD_COPY</em> is set, the newly compiled DLLs and .lib files are copied to the correct location when MeVisLab restarts. Otherwise, they must be copied manually.</p><p>For testing purposes, you can use a <code>LocalImage</code> module and two <code>View2D</code> modules. Connect the <code>SimpleAdd</code> module to the second <code>View2D</code> and change the <field>Constant Value</field> field.</p><p><pclass=page-image><adata-modal=bs-lightboxhref=images/tutorials/image_processing/cpp/cpp1_6.pngtitle="Testing Network"><imgid="Testing Network" class="img-fluid rounded" src=images/tutorials/image_processing/cpp/cpp1_6.pngalt="Testing Network" title="Testing Network"></a><figcaptionclass=figure-caption>Testing Network</figcaption></p></p><p>The output image of the module <code>SimpleAdd</code> is automatically recalculated on changing the field <field>Constant Value</field>. This is already implemented in the generated code of the file below:</p><divclass=cardstyle=margin-bottom:2rem><divclass="card-header d-flex justify-content-between"><pclass="card-title m-0">mlSimpleAdd.cpp</p></div><divclass=card-body><divclass=highlight><pretabindex=0style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none><codeclass=language-c++data-lang=c++><spanstyle=display:flex><span><spanstyle=color:#66d9ef>void</span> SimpleAdd<spanstyle=color:#f92672>::</span>handleNotification(Field<spanstyle=color:#f92672>*</span> field)
70
+
</span></span></code></pre></div></div></div><p>Compile the project in the development environment. Make sure to select a <em>Release</em> build.</p><h3id=use-your-module-in-mevislab>Use Your Module in MeVisLab</h3><p>Your compiled *<em>.dll</em> is available in your project directory under <em>Sources/lib</em>. In order to use it in MeVisLab, it needs to be copied to the <em>lib</em> folder of your user package.</p><p>This only works in a post-build step.</p><p>If the environment variable <em>MLAB_AUTOMATIC_POSTBUILD_COPY</em> is set, the newly compiled DLLs and <em>.lib</em> files are copied to the correct location when MeVisLab restarts. Otherwise, they must be copied manually.</p><p>For testing purposes, you can use a <code>LocalImage</code> module and two <code>View2D</code> modules. Connect the <code>SimpleAdd</code> module to the second <code>View2D</code> and change the <field>Constant Value</field> field.</p><p><pclass=page-image><adata-modal=bs-lightboxhref=images/tutorials/image_processing/cpp/cpp1_6.pngtitle="Testing Network"><imgid="Testing Network" class="img-fluid rounded" src=images/tutorials/image_processing/cpp/cpp1_6.pngalt="Testing Network" title="Testing Network"></a><figcaptionclass=figure-caption>Testing Network</figcaption></p></p><p>The output image of the module <code>SimpleAdd</code> is automatically recalculated on changing the field <field>Constant Value</field>. This is already implemented in the generated code of the file below:</p><divclass=cardstyle=margin-bottom:2rem><divclass="card-header d-flex justify-content-between"><pclass="card-title m-0">mlSimpleAdd.cpp</p></div><divclass=card-body><divclass=highlight><pretabindex=0style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none><codeclass=language-c++data-lang=c++><spanstyle=display:flex><span><spanstyle=color:#66d9ef>void</span> SimpleAdd<spanstyle=color:#f92672>::</span>handleNotification(Field<spanstyle=color:#f92672>*</span> field)
71
71
</span></span><spanstyle=display:flex><span> {
72
72
</span></span><spanstyle=display:flex><span><spanstyle=color:#75715e>// Handle changes of module parameters and input image fields here.
</span></span></code></pre></div></div></div><h2id=summary>Summary</h2><ul><li>MeVisLab allows to develop your own C++ modules.</li><li>The Project Wizard already generates all necessary *<em>.cpp</em> and *<em>.h</em> files and a loop through all voxels of the input image.</li><li>Changes of user-defined fields automatically lead to a recalculation of the input image.</li></ul></div></div><script>constbody_element=document.querySelector("html body"),modal_div=document.createElement("div");letmodal_window=document.body.appendChild(modal_div),modal_html='<div class="modal fade" id="lightboxModalFullscreen" tabindex="-1" aria-labelledby="lightboxModalFullscreenLabel" aria-hidden="true"><div class="modal-dialog modal-fullscreen" data-bs-dismiss="modal" aria-label="Close"><div class="modal-content border-0"><div class="modal-body d-flex align-self-center align-items-center justify-content-center"><div class="modal-custom"><img src="" id="LightboxCanvas" class="img-fluid" data-bs-dismiss="modal" aria-label="Close" /><figcaption id="LightboxCaption" class="figure-caption"></figcaption></div></div></div></div></div>';modal_window.innerHTML=modal_html,Array.from(document.querySelectorAll('[data-modal*="bs-lightbox"]')).forEach(e=>{e.setAttribute("data-bs-toggle","modal"),e.setAttribute("data-bs-target","#lightboxModalFullscreen"),e.addEventListener("click",t=>{constn=e.getAttribute("href"),s=e.getAttribute("title");document.getElementById("LightboxCanvas").src=n,document.getElementById("LightboxCaption").innerHTML=s,t.preventDefault(),console.log(n)})})</script><hr><divclass=rowstyle=margin:25px!important><divclass=col><ahref=https://mevislab.github.io/examples/pull/139/tutorials/image_processing/cpp_development/title="Developing Your Own C++ Modules" class="btn btn-outline-secondary btn-sm" role=buttonaria-pressed=true><svgwidth="16" height="16" fill="currentColor" class="bi bi-skip-start-fill" viewBox="0 0 16 16"><pathd="M4 4a.5.5.0 011 0v3.248l6.267-3.636c.54-.313 1.232.066 1.232.696v7.384c0 .63-.692 1.01-1.232.697L5 8.753V12a.5.5.0 01-1 0V4z"/></svg> Developing Your Own C++ Modules</a></div><divclass=colstyle=text-align:right><ahref=https://mevislab.github.io/examples/pull/139/tutorials/image_processing/image_processing1/title="Example 1: Applying Scalar Functions to Two Images" class="btn btn-outline-secondary btn-sm" role=buttonaria-pressed=true>Example 1: Applying Scalar Functions to Two Images
89
+
</span></span></code></pre></div></div></div><h2id=summary>Summary</h2><ul><li>MeVisLab allows to develop your own C++ modules.</li><li>The Project Wizard already generates all necessary <em>.cpp</em> and <em>.h</em> files and a loop through all voxels of the input image.</li><li>Changes of user-defined fields automatically lead to a recalculation of the input image.</li></ul></div></div><script>constbody_element=document.querySelector("html body"),modal_div=document.createElement("div");letmodal_window=document.body.appendChild(modal_div),modal_html='<div class="modal fade" id="lightboxModalFullscreen" tabindex="-1" aria-labelledby="lightboxModalFullscreenLabel" aria-hidden="true"><div class="modal-dialog modal-fullscreen" data-bs-dismiss="modal" aria-label="Close"><div class="modal-content border-0"><div class="modal-body d-flex align-self-center align-items-center justify-content-center"><div class="modal-custom"><img src="" id="LightboxCanvas" class="img-fluid" data-bs-dismiss="modal" aria-label="Close" /><figcaption id="LightboxCaption" class="figure-caption"></figcaption></div></div></div></div></div>';modal_window.innerHTML=modal_html,Array.from(document.querySelectorAll('[data-modal*="bs-lightbox"]')).forEach(e=>{e.setAttribute("data-bs-toggle","modal"),e.setAttribute("data-bs-target","#lightboxModalFullscreen"),e.addEventListener("click",t=>{constn=e.getAttribute("href"),s=e.getAttribute("title");document.getElementById("LightboxCanvas").src=n,document.getElementById("LightboxCaption").innerHTML=s,t.preventDefault(),console.log(n)})})</script><hr><divclass=rowstyle=margin:25px!important><divclass=col><ahref=https://mevislab.github.io/examples/pull/139/tutorials/image_processing/cpp_development/title="Developing Your Own C++ Modules" class="btn btn-outline-secondary btn-sm" role=buttonaria-pressed=true><svgwidth="16" height="16" fill="currentColor" class="bi bi-skip-start-fill" viewBox="0 0 16 16"><pathd="M4 4a.5.5.0 011 0v3.248l6.267-3.636c.54-.313 1.232.066 1.232.696v7.384c0 .63-.692 1.01-1.232.697L5 8.753V12a.5.5.0 01-1 0V4z"/></svg> Developing Your Own C++ Modules</a></div><divclass=colstyle=text-align:right><ahref=https://mevislab.github.io/examples/pull/139/tutorials/image_processing/image_processing1/title="Example 1: Applying Scalar Functions to Two Images" class="btn btn-outline-secondary btn-sm" role=buttonaria-pressed=true>Example 1: Applying Scalar Functions to Two Images
0 commit comments