Conversation
|
A preview of 9173128 is uploaded and can be seen here: ✨ https://mevislab.github.io/examples/pull/116/ ✨ Changes may take a few minutes to propagate. Since this is a preview of production, content with |
| A macro module can be used to develop your own functionality in MeVisLab. You have two main options for how to use it: | ||
|
|
||
| MeVisLab provides different types of modules, which can be distinguished by their color. The brown modules are called Macro modules. Macro modules condense a whole network into one module. You can open the internal network by pressing the middle mouse button {{< mousebutton "middle" >}} or via right mouse click {{< mousebutton "right" >}} and select {{< menuitem "Help" "Show Internal Network" >}}. Macro modules provide the possibility to create customized user interfaces and Python interactions. | ||
| * **With Internal Networks**: Use a macro module to reuse a network of modules. For example, if you build a network that applies a specific image filter and you want to use this setup in multiple projects, you can wrap the entire network into a single macro module. This way, you don’t need to manually reconnect all the individual modules each time — you just use your macro module.You can see in the left side of the image is the Internal network. You can see an example in [Basic Mechanics of MeVisLab (Example: Building a Contour Filter)](/tutorials/basicmechanisms#TutorialMacroModules). |
There was a problem hiding this comment.
.You can see in the left side of the image is the Internal network. ->
. You can see the internal network at the left side of the image.
- which image this refers to?
| in packages. A package structure makes it easy to exchange projects and | ||
| different functionalities between people. No newline at end of file | ||
| * **Without Internal Networks**: Use a macro module to add your own Python code. If MeVisLab is missing a specific functionality, you can write your own Python script and include it in a macro module. | ||
| This allows you to extend the software with custom behavior that integrates smoothly into your project. You can see the right side of the image the python code. |
There was a problem hiding this comment.
You can see the right side of the image the python code. ->
You can see the Python code at the right side of the image.
| * **Implementation:** | ||
| Macro modules are primarily defined using the MeVisLab Definition Language (MDL) and often incorporate Python scripting for more dynamic behavior. You don't need to write C++ code to create a macro module. | ||
| * **User Interface:** | ||
| You can define your own User Interface for macro modules. |
| * A global macro is listed in the Modules panel and module search. | ||
|
|
||
| {{<alert class="info" caption="Info">}} | ||
| Packages are the way MeVisLab organizes different development projects. You can organize zour own modules, test cases or C++ modules in a package. |
|
|
||
| You can also add fields to your macro module. Fields allow you to change parameters for your module or to see the values of results. Fields can also be added to the panel of the macro module so that the user can change them. | ||
| * **Fields:** These are parameters that control the module's behavior, typically visible in the modules panel or in the Module Inspector. You define fields in the *\*.script* file using the Field keyword, specifying the data type, default value, and other properties. | ||
| The below figure shows the input , outoutand feilds : |
|
|
||
| ### Files Associated with a Macro Module: | ||
| Macro modules typically contain the following files: | ||
| * **Definition file (*\*.def*):** The module definition file contains the definition and information about the module like name, author, package, etc. **Defintion files are only available for global macro modules**. |
| Macro modules typically contain the following files: | ||
| * **Definition file (*\*.def*):** The module definition file contains the definition and information about the module like name, author, package, etc. **Defintion files are only available for global macro modules**. | ||
|
|
||
| * **Script file (*\*.script*):** The script file defines inputs, outputs, fields and the user interface of the macro module. In case you want to add Python code, it includes the reference to the Python script file. The *\*.script* file allows you to define Python functions to be called for multiple situations. |
There was a problem hiding this comment.
for multiple situations -> on field changes and user interactions
| * Fields: Parameters for user control | ||
| * Field Listeners: Run Python code when a field value changes | ||
|
|
||
| * Package: are the way MeVisLab organizes different development projects. Required for global macros. No newline at end of file |
| --- | ||
| title: "Example 2: Macro modules and Module Interaction" | ||
| date: 2022-06-15T08:58:44+02:00 | ||
| date: 19-05-2025 |
|
|
||
| * **Field changes**: You can also react on any changes of fields in your module and create Field Listeners. See below for details. | ||
| * **Python file (*\*.py*):** *(Optional)*: The Python file contains the Python code that is used by the module. You can add Python functions to fields or UI elements to react on user interactions in the *\*.script* file. | ||
|
|
There was a problem hiding this comment.
Also add section about .mlab and .mhelp files here.
No description provided.